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 TypeMethodDescriptionintReturns total number of concurrent threads consuming work from this queue.longReturns total number of items dequeued so farintReturns the current number of items in the queue.voidreset()Resets both the queue size and dequeue count to zerovoidsetConsumerCount(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, toStringMethods inherited from class java.util.AbstractQueue
add, addAll, element, removeMethods inherited from class java.util.AbstractCollection
containsAll, isEmptyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.BlockingQueue
addMethods 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:
getQueueSizein interfaceUimaVmQueueMBean
-
getDequeueCount
public long getDequeueCount()Returns total number of items dequeued so far- Specified by:
getDequeueCountin interfaceUimaVmQueueMBean
-
take
Override of the method in the super class to enable counting of items taken (dequeued) off the queue.- Specified by:
takein interfaceBlockingQueue<Runnable>- Overrides:
takein classLinkedBlockingQueue<Runnable>- Throws:
InterruptedException
-
getConsumerCount
public int getConsumerCount()Returns total number of concurrent threads consuming work from this queue.- Specified by:
getConsumerCountin 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:
resetin interfaceUimaVmQueueMBean
-