Class 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 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:
    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 far
      int getQueueSize()
      Returns the current number of items in the queue.
      void reset()
      Resets both the queue size and dequeue count to zero
      void setConsumerCount​(int aConsumerCount)
      Sets the number of concurrent threads consuming work from this queue
      java.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.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
      • Methods inherited from interface java.util.Queue

        element, remove
    • Constructor Detail

      • UimaVmQueue

        public UimaVmQueue()
    • Method Detail

      • getQueueSize

        public int getQueueSize()
        Returns the current number of items in the queue.
        Specified by:
        getQueueSize in interface UimaVmQueueMBean
      • getDequeueCount

        public long getDequeueCount()
        Returns total number of items dequeued so far
        Specified by:
        getDequeueCount in interface UimaVmQueueMBean
      • 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 interface java.util.concurrent.BlockingQueue<java.lang.Runnable>
        Overrides:
        take in class java.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 interface UimaVmQueueMBean
      • 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 interface UimaVmQueueMBean