|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface I_TimeoutManager
Method Summary | |
---|---|
Timestamp |
addOrRefreshTimeoutListener(I_Timeout listener,
long delay,
java.lang.Object userData,
Timestamp key)
Checks if key is null -> addTimeoutListener else refreshTimeoutListener() in a thread save way. |
Timestamp |
addTimeoutListener(I_Timeout listener,
long delay,
java.lang.Object userData)
Add a listener which gets informed after 'delay' milliseconds. |
java.lang.String |
dumpStatus()
|
long |
elapsed(Timestamp key)
How long am i running. |
int |
getSize()
Get number of current used timers. |
long |
getTimeout(Timestamp key)
Access the end of life span. |
boolean |
isExpired(Timestamp key)
Is this handle expired? |
Timestamp |
refreshTimeoutListener(Timestamp key,
long delay)
Refresh a listener before the timeout happened. |
void |
removeAll()
Reset all pending timeouts. |
void |
removeTimeoutListener(Timestamp key)
Remove a listener before the timeout happened. |
void |
shutdown()
Reset and stop the Timeout manager thread. |
long |
spanToTimeout(Timestamp key)
How long to my timeout. |
Method Detail |
---|
int getSize()
Timestamp addTimeoutListener(I_Timeout listener, long delay, java.lang.Object userData)
listener
- Your callback handle (you need to implement this interface).delay
- The timeout in milliseconds. You can pass 0L and the Timeout
thread will fire immediately, this can be useful to dispatch a
task to the timeoutlisteneruserData
- Some arbitrary data you supply, it will be routed back to you
when the timeout occurs through method I_Timeout.timeout().
Timestamp refreshTimeoutListener(Timestamp key, long delay) throws XmlBlasterException
timeout.removeTimeoutListener(timeoutHandle); timeoutHandle = timeout.addTimeoutListener(this, "1000L", "UserData");
key
- The timeout handle you received by a previous
addTimeoutListener() call.delay
- The timeout in milliseconds measured from now.
XmlBlasterException
- if key is null or unknown or invalid because timer elapsed
alreadyTimestamp addOrRefreshTimeoutListener(I_Timeout listener, long delay, java.lang.Object userData, Timestamp key) throws XmlBlasterException
XmlBlasterException
void removeTimeoutListener(Timestamp key)
key
- The timeout handle you received by a previous
addTimeoutListener() call.boolean isExpired(Timestamp key)
key
- The timeout handle you received by a previous
addTimeoutListener() calllong spanToTimeout(Timestamp key)
key
- The timeout handle you received by a previous
addTimeoutListener() call.
long elapsed(Timestamp key)
key
- The timeout handle you received by a previous
addTimeoutListener() call.
long getTimeout(Timestamp key)
key
- The timeout handle you received by a previous
addTimeoutListener() call.
void removeAll()
void shutdown()
java.lang.String dumpStatus()
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |