quartz spring配置
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了quartz spring配置相关的知识,希望对你有一定的参考价值。
官网地址:http://www.quartz-scheduler.org/downloads/
1、第一步
下载相关jar包
2、配置文件
<?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.xsd">
<bean id="jobXXTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="taskXXService"/>
<property name="targetMethod" value="handleXX"/>
</bean>
<bean id="triggerXXTask" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="jobXXTask" />
<property name="cronExpression" value="0 0/1 * * * ?" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="triggerXXTask"/>
</list>
</property>
</bean>
</beans>
以上是关于quartz spring配置的主要内容,如果未能解决你的问题,请参考以下文章