|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.util.thread.ThreadWatchdog
public class ThreadWatchdog
This class is able to interrupt threads after a certain interval -- useful when threads need to have a bounded runtime.
Nested Class Summary | |
---|---|
static class |
ThreadWatchdog.InterruptToken
|
Constructor Summary | |
---|---|
ThreadWatchdog(java.lang.String threadName)
|
Method Summary | |
---|---|
void |
cancelInterrupt(ThreadWatchdog.InterruptToken t)
Cancel a scheduled interrupt. |
void |
initialize()
Must be called prior to any other use of this object. |
ThreadWatchdog.InterruptToken |
interruptMeIn(long delay,
java.util.concurrent.TimeUnit units,
java.lang.String targetMsg)
Schedule an interrupt for the current thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadWatchdog(java.lang.String threadName)
Method Detail |
---|
public void initialize()
public ThreadWatchdog.InterruptToken interruptMeIn(long delay, java.util.concurrent.TimeUnit units, java.lang.String targetMsg)
delay
- The # of units to delayunits
- Combines with 'delay' to give the length of time to
delaytargetMsg
- An informational message about what the current thread
is doing, used when logging an interrupt.public void cancelInterrupt(ThreadWatchdog.InterruptToken t)
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |