Class UimaVmQueue

All Implemented Interfaces:
Serializable, Iterable<Runnable>, Collection<Runnable>, BlockingQueue<Runnable>, Queue<Runnable>, UimaVmQueueMBean

public class UimaVmQueue extends LinkedBlockingQueue<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:
  • Constructor Details

    • UimaVmQueue

      public UimaVmQueue()
  • Method Details

    • 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 Runnable take() throws InterruptedException
      Override of the method in the super class to enable counting of items taken (dequeued) off the queue.
      Specified by:
      take in interface BlockingQueue<Runnable>
      Overrides:
      take in class LinkedBlockingQueue<Runnable>
      Throws:
      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