定时器配置

 <!-- quartz.properties:基本配置 -->
 <bean id="quartzScheduler"
  class="org.springframework.scheduling.quartz.SchedulerFactoryBean"
  lazy-init="false">
  <property name="triggers">
   <list>
    <ref bean="accountFileDownload" />
   </list>
  </property>

  <property name="configLocation"
   value="classpath:config/quartz.properties" />
    <!-- 启动时延期5秒开始任务 -->
  <property name="startupDelay" value="5" />
 </bean>

 <!-- 每小时执行任务Trigger定义(交通银行对账文件下载) -->
 <!-- 继承 此类
 <bean id="accountFileDownload"
  class="org.springframework.scheduling.quartz.CronTriggerBean">
  -->
 <bean  id="accountFileDownload"
      class="com.cucpay.man.busi.CronTriggerBeanImpl">
  <property name="jobDetail">
  <bean
    class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
    <property name="targetObject">
     <bean
      class="com.cucpay.man.core.quartz.QuartzTest">
     </bean>
    </property>
    <property name="targetMethod" value="run" />
    <!-- 同一任务在前一次执行未完成而Trigger时间又到时是否并发开始新的执行, 默认为true. -->
    <property name="concurrent" value="false" />
   </bean>
   </property>
  <!--此处保留 这样才能进入set方法 设定时间无所谓-->
  <property name="cronExpression"
   value="${quartz.test}" />
 </bean>

<!--架包 quartz**.jar-->

quartz.properties 配置文件

#============================================================================
# \u914d\u7f6e Main Scheduler Properties
#============================================================================
org.quartz.scheduler.instanceName = DefaultQuartzScheduler
org.quartz.scheduler.rmi.export = false
org.quartz.scheduler.rmi.proxy = false
org.quartz.scheduler.wrapJobExecutionInUserTransaction = false

#============================================================================
# \u914d\u7f6e\u6267\u884c\u7ebf\u7a0b\u6c60
#============================================================================
org.quartz.threadPool.class = org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor
org.quartz.threadPool.threadCount = 3
org.quartz.threadPool.threadPriority = 1
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true

#============================================================================
# \u914d\u7f6e JobStore
#============================================================================
org.quartz.jobStore.misfireThreshold = 60000

#\u5185\u5b58\u4e2dJobStore, \u670d\u52a1\u5668\u91cd\u542f\u65f6\u6267\u884c\u8bb0\u5f55\u4f1a\u4e22\u5931
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值