Class UimaVmQueue
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<E>
-
- java.util.concurrent.LinkedBlockingQueue<java.lang.Runnable>
-
- org.apache.uima.aae.spi.transport.vm.UimaVmQueue
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<java.lang.Runnable>
,java.util.Collection<java.lang.Runnable>
,java.util.concurrent.BlockingQueue<java.lang.Runnable>
,java.util.Queue<java.lang.Runnable>
,UimaVmQueueMBean
public class UimaVmQueue extends java.util.concurrent.LinkedBlockingQueue<java.lang.Runnable> implements UimaVmQueueMBean
This is a JMX wrapper around theLinkedBlockingQueue
. It exposes the following queue statistics:- size - the number of items on the queue
- consumerCount - number of concurrent consuming threads taking items from this queue.
- dequeueCount - total number of items consumed so far
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UimaVmQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getConsumerCount()
Returns total number of concurrent threads consuming work from this queue.long
getDequeueCount()
Returns total number of items dequeued so farint
getQueueSize()
Returns the current number of items in the queue.void
reset()
Resets both the queue size and dequeue count to zerovoid
setConsumerCount(int aConsumerCount)
Sets the number of concurrent threads consuming work from this queuejava.lang.Runnable
take()
Override of the method in the super class to enable counting of items taken (dequeued) off the queue.-
Methods inherited from class java.util.concurrent.LinkedBlockingQueue
clear, contains, drainTo, drainTo, forEach, iterator, offer, offer, peek, poll, poll, put, remainingCapacity, remove, removeAll, removeIf, retainAll, size, spliterator, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getQueueSize
public int getQueueSize()
Returns the current number of items in the queue.- Specified by:
getQueueSize
in interfaceUimaVmQueueMBean
-
getDequeueCount
public long getDequeueCount()
Returns total number of items dequeued so far- Specified by:
getDequeueCount
in interfaceUimaVmQueueMBean
-
take
public java.lang.Runnable take() throws java.lang.InterruptedException
Override of the method in the super class to enable counting of items taken (dequeued) off the queue.- Specified by:
take
in interfacejava.util.concurrent.BlockingQueue<java.lang.Runnable>
- Overrides:
take
in classjava.util.concurrent.LinkedBlockingQueue<java.lang.Runnable>
- Throws:
java.lang.InterruptedException
-
getConsumerCount
public int getConsumerCount()
Returns total number of concurrent threads consuming work from this queue.- Specified by:
getConsumerCount
in interfaceUimaVmQueueMBean
-
setConsumerCount
public void setConsumerCount(int aConsumerCount)
Sets the number of concurrent threads consuming work from this queue- Parameters:
aConsumerCount
- - number of consuming threads
-
reset
public void reset()
Resets both the queue size and dequeue count to zero- Specified by:
reset
in interfaceUimaVmQueueMBean
-
-