|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Timeoutable<T extends Timeoutable<T>>
This interface can be used in conjunction with a TimeoutMonitor to provide a simple timeout mechanism
| Method Summary | |
|---|---|
void |
addTimeoutListener(TimeoutListener<T> timeoutListener)
Add a listener whose TimeoutListener.onTimeout(Object) method will be called when this Timeoutable's
timeout() method is called. |
String |
getId()
A unique ID used to identify this Timeoutable |
long |
getRemainingTime()
The time remaining until this Timeoutable's timeout() method will be called |
void |
reset()
Resets this Timeoutable's remaining time to the max idle time |
void |
setMaxIdleTime(long maxIdleTime)
Sets the time after which this Timeoutable's timeout() method will be called |
void |
timeout()
Called when this Timeoutable's getRemainingTime() is equal to or less than zero (i.e. |
| Method Detail |
|---|
void setMaxIdleTime(long maxIdleTime)
timeout() method will be called
maxIdleTime - String getId()
long getRemainingTime()
timeout() method will be called
void timeout()
getRemainingTime() is equal to or less than zero (i.e. the max idle time has been exceeded).
void reset()
void addTimeoutListener(TimeoutListener<T> timeoutListener)
TimeoutListener.onTimeout(Object) method will be called when this Timeoutable's
timeout() method is called.
timeoutListener -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||