Spring结合任务调度quartz
2017-09-01 16:36
399 查看
<!-- 自动更新任务 -->
<bean id="templateJob" class="项目名.service.impl.xxxJob"></bean>
<bean id="xxxMethodJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref local="templateJob" />
</property>
<property name="targetMethod">
<value>xxxMethodJob</value>
</property>
<property name="concurrent" value="false" />
</bean>
<bean id="xxxMethodJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="xxxMethodJob" />
</property>
<property name="cronExpression">
<value>0 0 0 1 */3 ?</value>
</property>
</bean>
<!-- Job管理 -->
<bean id="quartzBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" scope="singleton">
<property name="triggers">
<list>
<ref local="xxxMethodJobTrigger" />
</list>
</property>
</bean>
<bean id="quartzManagerService" class="项目名.service.impl.QuartzManagerServiceImpl">
<property name="scheduler" ref="quartzBean" />
</bean>
<bean id="templateJob" class="项目名.service.impl.xxxJob"></bean>
<bean id="xxxMethodJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref local="templateJob" />
</property>
<property name="targetMethod">
<value>xxxMethodJob</value>
</property>
<property name="concurrent" value="false" />
</bean>
<bean id="xxxMethodJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="xxxMethodJob" />
</property>
<property name="cronExpression">
<value>0 0 0 1 */3 ?</value>
</property>
</bean>
<!-- Job管理 -->
<bean id="quartzBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" scope="singleton">
<property name="triggers">
<list>
<ref local="xxxMethodJobTrigger" />
</list>
</property>
</bean>
<bean id="quartzManagerService" class="项目名.service.impl.QuartzManagerServiceImpl">
<property name="scheduler" ref="quartzBean" />
</bean>
相关文章推荐
- spring的任务调度spring+quartz和spring+jdk的Time的结合的讲解
- quartz结合spring轻松实现任务调度
- quartz结合spring轻松实现任务调度
- Quartz任务调度[Spring+Quartz结合]_实现任务的动态添加、修改和删除
- 动态Quartz任务调度(Spring结合Quartz)
- Quartz任务调度[Spring+Quartz结合]_实现任务的动态添加、修改和删除
- java计划任务调度框架quartz结合spring实现调度的配置实例代码分享
- java计划任务调度框架quartz结合spring实现调度的配置实例代码
- java计划任务调度框架quartz结合spring实现调度的配置实例代码分享
- quartz结合spring轻松实现任务调度
- Spring结合Quartz进行任务调度
- java计划任务调度框架quartz结合spring实现调度的配置实例代码分享
- 简单的 quartz 调度任务 结合spring 环境
- Quartz+Spring 分布式定时任务调度(二)- 集群配置
- [置顶] Spring研磨分析、Quartz任务调度、Hibernate深入浅出系列文章笔记汇总
- 【Java】Springboot-Quartz-分布式任务调度
- Quartz与spring结合 定时任务
- Spring + Quartz任务调度实战之动态作业调度
- spring 任务调度框架Quartz
- Spring Quartz任务调度