planet.util.timer
Interface TimerTask

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ThreadTimerTask, TimerTaskImpl

public interface TimerTask
extends java.io.Serializable

This interface abstract the responsability of a Timer, who invokes the timeout() method when the specified time is passed.

Author:
Jordi Pujol

Method Summary
 boolean cancel()
          It avoids that this TimerTask executes more times.
 boolean isFinished()
          Inform that this TimerTask is just cancelled.
 void run()
          Job to do when the period of time specified by this TimerTask is passed.
 

Method Detail

cancel

public boolean cancel()
It avoids that this TimerTask executes more times. If the execution is in process, it finish normally. This method returns true if it prevents one or more scheduled executions from taking place.


run

public void run()
Job to do when the period of time specified by this TimerTask is passed.


isFinished

public boolean isFinished()
Inform that this TimerTask is just cancelled.

Returns:
true if this timer has been finished. false in other case.