org.mortbay.thread
Class Timeout.Task

java.lang.Object
  extended by org.mortbay.thread.Timeout.Task
Direct Known Subclasses:
SelectChannelConnector.RetryContinuation, SelectChannelEndPoint.IdleTask
Enclosing class:
Timeout

public static class Timeout.Task
extends Object

Task. The base class for scheduled timeouts. This class should be extended to implement the expire() method, which is called if the timeout expires.

Author:
gregw

Constructor Summary
Timeout.Task()
           
 
Method Summary
 void cancel()
          Cancel the task.
 void expire()
          Expire task.
 boolean isExpired()
           
 void reschedule()
          Reschedule the task on the current timeout.
 void schedule(Timeout timer)
          Schedule the task on the given timeout.
 void schedule(Timeout timer, long delay)
          Schedule the task on the given timeout.
 void setNext(Timeout.Task task)
           
 void unlink()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timeout.Task

public Timeout.Task()
Method Detail

unlink

public void unlink()

setNext

public void setNext(Timeout.Task task)

schedule

public void schedule(Timeout timer)
Schedule the task on the given timeout. The task exiry will be called after the timeout duration.

Parameters:
timer -

schedule

public void schedule(Timeout timer,
                     long delay)
Schedule the task on the given timeout. The task exiry will be called after the timeout duration.

Parameters:
timer -

reschedule

public void reschedule()
Reschedule the task on the current timeout. The task timeout is rescheduled as if it had been canceled and scheduled on the current timeout.


cancel

public void cancel()
Cancel the task. Remove the task from the timeout.


isExpired

public boolean isExpired()

expire

public void expire()
Expire task. This method is called when the timeout expires.