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

spring核心配置文件_Quartz定时任务调度配置

时间:2017-06-03 18:14:05      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:quartz   value   erb   rom   factor   调度   cto   定时   jdbc   

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
 xmlns:context="http://www.springframework.org/schema/context" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
 xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:tx="http://www.springframework.org/schema/tx"
 xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:task="http://www.springframework.org/schema/task"
 xsi:schemaLocation="
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
  http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  http://www.springframework.org/schema/data/jpa
  http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">


 <bean id="helloJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean"> 
     <property name="jobClass" value="cn.itcast.bos.quartz.PromotionJob"/> 
     <property name="jobDataAsMap"> 
          <map> 
             <entry key="timeout" value="5"/>
          </map> 
     </property> 
 </bean>

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

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

spring核心配置文件_Quartz定时任务调度配置

标签:quartz   value   erb   rom   factor   调度   cto   定时   jdbc   

原文地址:http://www.cnblogs.com/huqin/p/6937947.html

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