org.apache.activemq.broker.jmx
Class QueueView

java.lang.Object
  extended by org.apache.activemq.broker.jmx.DestinationView
      extended by org.apache.activemq.broker.jmx.QueueView
All Implemented Interfaces:
DestinationViewMBean, QueueViewMBean

public class QueueView
extends DestinationView
implements QueueViewMBean

Provides a JMX Management view of a Queue.


Field Summary
 
Fields inherited from class org.apache.activemq.broker.jmx.DestinationView
broker, destination
 
Constructor Summary
QueueView(ManagedRegionBroker broker, Queue destination)
           
 
Method Summary
 int copyMatchingMessagesTo(String selector, String destinationName)
          Copies the messages matching the given selector
 int copyMatchingMessagesTo(String selector, String destinationName, int maximumMessages)
          Copies the messages matching the given selector up to the maximum number of matched messages
 boolean copyMessageTo(String messageId, String destinationName)
          Copies a given message to another destination.
 int cursorSize()
           
 boolean doesCursorHaveMessagesBuffered()
           
 boolean doesCursorHaveSpace()
           
 long getCursorMemoryUsage()
           
 int getCursorPercentUsage()
           
 CompositeData getMessage(String messageId)
          Retrieve a message from the destination's queue.
 boolean isCacheEnabled()
           
 boolean isCursorFull()
           
 int moveMatchingMessagesTo(String selector, String destinationName)
          Moves the messages matching the given selector
 int moveMatchingMessagesTo(String selector, String destinationName, int maximumMessages)
          Moves the messages matching the given selector up to the maximum number of matched messages
 boolean moveMessageTo(String messageId, String destinationName)
          Moves the message to another destination.
 void purge()
          Removes all of the messages in the queue.
 int removeMatchingMessages(String selector)
          Removes the messages matching the given selector
 int removeMatchingMessages(String selector, int maximumMessages)
          Removes the messages matching the given selector up to the maximum number of matched messages
 boolean removeMessage(String messageId)
          Removes a message from the queue.
 boolean retryMessage(String messageId)
          Moves a message back to its original destination
 
Methods inherited from class org.apache.activemq.broker.jmx.DestinationView
browse, browse, browseAsTable, browseAsTable, browseMessages, browseMessages, gc, getAverageEnqueueTime, getBlockedProducerWarningInterval, getConsumerCount, getDequeueCount, getDispatchCount, getEnqueueCount, getExpiredCount, getInFlightCount, getMaxAuditDepth, getMaxEnqueueTime, getMaxPageSize, getMaxProducersToAudit, getMemoryLimit, getMemoryPercentUsage, getMemoryUsageByteCount, getMemoryUsagePortion, getMessagesCached, getMinEnqueueTime, getName, getOptions, getProducerCount, getQueueSize, getSlowConsumerStrategy, getSubscriptions, isAlwaysRetroactive, isEnableAudit, isPrioritizedMessages, isProducerFlowControl, isUseCache, resetStatistics, sendTextMessage, sendTextMessage, sendTextMessage, sendTextMessage, setAlwaysRetroactive, setBlockedProducerWarningInterval, setEnableAudit, setMaxAuditDepth, setMaxPageSize, setMaxProducersToAudit, setMemoryLimit, setMemoryUsagePortion, setProducerFlowControl, setUseCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.activemq.broker.jmx.DestinationViewMBean
browse, browse, browseAsTable, browseAsTable, browseMessages, browseMessages, getAverageEnqueueTime, getBlockedProducerWarningInterval, getConsumerCount, getDequeueCount, getDispatchCount, getEnqueueCount, getExpiredCount, getInFlightCount, getMaxAuditDepth, getMaxEnqueueTime, getMaxPageSize, getMaxProducersToAudit, getMemoryLimit, getMemoryPercentUsage, getMemoryUsageByteCount, getMemoryUsagePortion, getMinEnqueueTime, getName, getOptions, getProducerCount, getQueueSize, getSlowConsumerStrategy, getSubscriptions, isAlwaysRetroactive, isPrioritizedMessages, isProducerFlowControl, isUseCache, resetStatistics, sendTextMessage, sendTextMessage, sendTextMessage, sendTextMessage, setAlwaysRetroactive, setBlockedProducerWarningInterval, setMaxAuditDepth, setMaxPageSize, setMaxProducersToAudit, setMemoryLimit, setMemoryUsagePortion, setProducerFlowControl, setUseCache
 

Constructor Detail

QueueView

public QueueView(ManagedRegionBroker broker,
                 Queue destination)
Method Detail

getMessage

public CompositeData getMessage(String messageId)
                         throws OpenDataException
Description copied from interface: QueueViewMBean
Retrieve a message from the destination's queue.

Specified by:
getMessage in interface QueueViewMBean
Parameters:
messageId - the message id of the message to retrieve
Returns:
A CompositeData object which is a JMX version of the messages
Throws:
OpenDataException

purge

public void purge()
           throws Exception
Description copied from interface: QueueViewMBean
Removes all of the messages in the queue.

Specified by:
purge in interface QueueViewMBean
Throws:
Exception

removeMessage

public boolean removeMessage(String messageId)
                      throws Exception
Description copied from interface: QueueViewMBean
Removes a message from the queue. If the message has already been dispatched to another consumer, the message cannot be deleted and this method will return false.

Specified by:
removeMessage in interface QueueViewMBean
Returns:
true if the message was found and could be successfully deleted.
Throws:
Exception

removeMatchingMessages

public int removeMatchingMessages(String selector)
                           throws Exception
Description copied from interface: QueueViewMBean
Removes the messages matching the given selector

Specified by:
removeMatchingMessages in interface QueueViewMBean
Returns:
the number of messages removed
Throws:
Exception

removeMatchingMessages

public int removeMatchingMessages(String selector,
                                  int maximumMessages)
                           throws Exception
Description copied from interface: QueueViewMBean
Removes the messages matching the given selector up to the maximum number of matched messages

Specified by:
removeMatchingMessages in interface QueueViewMBean
Returns:
the number of messages removed
Throws:
Exception

copyMessageTo

public boolean copyMessageTo(String messageId,
                             String destinationName)
                      throws Exception
Description copied from interface: QueueViewMBean
Copies a given message to another destination.

Specified by:
copyMessageTo in interface QueueViewMBean
Returns:
true if the message was found and was successfully copied to the other destination.
Throws:
Exception

copyMatchingMessagesTo

public int copyMatchingMessagesTo(String selector,
                                  String destinationName)
                           throws Exception
Description copied from interface: QueueViewMBean
Copies the messages matching the given selector

Specified by:
copyMatchingMessagesTo in interface QueueViewMBean
Returns:
the number of messages copied
Throws:
Exception

copyMatchingMessagesTo

public int copyMatchingMessagesTo(String selector,
                                  String destinationName,
                                  int maximumMessages)
                           throws Exception
Description copied from interface: QueueViewMBean
Copies the messages matching the given selector up to the maximum number of matched messages

Specified by:
copyMatchingMessagesTo in interface QueueViewMBean
Returns:
the number of messages copied
Throws:
Exception

moveMessageTo

public boolean moveMessageTo(String messageId,
                             String destinationName)
                      throws Exception
Description copied from interface: QueueViewMBean
Moves the message to another destination.

Specified by:
moveMessageTo in interface QueueViewMBean
Returns:
true if the message was found and was successfully copied to the other destination.
Throws:
Exception

moveMatchingMessagesTo

public int moveMatchingMessagesTo(String selector,
                                  String destinationName)
                           throws Exception
Description copied from interface: QueueViewMBean
Moves the messages matching the given selector

Specified by:
moveMatchingMessagesTo in interface QueueViewMBean
Returns:
the number of messages removed
Throws:
Exception

moveMatchingMessagesTo

public int moveMatchingMessagesTo(String selector,
                                  String destinationName,
                                  int maximumMessages)
                           throws Exception
Description copied from interface: QueueViewMBean
Moves the messages matching the given selector up to the maximum number of matched messages

Specified by:
moveMatchingMessagesTo in interface QueueViewMBean
Throws:
Exception

retryMessage

public boolean retryMessage(String messageId)
                     throws Exception
Moves a message back to its original destination

Specified by:
retryMessage in interface QueueViewMBean
Throws:
Exception

cursorSize

public int cursorSize()
Specified by:
cursorSize in interface QueueViewMBean
Returns:
the number of messages available to be paged in by the cursor

doesCursorHaveMessagesBuffered

public boolean doesCursorHaveMessagesBuffered()
Specified by:
doesCursorHaveMessagesBuffered in interface QueueViewMBean
Returns:
true if the cursor has messages buffered to deliver

doesCursorHaveSpace

public boolean doesCursorHaveSpace()
Specified by:
doesCursorHaveSpace in interface QueueViewMBean
Returns:
true if the message cursor has memory space available to page in more messages

getCursorMemoryUsage

public long getCursorMemoryUsage()
Specified by:
getCursorMemoryUsage in interface QueueViewMBean
Returns:
the cursor memory usage in bytes

getCursorPercentUsage

public int getCursorPercentUsage()
Specified by:
getCursorPercentUsage in interface QueueViewMBean
Returns:
the cursor memory usage as a percentage

isCursorFull

public boolean isCursorFull()
Specified by:
isCursorFull in interface QueueViewMBean
Returns:
true if the cursor has reached its memory limit for paged in messages

isCacheEnabled

public boolean isCacheEnabled()
Specified by:
isCacheEnabled in interface QueueViewMBean
Returns:
true if caching is currently enabled of for the destination


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.