jedis,quartz

来源:互联网 发布:五石散为何会上瘾知乎 编辑:程序博客网 时间:2024/05/13 07:15

quartz:

<?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:context="http://www.springframework.org/schema/context" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context  http://www.springframework.org/schema/context/spring-context-3.2.xsd"
default-lazy-init="true">


<description>Quartz Configuration</description>


<!-- 方式二:使用MethodInvokingJobDetailFactoryBean,任务类可以不实现Job接口,通过targetMethod指定调用方法-->    
<!-- 定义目标bean和bean中的方法 -->  
<bean id="LogUploadingSftpQtz" class="com.nari.misp.webservice.modules.isc.quartz.LogUploadingSftpQtz"/>  
<bean id="LogUploadingSftpQtzMethod" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">  
<property name="targetObject">  
<ref bean="LogUploadingSftpQtz"/>  
</property>  
<property name="targetMethod">  <!-- 要执行的方法名称 -->  
<value>execute</value>  
</property>  
</bean>  
<!-- ======================== 调度触发器 ======================== -->  
<bean id="CronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerBean">  
<property name="jobDetail" ref="LogUploadingSftpQtzMethod"></property>  
<!--测试 30秒触发
<property name="cronExpression" value="0/30 * * * * ?"></property> 
-->
<!--每天23点触发 -->
<property name="cronExpression" value="0 0 23 * * ?"></property>   

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

</beans>

0 0
原创粉丝点击