Re: Refresh
Re: Refresh
- Subject: Re: Refresh
- From: Zak Burke <email@hidden>
- Date: Fri, 23 Feb 2007 08:58:38 -0500
WIESEN Bruno wrote on 2/23/07 3:22 AM:
Hi all,
I have to refresh a file...so every 5 minutes an action has to be
performed! But i don't know
which method use...do you have an idea?
See java.util.Timer and java.util.TimerTask. For example:
Put this in some method called by your Application's constructor:
// 5 * 60 * 1000 == 5 minutes worth of milliseconds
// but of course you'd read that value from a props file instead
// of hard-coding a bunch of ints, right? right.
Timer t = new java.util.Timer();
t.scheduleAtFixedRate(new TimeableTask(), 0l, 5 * 60 * 1000);
public class TimeableTask extends java.util.TimerTask
{
public void run()
{
// your regularly schedule event here
}
}
zak.
_______________________________________________
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
References: | |
| >Refresh (From: WIESEN Bruno <email@hidden>) |