|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.util.WorkerQueue
Class that queues Executable (src) jobs that are executed sequentially
by a single thread.
Executable (src) | Nested Class Summary | |
protected class |
WorkerQueue.QueueLoop (src)
Class that loops getting the next job to be executed and then executing it, in the worker thread. |
| Field Summary | |
protected java.lang.Thread |
m_queueThread
The thread that runs the Executable jobs |
| Constructor Summary | |
WorkerQueue()
Creates a new worker queue with default thread name of "Worker Thread" |
|
WorkerQueue(java.lang.String threadName)
Creates a new worker queue with the specified thread name |
|
WorkerQueue(java.lang.String threadName,
boolean isDaemon)
Creates a new worker queue with the specified thread name and daemon mode flag |
|
| Method Summary | |
protected void |
clear()
Clears the running thread after the queue has been stopped. |
protected java.lang.Runnable |
createQueueLoop()
Creates the loop that will get the next job and process it. |
protected Executable (src) |
getJob()
Called by this class, this method checks if the queue is empty; if it is, then waits, else returns the current job. |
protected Executable (src) |
getJobImpl()
Never call this method, only override in subclasses to perform job getting in a specific way, normally tied to the data structure holding the jobs. |
protected boolean |
isInterrupted()
Returns whether the worker thread has been interrupted. |
void |
putJob(Executable (src) job)
Called by a thread that is not the WorkerQueue thread, this method queues the job and, if necessary, wakes up this worker queue that is waiting in getJob(). |
protected void |
putJobImpl(Executable (src) job)
Never call this method, only override in subclasses to perform job adding in a specific way, normally tied to the data structure holding the jobs. |
void |
start()
Starts the worker queue. |
void |
stop()
Stops nicely the worker queue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.Thread m_queueThread
| Constructor Detail |
public WorkerQueue()
public WorkerQueue(java.lang.String threadName)
public WorkerQueue(java.lang.String threadName,
boolean isDaemon)
| Method Detail |
public void start()
stop()public void stop()
clear(),
start(),
isInterrupted()public void putJob(Executable (src) job)
getJob().
protected boolean isInterrupted()
stop()
protected Executable (src) getJob()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionputJob(org.jboss.util.Executable)
protected Executable (src) getJobImpl()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionprotected void putJobImpl(Executable (src) job)
protected void clear()
protected java.lang.Runnable createQueueLoop()
|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||