zoukankan      html  css  js  c++  java
  • spring4的定时器设置

    主要架包:quartz-all-2.1.6.jar.

    spring配置:

    <?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:jaxws="http://cxf.apache.org/jaxws"  xsi:schemaLocation="   http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans-2.0.xsd   http://cxf.apache.org/jaxws   http://cxf.apache.org/schemas/jaxws.xsd">    

    <bean id="complexJobDetail"   class="org.springframework.scheduling.quartz.JobDetailFactoryBean">   

    <property name="jobClass" value="com.chebaobao.carinfo.action.CarInfoQuart" />   

    <property name="jobDataMap">    

    <map>    

    <!--用到的service配置-->

    <entry key="carInfoService" value-ref="carInfoService"></entry>    </map>   </property>   

    <property name="durability" value="true" />  

    </bean>

     <bean id="cronTrigger"   class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">   

    <property name="jobDetail" ref="complexJobDetail" />

      <!-- 每周五 23点 -->   

    <property name="cronExpression" value="0 0 23 ? * FRI" />  

    </bean>  

    <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">  

     <property name="jobDetails">    

    <list>     

    <ref bean="complexJobDetail" />   

     </list>  

     </property>

      <property name="triggers">   

     <list>    

     <ref bean="cronTrigger" />

       </list>  

     </property>  

    </bean>

    </beans>

  • 相关阅读:
    OC学习 Extension
    OC习题 切分字符串 处理色值和名称 (知识点: 字典,枚举,数组,字符串)
    OC学习 Protocol delegate
    epoll反应堆模型
    socket IPC(本地套接字 domain)
    UDP协议简单的CS模型实现
    linux系统编程统计一个目录下的普通文件个数
    Vs2003多窗口下的复杂数据传递
    NET下XML的访问
    OWC中双刻度图表的实现
  • 原文地址:https://www.cnblogs.com/shendandan/p/4568508.html
Copyright © 2011-2022 走看看