當前位置:
                    首頁 >
                            前端技术
>                            javascript
>内容正文                
                        
                    javascript
Spring实战 MethodInvokingJobDetailFactoryBean使用与分析
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                Spring实战  MethodInvokingJobDetailFactoryBean使用与分析
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                定義一個Job類
public class OffsetsQuartz {public void jobQuartz() {String[] clusterAliass = SystemConfigUtils.getPropertyArray("kafka.eagle.zk.cluster.alias", ",");for (String clusterAlias : clusterAliass) {execute(clusterAlias);}} } <bean id="offsetsSchedule" class="org.smartloli.kafka.eagle.web.quartz.OffsetsQuartz" /><!-- Method for configuring scheduling specific execution. --><!-- task1 --><bean id="offsetsDetail"class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"><property name="targetObject" ref="offsetsSchedule" /><property name="targetMethod" value="jobQuartz" /><property name="concurrent" value="false" /></bean><!-- Configure the trigger time for scheduling execution. --><bean id="offsetsTrigger"class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"><property name="jobDetail" ref="offsetsDetail" /><property name="cronExpression"><!-- per 5min 每5分鐘重啟一次--><value>0 0/5 * * * ?</value></property></bean><!-- 總管理類 如果將lazy-init='false'那么容器啟動就會執行調度程序 --><bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"><property name="triggers"><list><!-- All scheduling lists. --><ref local="offsetsTrigger" /></list></property></bean>轉載于:https://www.cnblogs.com/leihuazhe/p/9154232.html
總結
以上是生活随笔為你收集整理的Spring实战 MethodInvokingJobDetailFactoryBean使用与分析的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: git fatal:HttpReques
- 下一篇: C#如何生成缩略图、水印
