|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.exolab.jms.util.BlockingWorkerQueue
A BlockingWorkerQueue is attached to a QueueWorker. Any thread can add work to the queue. The BlockingWorkerQueue, which extends Thread, blocks waiting for work to arrive. When work arrives it will be dequeued and passed down to the QueueWorker for processing.
The owner can use close
to gracefully shutdown the thread.
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
BlockingWorkerQueue(java.lang.String name,
QueueWorker worker)
Construct a blocking worker queue and attahc to the specified queue worker. |
Method Summary | |
void |
add(java.lang.Object object)
Add some work to the end of the queue |
void |
close()
Close this worker queue |
void |
run()
This method is called once the thread has started. |
int |
size()
Return the number of entries still on the queue |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public BlockingWorkerQueue(java.lang.String name, QueueWorker worker)
name
- - the name of the threadworker
- - the queue worker attached to this queueMethod Detail |
public void add(java.lang.Object object)
work
- - add this piece of workpublic void run()
Calling close
on this object will terminate it.
run
in class java.lang.Thread
public int size()
public void close()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |