spring定时器的配置_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > spring定时器的配置

spring定时器的配置

 2013/10/31 18:12:01  xling09  程序员俱乐部  我要评论(0)
  • 摘要:<beans><beanid="rdsRetrieveTask"class="具体的任务类"><propertyname="assemblyAndPost"ref="assemblyAndPost"></property></bean><beanid="rdsRetrieveTaskJobDetail"class="org.springframework.scheduling.quartz
  • 标签:配置 Spring
<beans>
<bean id="rdsRetrieveTask" class="具体的任务类">
<property name="assemblyAndPost" ref="assemblyAndPost"></property>
</bean>
<bean id="rdsRetrieveTaskJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="rdsRetrieveTask" />
</property>
<property name="targetMethod">
<value>具体任务类的执行方法value>
</property>
<property name="concurrent">
<value>false</value>
</property>
</bean>


<bean id="cronRdsRetrieveTrigger"  class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="rdsRetrieveTaskJobDetail" />
</property>
<property name="cronExpression">
<value>0 0/1 * * * ?</value>//触发时间
</property>
</bean>

<bean id="rdsRetrieveScheduler"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="cronRdsRetrieveTrigger" />
</list>
</property>

</bean>

</beans>
发表评论
用户名: 匿名