首页 | 本学科首页   官方微博 | 高级检索  
     

Spring的任务定时调度方法的研究比较
引用本文:丁振凡,李馨梅. Spring的任务定时调度方法的研究比较[J]. 智能计算机与应用, 2012, 0(4): 55-56,60
作者姓名:丁振凡  李馨梅
作者单位:华东交通大学信息工程学院;东北农业大学理学院
摘    要:在Web应用中,经常需要将某个工作安排在某个特定时间点去做。Spring提供了丰富多样的任务执行调度,包括使用JDK Timer、使用SchedulingTaskExecutor接口的实现类、使用Quartz、使用TaskScheduler以及采用@Scheduled注解等多种形式。研究得出,JDK Timer仅支持简单的间隔定时执行;SchedulingTaskExecutor接口的实现类提供了并发任务的各类执行方式;Quartz和TaskScheduler支持基于Cron表达式的定时调度,后者还可通过@Scheduled注解定义任务定时。

关 键 词:Spring任务调度  TaskExecutor  Quartz  TaskScheduler  @Scheduled注解

Research and Comparison of Spring Task Schedule Methods
DING Zhenfan,LI Xinmei. Research and Comparison of Spring Task Schedule Methods[J]. INTELLIGENT COMPUTER AND APPLICATIONS, 2012, 0(4): 55-56,60
Authors:DING Zhenfan  LI Xinmei
Affiliation:1 School of Information Engineering,East China Jiao Tong University,Nanchang 330013,China 2 College of Science,Northeast Agricultural University,Harbin 150030,China)
Abstract:Some tasks in web applications are often arranged in a special time.Spring provides various ways for task scheduling such as using by JDK Timer,by the concrete class which implements SchedulingTaskExecutor interface,by Quartz,by TaskScheduler,and by the annotation named @Scheduled.The paper studies and achieves that JDK Timer only supports simple Interval timing task:the concrete class of SchedulingTaskExecutor provides many kinds of execute mode for concurrent task.In additon,Quartz and TaskScheduler support time scheduling with Cron expression,and the latter also supports the definition of @Scheduled annotation.
Keywords:Spring task schedule  TaskExecutor  Quartz  TaskScheduler  @Scheduled annotation
本文献已被 CNKI 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号