public abstract class PausableThread
extends java.lang.Thread
| Constructor and Description |
|---|
PausableThread() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterPause()
Called once when this thread continues to work after a pause.
|
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.
|
void |
finish() |
protected abstract java.lang.String |
getThreadName() |
protected int |
getThreadPriority() |
protected abstract boolean |
hasWork() |
boolean |
isCanceled() |
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, interrupt, 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 finish()
public final boolean isPausing()
public final void pause()
public final void proceed()
public final boolean isCanceled()
public final void run()
run in interface java.lang.Runnablerun in class java.lang.Threadprotected void afterPause()
protected 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 java.lang.String getThreadName()
protected int getThreadPriority()
Thread.NORM_PRIORITY.protected abstract boolean hasWork()