public class Timeout
extends java.util.TimerTask
Timer,
TimerTask| Constructor and Description |
|---|
Timeout(java.util.Timer timer,
long timeout)
Creates a new timeout task using the given
Timer instance a timeout value. |
| Modifier and Type | Method and Description |
|---|---|
void |
addTimeoutHandler(TimeoutHandler handler)
Appends a new timeout handler at the end of the timeout handler list.
|
void |
addTimeoutHandlerFirst(TimeoutHandler handler)
inserts a new timeout handler at the beginning of the timeout handler
list.
|
void |
clearTimeoutHandlers()
Removes all timeout handlers from the timeout handler list.
|
java.util.List<TimeoutHandler> |
getTimeoutHandlers()
Returns the list of timeout handlers that have been registered for
notification.
|
void |
run()
Notifies all timeout handlers about the scheduled timeout.
|
void |
schedule()
Schedules this timeout task.
|
public Timeout(java.util.Timer timer,
long timeout)
Timer instance a timeout value. The
task is not scheduled immediately. It will be scheduled by calling this
task's schedule() method.timer - timeout - public java.util.List<TimeoutHandler> getTimeoutHandlers()
public void addTimeoutHandler(TimeoutHandler handler)
handler - a timeout handler.public void addTimeoutHandlerFirst(TimeoutHandler handler)
handler - a timeout handler.public void clearTimeoutHandlers()
public void schedule()
public void run()
run in interface java.lang.Runnablerun in class java.util.TimerTaskCopyright © 2005-2015 FuseSource. All Rights Reserved.