spring整合quartz任务调度框架使用
调度器
<bean autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="cron1" /> </list> </property> </bean>
计划器
<bean id="cron1" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail"> <ref bean="Job1" /> </property> <property name="cronExpression"> <value>0 0 2 * * ?</value> </property> </bean>
任务
<bean id="emailNofityJob" class="com.demo.task.EmailNofityJob"></bean> <bean id="Job" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject"> <ref local="emailNofityJob" /> </property> <property name="targetMethod"> <!-- 要执行的方法名称 --> <value>sendNofity</value> </property> </bean>
相关推荐
qingjiuquan 2020-05-15
Julywhj 2020-01-05
景泽元的编程 2019-12-03
与卿画眉共浮生 2017-07-27
横云断岭 2012-02-03
happyfling 2019-09-20
fairystepwgl 2016-03-22
longdan0 2018-04-20
missshy 2019-03-02
burning 2016-03-11
zhongjcbill 2015-04-21
Holyn 2014-11-21
MayMatrix 2013-11-03
chenhualeguan 2013-10-16
spprogrammer 2016-03-22