Spring -Quartz的配置
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"><bean name="springTimer" ref="springTimer"></property><property name="period" value="2000"></property></bean> --><!-- 二、延迟定时器任务 --><bean name="scheduledDelayTask" ref="springTimer"></property>--><property name="timerTask" ref="schedulingMethod"></property><property name="period" value="2000"></property><property name="delay" value="3000"></property></bean> <bean name="quartzTimer" value="com.th.util.timing.SpringQuartz"/> <!-- 此处必须写类。。。。不能ref --><!-- 注入<property name="jobDataAsMap"><map><entry key="xxxService" value-ref="xxxService"></entry></map></property> --></bean><!-- 调度工作 --> <bean id="simpleReportTrigger" ref="springQuartzJob"></property><property name="startDelay" value="3000"></property><property name="repeatInterval" value="1000"></property></bean> <bean name="quartzMethod" ref="quartzMethod"></property><property name="targetMethod" value="schedulingTimerOrQuartzMethod"></property></bean><bean name="schedulingMethod" ref="quartzMethod"></property><property name="targetMethod" value="schedulingTimerOrQuartzMethod"></property></bean><!-- 调度一个cron工作 --><bean id="cronQuartzTrigger" ref="springQuartzJob"/> --><property name="jobDetail" ref="scheduledQuartzMethodTrigger"/><property name="cronExpression" value="0 56 19 * * ?"/></bean><!-- 启动工作 --><!--java Timer 调度任务 --><bean class="org.springframework.scheduling.timer.TimerFactoryBean"><property name="scheduledTimerTasks"><list><!-- <ref bean="scheduledTask"/> --><ref bean="scheduledDelayTask"/></list></property></bean> <!-- <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"><property name="triggers"><list><ref bean="simpleReportTrigger"/><ref bean="cronQuartzTrigger"/></list></property></bean>--></beans>
动态设置任务时间: