org.mortbay.thread
Class Timeout.Task

java.lang.Object
  extended by org.mortbay.thread.Timeout.Task
Direct Known Subclasses:
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() or expired() method, which is called if the timeout expires.

Author:
gregw

Constructor Summary
Timeout.Task()
           
 
Method Summary
 void cancel()
          Cancel the task.
 void expired()
          Expire task.
 long getAge()
           
 long getTimestamp()
           
 boolean isExpired()
           
 boolean isScheduled()
           
 
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

getTimestamp

public long getTimestamp()

getAge

public long getAge()

cancel

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


isExpired

public boolean isExpired()

isScheduled

public boolean isScheduled()

expired

public void expired()
Expire task. This method is called when the timeout expires. It is called outside of any synchronization scope and may be delayed.

See Also:
For a synchronized callback.


Copyright © 2008 Mort Bay Consulting. All Rights Reserved.