|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.ThreadedQueue
public class ThreadedQueue
This is a ThreadedQueue used for a producer/consumer model of threads. Order out is guranteed to be the same as the order in. If maxItems is specified, there will never be more than maxItems pending in the queue, if the max number are already present, the producer will block until items are consumed.
Constructor Summary | |
---|---|
ThreadedQueue()
Create a threaded queue with an unbounded number of elements. |
|
ThreadedQueue(int maxItems)
|
Method Summary | |
---|---|
int |
count()
Determine how many items are in the queue |
java.lang.Object |
error()
Called by either side to test for error; generally called by producer one time after all consumer threads die to test for errors occuring after its last insertObject and before consumer threads are done |
void |
incrementUseCount()
|
java.lang.Object |
insertObject(java.lang.Object o)
Called by producer. |
boolean |
isEmpty()
Called by producer. |
boolean |
moreData()
Called by producer. |
java.lang.Object |
nextObject()
Called by consumer. |
java.lang.Object |
peekNextObject()
Called by consumer. |
void |
setError(java.lang.Object o)
Called by either side to set an error |
void |
setMaxItems(int maxItems)
|
void |
setNoMoreData()
Called by producer. |
void |
waitForEmpty()
Called by producer; useful when waiting to flush queue before continuing. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadedQueue(int maxItems)
public ThreadedQueue()
Method Detail |
---|
public void setMaxItems(int maxItems)
public java.lang.Object insertObject(java.lang.Object o)
public void incrementUseCount()
public void setError(java.lang.Object o)
public java.lang.Object error()
public boolean isEmpty()
public int count()
public boolean moreData()
public void waitForEmpty()
public void setNoMoreData()
public java.lang.Object peekNextObject()
public java.lang.Object nextObject()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |