public class BoundedWorkQueue extends Object
There are 2 dequeue calls. One returns null if the queue is empty, the other can be given a timeout - and it will wait up to that time waiting for something to get enqueued.
| Modifier and Type | Field and Description |
|---|---|
protected CPMEngine |
cpm
The cpm.
|
protected int |
numberElementsInQueue
The number elements in queue.
|
protected LinkedList |
queue
The queue.
|
protected int |
queueMaxSize
The queue max size.
|
protected String |
queueName
The queue name.
|
protected static int |
WAIT_TIMEOUT
The Constant WAIT_TIMEOUT.
|
| Constructor and Description |
|---|
BoundedWorkQueue(int aQueueSize,
String aQueueName,
CPMEngine aCpmEngine)
Initialize the instance.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
dequeue()
Removes an object from the front of the queue according to FIFO.
|
Object |
dequeue(long aTimeout)
Returns an object from the queue.
|
void |
enqueue(Object anObject)
Enqueues a given object onto the queue.
|
int |
getCapacity()
Returns the queue capacity.
|
int |
getCurrentSize()
Returns number of elements in the queue.
|
String |
getName()
Returns Queue name.
|
void |
invalidate(org.apache.uima.cas.CAS[] aCasObjectList)
Invalidate.
|
protected final int queueMaxSize
protected LinkedList queue
protected int numberElementsInQueue
protected String queueName
protected CPMEngine cpm
protected static final int WAIT_TIMEOUT
public String getName()
public int getCurrentSize()
public int getCapacity()
public void enqueue(Object anObject)
anObject - -
an object to enqueuepublic Object dequeue()
public Object dequeue(long aTimeout)
aTimeout - -
max millis to wait for an objectpublic void invalidate(org.apache.uima.cas.CAS[] aCasObjectList)
aCasObjectList - the a cas object listCopyright © 2006–2017 The Apache Software Foundation. All rights reserved.