spring quartz定时任务 quartzSpringJavaXML
程序员文章站
2024-02-26 10:53:22
...
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <!-- <ref local="IssureNoticeTrigger" /> <ref local="LotStateNoticeTrigger" /> <ref local="LotWinNoticeTrigger" /> --> </list> </property> </bean> <bean id="IssureNoticeTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean"> <property name="startDelay" value="10000"/> <property name="repeatInterval" value="180000" /> <property name="jobDetail"> <bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="IssureNotice" />//目标类 <property name="targetMethod" value="render" />//类中的方法 </bean> </property> </bean> <bean id="LotStateNoticeTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean"> <property name="startDelay" value="10000" /> <property name="repeatInterval" value="180000" /> <property name="jobDetail"> <bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="LotStateNotice" /> <property name="targetMethod" value="render" /> </bean> </property> </bean> <bean id="LotWinNoticeTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean"> <property name="startDelay" value="10000" /> <property name="repeatInterval" value="180000" /> <property name="jobDetail"> <bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="LotWinNotice" /> <property name="targetMethod" value="render" /> </bean> </property> </bean> </beans>
上一篇: 遍历json对象
推荐阅读
-
spring quartz定时任务 quartzSpringJavaXML
-
spring quartz定时任务 quartzSpringJavaXML
-
详解Spring Cloud Stream使用延迟消息实现定时任务(RabbitMQ)
-
Springboot整个Quartz实现动态定时任务的示例代码
-
springboot整合Quartz实现动态配置定时任务的方法
-
spring boot定时任务接收邮件并且存储附件的方法讲解
-
Spring Boot定时任务的使用方法
-
浅谈SpringBoot集成Quartz动态定时任务
-
Quartz+Spring Boot实现动态管理定时任务
-
详解Spring Boot 中实现定时任务的两种方式