org.apache.uima.aae.spi.transport.vm
Class UimaVmQueue

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by java.util.concurrent.LinkedBlockingQueue<java.lang.Runnable>
              extended by 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 the LinkedBlockingQueue. It exposes the following queue statistics:

See Also:
Serialized Form

Constructor Summary
UimaVmQueue()
           
 
Method Summary
 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, drainTo, drainTo, iterator, offer, offer, peek, poll, poll, put, remainingCapacity, remove, size, toArray, toArray, toString
 
Methods inherited from class java.util.AbstractQueue
add, addAll, element, remove
 
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, removeAll, retainAll
 
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, contains
 
Methods inherited from interface java.util.Queue
element, remove
 
Methods inherited from interface java.util.Collection
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll
 

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


Copyright © 2011. All Rights Reserved.