一次简单使用Spring+Quartz配置定时任务
2021-02-05 18:14
标签:|| inter tde null eth prope tailf bsp java 1、 2、 3、 4、 5、 在CreateFileAndStuff.Java 一次简单使用Spring+Quartz配置定时任务 标签:|| inter tde null eth prope tailf bsp java 原文地址:https://www.cnblogs.com/nachdenken/p/12786733.htmlbean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
property name="triggers">
list>
ref local="createFileAndStuffTrigger"/>
list>
property>
bean>
bean id="createFileAndStuffTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
property name="startDelay">value>5000value>property>
property name="repeatCount">value>-1value>property>
property name="repeatInterval">value>36000000value>property>
property name="jobDetail">ref bean="createFileAndStuffTask" />property>
bean>
bean id="createFileAndStuffTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
property name="targetObject">
ref bean="jobService" />
property>
property name="targetMethod">
value>doCreatevalue>
property>
property name="concurrent">
value>falsevalue>
property>
bean>
bean id="jobService" class="com.task.CreateFileAndStuff">bean>
/**
* 开始生成
*/
public synchronized void doCreate(){
if ("yes".equals(ConfigUtil.createFileAndSuffSwitch())) {
List
文章标题:一次简单使用Spring+Quartz配置定时任务
文章链接:http://soscw.com/index.php/essay/51436.html