I have a requirement where a java class needs to be added to a scheduler. Could some one please let me know how to achieve this?
- job scheduler by Aaron Craven on February 07 2005 14:03 EST
- reply from SIVA by Sivasubramaniam nallasamy on February 08 2005 05:41 EST
- Reply from Priya by Sivasubramaniam nallasamy on February 15 2005 03:57 EST
Hello,I have a requirement where a java class needs to be added to a scheduler. Could some one please let me know how to achieve this?ThanksPriya
I've spend a lot of time researching the options in this department, and the answer depends on your budget and your needs.
The three best options I came across were:
- create your own scheduler
- Quartz scheduler
There are, of course, other products out there, but in our research, those seemed the best options. I've included links to the articles that helped me most below:
A new article, which I have not read on TSS can also be found at http://www.theserverside.com/news/thread.tss?thread_id=24446
If you have the budget, I would definitely check out flux. Get the evaluation and try it out. If not Quartz may be the way to go, but it seems to have a steeper learning curve.
If you simply want to schedule a class to execute every so often, why not java.util.Timer?
If it is on the J2EE app server, can you use EJB2.1 timers?
My advice; do the simplest thing that can work ;)
Or maybe I missed something :)
If you can do it with Timer, that's easy thus good.
I have been using Quartz for all my scheduler needs the last three years or so, and allways found it very reliable and efficient.
public class Scheduler
Implementation of a priority scheduler. The scheduler maintains a queue to the end of which all tasks are added. It continually looks at the first queue element, assigns a thread to it, runs the thread and waits for completion. When a new priority task is added, it will be added to the head of the queue and the scheduler will be interrupted. In this case, the currently handled task is suspended, and the one at the head of the queue handled. This is recursive: a priority task can always be interrupted by another priority task. Resursion ends when no more priority tasks are added, or when the thread pool is exhausted.
Thanks a ton for trying to help me out. I was able to resolve my problem my creating a bat file and using windows task scheduler. I had to use the existing java class, so I could not implement one of your suggested methods.
Ok Priya No problem some how u got solved the issue. Have you worked on any migration project on Weblogic to Websphere?
Thanks in advance.
You might try JobServer, it is another option. It is an all java job scheduler with a nice Java/GWT plugin API for writing tasklets and giving tasklets GWT GUI interfaces for customization. It has lots of nice reporting and tracking features and very good scheduling rules. Rauf http://grandlogic.com "The SOA Automation Company"