Class UimaVmQueue
- All Implemented Interfaces:
Serializable
,Iterable<Runnable>
,Collection<Runnable>
,BlockingQueue<Runnable>
,Queue<Runnable>
,UimaVmQueueMBean
This is a JMX wrapper around the
LinkedBlockingQueue
. 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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns total number of concurrent threads consuming work from this queue.long
Returns total number of items dequeued so farint
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 queuetake()
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.util.AbstractQueue
add, addAll, element, remove
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.concurrent.BlockingQueue
add
Methods inherited from interface java.util.Collection
addAll, containsAll, equals, hashCode, isEmpty, parallelStream, stream, toArray
-
Constructor Details
-
UimaVmQueue
public UimaVmQueue()
-
-
Method Details
-
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
Override of the method in the super class to enable counting of items taken (dequeued) off the queue.- Specified by:
take
in interfaceBlockingQueue<Runnable>
- Overrides:
take
in classLinkedBlockingQueue<Runnable>
- Throws:
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
-