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

spring定时任务

时间:2016-09-09 16:39:00      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>

    <!-- 任务类 -->
    <bean id="healthCheckupTask" class="org.springframework.scheduling.quartz.JobDetailBean">
        <property name="jobClass" value="com.demo.task.HealthCheckupTask"></property>
    </bean>

 
    <!--  调度触发器 -->
    <bean id="healthCheckupTaskTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail" ref="healthCheckupTask" />
        <property name="cronExpression" value="0 0/10 * * * ?"></property>
    </bean>

 

    <!-- 调度工厂 -->
    <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="triggers">
            <list>
                <ref bean="healthCheckupTaskTrigger" />
                 
            </list>
        </property>
    </bean>
</beans>

 

spring定时任务

标签:

原文地址:http://www.cnblogs.com/wdnnccey/p/5857079.html

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