public abstract class ANCThread extends Thread implements Haltable
halt() method.
Classes that extend ANCThread must:
running flag is set to false, orhalt() method and terminate cleanly when it is
called.| Modifier and Type | Class and Description |
|---|---|
static class |
ANCThread.Event
Events sent to listeners.
|
static class |
ANCThread.State
State values.
|
Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
ANCThread() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(IANCThreadListener listener) |
protected void |
fire(ANCThread.Event event) |
void |
halt()
Halts the thread by setting running to
false. |
void |
pause() |
void |
pause(long millis)
Helper method that wraps a call to
sleep in a
try/catch block. |
void |
removeListener(IANCThreadListener listener) |
void |
restart() |
boolean |
running() |
void |
start() |
ANCThread.State |
state() |
void |
terminate() |
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, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yieldpublic void addListener(IANCThreadListener listener)
public void removeListener(IANCThreadListener listener)
public ANCThread.State state()
public boolean running()
public void halt()
false. Also calls
notifyAll() to wake anything that might be waiting on this
thread.public void pause(long millis)
sleep in a
try/catch block.millis - long The number of milliseconds the thread should sleep.public void pause()
public void restart()
public void terminate()
protected void fire(ANCThread.Event event)
Copyright © 2016 The American National Corpus. All rights reserved.