开发者

Schedule a task

Iam using jboss5.1.x, EJB3.0

I need to schedule a task in my application.开发者_运维技巧 which way would you recommend me to do it according to version I am using below?

I heard about SAR, but i am not sure if there is a way which is more appropriate or updated to do it nowdays

thanks,

ray.


I would recommend Quartz

Quartz is a full-featured, open source job scheduling service that can be integrated with, or used along side virtually any Java EE or Java SE application - from the smallest stand-alone application to the largest e-commerce system. Quartz can be used to create simple or complex schedules for executing tens, hundreds, or even tens-of-thousands of jobs; jobs whose tasks are defined as standard Java components that may execute virtually anything you may program them to do. The Quartz Scheduler includes many enterprise-class features, such as JTA transactions and clustering.

  • Quick Start Guide


I also recommend using Quartz. In case you cannot use it, don't forget the EJB 3.0 standard has the concept of EJB Timer services. You can read more here.


Java EE API javax.ejb.TimedObject supports the feature.


In Java you have TimerTask , you can schedule a task to run at the particular time.But i would recommend Quartz.According to your scenario , you have built in EJB Timer class available , hope will solve the purpose.

Please read this article

http://mhashem.wordpress.com/2010/03/29/java-quartz-scheduler-ejb-3-0-timer-service-and-java-timer-task-when-to-use-each/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜