<bean id="refreshPFConfigDataJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="pfConfiguration"/>
<property name="targetMethod" value="refreshPFConfigData"/>
<property name="concurrent" value="false"/>
</bean>
<bean id="refreshPFConfigDataTrig" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail" ref="refreshPFConfigDataJob"/>
<!-- Delay for 10 minutes -->
<property name="startDelay" value="600000"/>
<!-- Repeat every 5 minutes -->
<property name="repeatInterval" value="300000"/>
</bean>
<bean id="refreshPFConfigDataScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false">
<property name="triggers">
<list>
<ref bean="refreshPFConfigDataTrig" />
</list>
</property>
<property name="startupDelay" value="1"/>
</bean>
分享到:
相关推荐
<bean id="myJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> ``` 在这个例子中,`cronExpression`定义了任务的执行频率,`targetObject`和`targetMethod`指定...
<bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <!-- 指定Job类和执行方法 --> <bean class="org.springframework.scheduling.quartz....
<bean id="myJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <bean id="myTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> *...
<bean id="temperMonitorTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <!-- 调用的类 --> <!-- 调用类中的方法 --> <value>temperatureMonitorTimer ...
- 通过实现`org.springframework.scheduling.quartz.JobExecutionException`,可以捕获Job执行过程中的异常,进行统一处理。 8. **事务支持** - 如果Job需要在数据库事务中执行,可以利用Spring的事务管理功能,...
import org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean; import org.springframework.scheduling.quartz.CronTriggerFactoryBean; @Bean public JobDetail jobDetail() { ...
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <value>work <!-- job的配置结束 --> <!-- 工作的bean --> <bean id="myJob" class="com.tgb.lk....
<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <!-- 这里添加触发器配置 --> <!-- 这里添加任务详情配置 --> ``` 然后,定义Job类并实现`org....
<bean id="emailJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <bean id="emailTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean...
<bean id="demo1" class="org.springframework.scheduling.quartz.CronTriggerBean"> * * * ?"/> ``` - **SimpleTriggerBean**:这是一种简单的触发器,可以配置初始延迟和重复间隔。例如,“demo2”被配置...
<bean id="querytestController" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <bean id="querytestControllerTrigger" class="org.springframework.scheduling....
<bean id="myJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <bean id="myCronTrigger" class="org.springframework.scheduling.quartz....
<bean id="myJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> ``` 最后,别忘了在Spring配置文件中注册Trigger: ```xml <bean id="schedulerBean" class="...
<bean id="myJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> * *...
<bean id="myJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="concurrent" value="false" /> <!-- Job是否可并发执行 --> <!-- 配置Trigger --> ...
<bean id="myJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> ``` 最后,将Job注入到Service或者DAO层,以便在`executeJob()`方法中执行实际的业务逻辑: ...
import org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean; import org.springframework.scheduling.quartz.SchedulerFactoryBean; import org.springframework.stereotype.Component; @...
<bean id="myJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <bean id="myTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> *...
<bean id="myJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <bean id="myTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> ...
<bean id="myJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <bean id="myTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">...