Quartz is a very good package, but it may be more than you need. Java comes with the built-in java.util.Timer and java.util.TimerTask classes, which have much less functionality, but may be sufficient for what you're doing.
Hi Dittmer, We are using WAS for the production. I heard that when using the J2EE app server and Timmer classes there will be some thread issues as both creates threads. Could you advise on this. Our application needs a report to sent out at fixed times. and one more advise, how much effort does it take?
Joined: Mar 22, 2005
I can't imagine why adding a thread of your own would create problems with threads the app server creates. It certainly should not, and -WAS being a serious and expensive piece of software- it better not. Using Timer and TimerTask is easy; I picked it up by simply studying the javadocs, although I don't remember the details now.
One thing to look out for is that threads can be scheduled at fixed times, or fixed time intervals. You need to set that when creating the thread. In the former case, the thread is run, e.g., every day at 3pm, no matter how long it takes to execute. In the latter case, it is run every, e.g., 24 hours after it last finished execution. So if it takes one hour to run, the second run will be started 25 hours after the first start, not 24 hours later (there are 24 hours between runs).