Posted on 2008-07-11 23:44
leekiang 閱讀(280)
評論(0) 編輯 收藏 所屬分類:
spring
0 0-15 23 * * ? ? 每天23:00至23:15每分鐘觸發一次
0 0/5 * * * ????? 每隔5分鐘觸發一次
0 15 10 L * ? ? ? 每月最后一日的上午10:15觸發
bean配置的順序:
定時器的工廠bean-->cronbean-->具體實現的bean
<bean
????????class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
????????<property?name="triggers">
????????????<list>
????????????????<ref?bean="cronExpReport"?/>
????????????</list>
????????</property>
????</bean>
????<!--?每天23:00至23:15每分鐘一次觸發?-->
????<bean?id="cronExpReport"
????????class="org.springframework.scheduling.quartz.CronTriggerBean">
????????<property?name="jobDetail">
????????????<ref?bean="detailBean"?/>
????????</property>
????????<property?name="cronExpression">
????????????<value>0?0-15?23?*?*??</value>
????????</property>
????</bean>
<bean?id="detailBean"
????????class="org.springframework.scheduling.quartz.JobDetailBean">
????????<property?name="jobClass">
????????????<value>com.bo.detailBO</value>
????????</property>
????????<property?name="jobDataAsMap">
????????????<map>
?????????????????<entry?key="baseBO">
????????????????????<ref?bean="baseBO"?/>
????????????????</entry>
????????????</map>
????????</property>
?</bean>
Define of cronExpression
+------------------------------------+
| Position | Meaning | Value Scope?? |
+------------------------------------+
| 1??????? | second? | 0-59? ??????? |
+------------------------------------+
| 2??????? | minute? | 0-59????????? |
+------------------------------------+
| 3??????? | hour??? | 0-23????????? |
+------------------------------------+
| 4??????? | day???? | 1-31????????? |
+------------------------------------+
| 5??????? | month?? | 1-12????????? |
+------------------------------------+
| 6??????? | week??? | 1-7?????????? |
+------------------------------------+
| 7? 可選? | year??? | 1970-2099???? |
+------------------------------------+
http://hi.baidu.com/tonent/blog/item/894e8b525124960a0cf3e3a1.html
http://blog.csdn.net/changsure/archive/2007/03/27/1542194.aspx
http://www.xici.net/b391997/d26742282.htm