fr.dyade.aaa.util
Class Timer

java.lang.Object
  extended byfr.dyade.aaa.util.Timer

public class Timer
extends java.lang.Object

This class is a facility for scheduling tasks future execution.

It is a simplified version of the timer provided by the jdk1.3.


Constructor Summary
Timer()
          Constructs a Timer instance.
 
Method Summary
 void cancel()
          Cancels the timer and all its non executed tasks.
 void schedule(TimerTask task, long delay)
          Schedules a given task for execution after a given delay.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer()
Constructs a Timer instance.

Method Detail

schedule

public void schedule(TimerTask task,
                     long delay)
              throws java.lang.Exception
Schedules a given task for execution after a given delay.

Parameters:
task - The task to be executed.
delay - Delay in ms before executing the task.
Throws:
java.lang.IllegalStateException - If the timer or the task have already been cancelled, or if the task is already scheduled.
java.lang.IllegalArgumentException - If the delay is negative.
java.lang.Exception

cancel

public void cancel()
Cancels the timer and all its non executed tasks.



Copyright ? 2004 Scalagent - All rights reserved