org.eclipse.jetty.util.thread
类 Timeout.Task

java.lang.Object
  继承者 org.eclipse.jetty.util.thread.Timeout.Task
直接已知子类:
AsyncContinuation.AsyncTimeout
包容类:
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.


构造方法摘要
protected Timeout.Task()
           
 
方法摘要
 void cancel()
          Cancel the task.
protected  void expire()
          Expire task.
 void expired()
          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.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

Timeout.Task

protected Timeout.Task()
方法详细信息

getTimestamp

public long getTimestamp()

getAge

public long getAge()

schedule

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

参数:
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.

参数:
timer -

reschedule

public void reschedule()
Reschedule the task on the current timeout. The task timeout is rescheduled as if it had been cancelled 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

protected void expire()
Expire task. This method is called when the timeout expires. It is called in the scope of the synchronize block (on this) that sets the isExpired() state to true.

另请参见:
For an unsynchronized callback.

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.



Copyright © 2013. All Rights Reserved.