spring + Quartz定时任务配置

<bean class=”com.ydcn.pts.task.ExportBatchFileTask”></bean><bean class=”com.ydcn.pts.task.ReadBatchFileResultTask”></bean><!– 生成开卡档,停卡档,上传开卡停卡档,生成点数转移档 –><beanclass=”org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean”><property> //目标对象<ref bean=”exportBatchFileTask” /> //我们上面定义的定时任务bean</property><property> //目标方法<value>executeExportOpenAndBlackCardFiles</value> //我们在 ExportBatchFileTask 内部定义的方法的名称</property></bean><!– 上传点数转移档,上传–><beanclass=”org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean”><property> //目标对象<ref bean=”exportBatchFileTask” /> //我们在上面定义的定时任务bean</property><property> //目标方法<value>uploadTransPointsBatchFiles</value> //在定时任务中的方法</property></bean><!– 定时下载批次档,插入数据库–><beanclass=”org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean”><property><ref bean=”readBatchFileTask” /></property><property><value>downLoadBatchResultFiles</value></property></bean><!– 解析所有结果档,插入数据库–><beanclass=”org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean”><property><ref bean=”readBatchFileTask” /></property><property><value>execAll</value></property></bean><!–读取CSV文件 –><beanclass=”org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean”><property><ref bean=”readBatchFileTask” /></property><property><value>readCSVFile</value></property></bean><!– 定义生成开卡停卡档,,上传 触发时间 –><bean class=”org.springframework.scheduling.quartz.CronTriggerBean”><property>//定时任务的工作详细<ref bean=”executeExportOpenAndBlackCardFilesJob” /> //我们上名定义的定时任务工作bean</property><property><value>0 30 15 * * ?</value> //定时任务工作的时间:value中[0 30 15 * * ?] 分别代表 [秒 分 时 天 月 ]</property></bean><!– 定义生成点数转移详细,上传 触发时间 –><bean class=”org.springframework.scheduling.quartz.CronTriggerBean”><property><ref bean=”exeExportTransPointsFilesJob” /></property><property><value>0 0 21 * * ?</value></property></bean><!– 定义读取文件目录,并且插入数据库 –><bean class=”org.springframework.scheduling.quartz.CronTriggerBean”><property><ref bean=”downLoadBatchResultFilesJob” /></property><property><value>0 0/1 * * * ?</value></property></bean><!– 定义读取开卡结果的时间 –><bean class=”org.springframework.scheduling.quartz.CronTriggerBean”><property><ref bean=”execReadAllJob” /></property><property><value>0 0/1 * * * ?</value></property></bean><!–读取csv文件 –><bean class=”org.springframework.scheduling.quartz.CronTriggerBean”><property><ref bean=”execReadCSVFileJob” /></property><property><value>0 0/1 * * * ?</value></property></bean><!– 总管理类 如果将lazy-init=’false’那么容器启动就会执行调度程序 –><bean lazy-init=”false” autowire=”no”class=”org.springframework.scheduling.quartz.SchedulerFactoryBean”><property><list><!–<ref bean=”executeExportOpenAndBlackCardFilesCron” /> –><!–<ref bean=”exeExportTransPointsFilesCron” /> –><ref bean=”downLoadBatchResultFilesCron” /><ref bean=”execReadAllCron”/><!–<ref bean=”execReadCSVFileCron”/> –></list></property></bean>却只能这样。只有对爱的人,我们才会斤斤计较,锱铢必较。

spring + Quartz定时任务配置

相关文章:

你感兴趣的文章:

标签云: