public abstract class PausableThread
extends java.lang.Thread
| Modifier and Type | Class and Description |
|---|---|
protected static class |
PausableThread.ThreadPriority
Specifies the scheduling priority of a
Thread. |
| Constructor and Description |
|---|
PausableThread() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterRun()
Called once at the end of the
run() method. |
void |
awaitPausing()
Causes the current thread to wait until this thread is pausing.
|
protected abstract void |
doWork()
Called when this thread is not paused and should do its work.
|
protected abstract PausableThread.ThreadPriority |
getThreadPriority() |
protected abstract boolean |
hasWork() |
void |
interrupt() |
boolean |
isPausing() |
void |
pause()
The thread should stop its work temporarily.
|
void |
proceed()
The paused thread should continue with its work.
|
void |
run() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic final void awaitPausing()
public void interrupt()
interrupt in class java.lang.Threadpublic final boolean isPausing()
public final void pause()
public final void proceed()
public final void run()
run in interface java.lang.Runnablerun in class java.lang.Threadprotected void afterRun()
run() method. The default implementation is empty.protected abstract void doWork()
throws java.lang.InterruptedException
java.lang.InterruptedException - if the thread has been interrupted.protected abstract PausableThread.ThreadPriority getThreadPriority()
protected abstract boolean hasWork()