|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
net.sf.freecol.client.Worker
public final class Worker
The Worker Thread executes jobs one after another. The thread manages a queue where new jobs can be enqueued. The jobs are processed synchronously by the worker.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private java.util.concurrent.LinkedBlockingQueue<java.lang.Runnable> |
jobList
|
private static java.util.logging.Logger |
logger
|
private boolean |
stopRunning
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
Worker()
|
|
| Method Summary | |
|---|---|
void |
askToStop()
Makes the worker thread stop running. |
void |
run()
|
void |
schedule(java.lang.Runnable job)
Adds a new job to the queue |
| Methods inherited from class java.lang.Thread |
|---|
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, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final java.util.concurrent.LinkedBlockingQueue<java.lang.Runnable> jobList
private volatile boolean stopRunning
private static final java.util.logging.Logger logger
| Constructor Detail |
|---|
public Worker()
| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void schedule(java.lang.Runnable job)
job - the job to add to the queue.public void askToStop()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||