Re: Best way to run period task?
Re: Best way to run period task?
- Subject: Re: Best way to run period task?
- From: Jon Nolan <email@hidden>
- Date: Wed, 06 Jan 2010 18:25:08 -0700
- Organization: Loch Garman
Mark Woollard wrote:
What's the recommended way to run a periodic task from within a WO application? In this case its infrequently (hourly) and independent of any web requests.
For me...
public class SomeTask extends ERXTimerTask {
public void _run() {
// do something
}
}
....
long delay = 20;
long period = 86400 * 1000;
SomeTask task = new SomeTask();
Timer timer = new Timer(true);
timer.schedule(task, delay, period);
....
See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Timer.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden