码迷,mamicode.com
首页 > 编程语言 > 详细

quartz spring配置

时间:2016-12-29 23:46:20      阅读:230      评论:0      收藏:0      [点我收藏+]

标签: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配置

标签:quartz spring

原文地址:http://881206524.blog.51cto.com/10315134/1887456

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!