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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to