Re: Recurring schedule say daily at 10:00 P:M Using Timer and TimerTask
Posted By:
Java_Dev
Posted On:
Monday, April 18, 2005 03:44 PM
the code for doing this:
//singleton implmtn...
private static timer = null;
....
public getInstance() {
.....
}
private scheduleJob() {
Calendar date = Calendar.getInstance();
date.set(Calendar.HOUR, 10);
date.set(Calendar.MINUTE,00));
date.set(Calendar.SECOND, 0);
date.set(Calendar.MILLISECOND, 0);
timer = new Timer();
//For daily
timer.scheduleAtFixedRate(new Task(),
date.getTime(),1000 * 60 * 60 * 24 * 7);
}
Task is for TimerTask ------
It only executes once and looks like not recurring again on next day -----
has anybody has it working --