您的位置:首页 > 其它

quartz实例以及定义时间格式

2006-09-05 16:23 267 查看
<?xml version='1.0' encoding='utf-8'?>
<quartz>
    <job>
        <job-detail>
            <name>ScanFTPSiteJob</name>
            <group>DEFAULT</group>
            <description>
                A job that scans an ftp site for files
            </description>
            <job-class>ScanFTPSiteJob</job-class>

            <job-data-map allows-transient-data="true">
                <entry>
                    <key>FTP_HOST</key>
                    <value>/home/cavaness/inbound</value>
                </entry>
                
                <!--  Other neccessary Job parameters here -->

            </job-data-map>
        </job-detail>

        <trigger>
            <simple>
                <name>ScanFTPSiteJobTrigger</name>
                <group>DEFAULT</group>
                <job-name>ScanFTPSiteJob</job-name>
                <job-group>DEFAULT</job-group>
                <start-time>2005-09-11 6:10:00 PM</start-time>
                <!-- repeat indefinitely every 60 seconds -->
                <repeat-count>-1</repeat-count>
                <repeat-interval>60000</repeat-interval>
            </simple>
        </trigger>

    </job>
</quartz>

字段 允许值 允许的特殊字符
 
0-59
 
, - * /
 
0-59
 
, - * /
小时
 
0-23
 
, - * /
日期
 
1-31
 
, - * ? / L W C
月份
 
1-12 或者 JAN-DEC
 
, - * /
星期
 
1-7 或者 SUN-SAT
 
, - * ? / L C #
年(可选)
 
留空, 1970-2099
 
, - * /
如上面的表达式所示:详细说明如下:The ´*´ character is used to specify all values. For example, "*" in the minute field means "every minute".“*”字符被用来指定所有的值。如:”*“在分钟的字段域里表示“每分钟”。The ´?´ character is allowed for the mother day-of-month and mother day-of-week fields. It is used to specify ´no specific value´. This is useful when you need to specify something in one of the two fileds, but not the other. See the examples below for clarification.“?”字符只在日期域和星期域中使用。它被用来指定“非明确的值”。当你需要通过在这两个域中的一个来指定一些东西的时候,它是有用的。看下面的例子你就会明白。The ´-´ character is used to specify ranges For example "10-12" in the hour field means "the hours 10, 11 and 12".“-”字符被用来指定一个范围。如:“10-12”在小时域意味着“10点、11点、12点”。The ´,´ character is used to specify additional values. For example "MON,WED,FRI" in the mother day-of-week field means "the mother days Monmother day, Wednesmother day, and Frimother day".“,”字符被用来指定另外的值。如:“MON,WED,FRI”在星期域里表示”星期一、星期三、星期五”.

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息