|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread com.atlassian.bamboo.utils.Timer
public abstract class Timer
This allows graceful timeouts to time consuming tasks (such as sending emails).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Timer(long lengthOfTimeoutInMillis)
Creates a timer of a specified lengthOfTimeoutInMillis |
Method Summary | |
---|---|
void |
cancel()
|
abstract void |
onTimeout()
This callback is triggered if the timer times-out |
void |
restart()
Resets the timer back to zero |
void |
run()
Performs timer specific code |
void |
start()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Timer(long lengthOfTimeoutInMillis)
lengthOfTimeoutInMillis
- Length of time before a onTimeout occursMethod Detail |
---|
public void start()
start
in class java.lang.Thread
public void cancel()
public void restart()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public abstract void onTimeout()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |