Package emissary.core
Class Pausable
- java.lang.Object
-
- java.lang.Thread
-
- emissary.core.Pausable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_PAUSE_INTERVAL
protected long
pauseInterval
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
checkPaused()
Check to see if we are currently paused.long
getPauseInterval()
Get the time to sleep before checking if the thread has been unpausedboolean
isPaused()
Check to see if the current thread is pausedvoid
pause()
Stop taking workabstract void
run()
void
unpause()
Resume taking work-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Method Detail
-
isPaused
public boolean isPaused()
Check to see if the current thread is paused
-
getPauseInterval
public long getPauseInterval()
Get the time to sleep before checking if the thread has been unpaused- Returns:
- the pause check interval
-
checkPaused
public boolean checkPaused()
Check to see if we are currently paused. If paused, sleep for the configured interval and return true.- Returns:
- true if paused, false otherwise
-
-