## org.mortbay.thread
Class Timeout.Task

    java.lang.Object
      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.
`long` `getAge()`
`long` `getTimestamp()`
`boolean` `isExpired()`
`boolean` `isScheduled()`
`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

### getTimestamp

    public long getTimestamp()

### getAge

    public long getAge()

### 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()

### isScheduled

    public boolean isScheduled()

### expire

    public void expire()

  Expire task. This method is called when the timeout expires.

Copyright © 2008 Mort Bay Consulting. All Rights Reserved.