首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Spring -Quartz的配备

2012-09-14 
Spring -Quartz的配置?xml version1.0 encodingUTF-8?beans xmlnshttp://www.springframework.

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>


动态设置任务时间:

热点排行