org.apache.activemq.broker.jmx
Class DestinationView

java.lang.Object
  extended by org.apache.activemq.broker.jmx.DestinationView
All Implemented Interfaces:
DestinationViewMBean
Direct Known Subclasses:
QueueView, TopicView

public class DestinationView
extends Object
implements DestinationViewMBean


Field Summary
protected  ManagedRegionBroker broker
           
protected  Destination destination
           
 
Constructor Summary
DestinationView(ManagedRegionBroker broker, Destination destination)
           
 
Method Summary
 CompositeData[] browse()
           
 CompositeData[] browse(String selector)
           
 TabularData browseAsTable()
           
 TabularData browseAsTable(String selector)
           
 List<Object> browseMessages()
          Browses the current destination returning a list of messages
 List<Object> browseMessages(String selector)
          Browses the current destination with the given selector returning a list of messages
 void gc()
           
 double getAverageBlockedTime()
           
 double getAverageEnqueueTime()
           
 double getAverageMessageSize()
           
 long getBlockedProducerWarningInterval()
           
 long getBlockedSends()
           
 long getConsumerCount()
          Returns the number of consumers subscribed this destination.
 long getDequeueCount()
          Returns the number of messages that have been acknowledged from the destination.
 long getDispatchCount()
          Returns the number of messages that have been delivered (potentially not acknowledged) to consumers.
 long getEnqueueCount()
          Returns the number of messages that have been sent to the destination.
 long getExpiredCount()
          Returns the number of messages that have expired
 long getInFlightCount()
          Returns the number of messages that have been dispatched but not acknowledged
 int getMaxAuditDepth()
           
 long getMaxEnqueueTime()
           
 long getMaxMessageSize()
           
 int getMaxPageSize()
           
 int getMaxProducersToAudit()
           
 long getMemoryLimit()
           
 int getMemoryPercentUsage()
           
 long getMemoryUsageByteCount()
           
 float getMemoryUsagePortion()
           
 long getMessagesCached()
           
 long getMinEnqueueTime()
           
 long getMinMessageSize()
           
 String getName()
          Returns the name of this destination
 String getOptions()
           
 long getProducerCount()
           
 long getQueueSize()
          Returns the number of messages in this destination which are yet to be consumed
 ObjectName getSlowConsumerStrategy()
          Returns the slow consumer strategy MBean for this destination
 ObjectName[] getSubscriptions()
          Returns all the current subscription MBeans matching this destination
 long getTotalBlockedTime()
           
 boolean isAlwaysRetroactive()
           
 boolean isDLQ()
           
 boolean isEnableAudit()
           
 boolean isPrioritizedMessages()
           
 boolean isProducerFlowControl()
           
 boolean isUseCache()
           
 void resetStatistics()
          Resets the managment counters.
 String sendTextMessage(Map<String,String> headers, String body, String userName, String password)
           
 String sendTextMessage(Map headers, String body)
          Sends a TextMesage to the destination.
 String sendTextMessage(String body)
          Sends a TextMesage to the destination.
 String sendTextMessage(String body, String user, String password)
          Sends a TextMesage to the destination.
 String sendTextMessageWithProperties(String properties)
          Sends a TextMessage to the destination.
 void setAlwaysRetroactive(boolean alwaysRetroactive)
           
 void setBlockedProducerWarningInterval(long blockedProducerWarningInterval)
          Set's the interval at which warnings about producers being blocked by resource usage will be triggered.
 void setEnableAudit(boolean enableAudit)
           
 void setMaxAuditDepth(int maxAuditDepth)
           
 void setMaxPageSize(int pageSize)
           
 void setMaxProducersToAudit(int maxProducersToAudit)
           
 void setMemoryLimit(long limit)
          set the amount of memory allocated to this destination
 void setMemoryUsagePortion(float value)
          set the portion of memory from the broker memory limit for this destination
 void setProducerFlowControl(boolean producerFlowControl)
           
 void setUseCache(boolean value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

destination

protected final Destination destination

broker

protected final ManagedRegionBroker broker
Constructor Detail

DestinationView

public DestinationView(ManagedRegionBroker broker,
                       Destination destination)
Method Detail

gc

public void gc()

getName

public String getName()
Description copied from interface: DestinationViewMBean
Returns the name of this destination

Specified by:
getName in interface DestinationViewMBean

resetStatistics

public void resetStatistics()
Description copied from interface: DestinationViewMBean
Resets the managment counters.

Specified by:
resetStatistics in interface DestinationViewMBean

getEnqueueCount

public long getEnqueueCount()
Description copied from interface: DestinationViewMBean
Returns the number of messages that have been sent to the destination.

Specified by:
getEnqueueCount in interface DestinationViewMBean
Returns:
The number of messages that have been sent to the destination.

getDequeueCount

public long getDequeueCount()
Description copied from interface: DestinationViewMBean
Returns the number of messages that have been acknowledged from the destination.

Specified by:
getDequeueCount in interface DestinationViewMBean
Returns:
The number of messages that have been acknowledged from the destination.

getDispatchCount

public long getDispatchCount()
Description copied from interface: DestinationViewMBean
Returns the number of messages that have been delivered (potentially not acknowledged) to consumers.

Specified by:
getDispatchCount in interface DestinationViewMBean
Returns:
The number of messages that have been delivered (potentially not acknowledged) to consumers.

getInFlightCount

public long getInFlightCount()
Description copied from interface: DestinationViewMBean
Returns the number of messages that have been dispatched but not acknowledged

Specified by:
getInFlightCount in interface DestinationViewMBean
Returns:
The number of messages that have been dispatched but not acknowledged

getExpiredCount

public long getExpiredCount()
Description copied from interface: DestinationViewMBean
Returns the number of messages that have expired

Specified by:
getExpiredCount in interface DestinationViewMBean
Returns:
The number of messages that have expired

getConsumerCount

public long getConsumerCount()
Description copied from interface: DestinationViewMBean
Returns the number of consumers subscribed this destination.

Specified by:
getConsumerCount in interface DestinationViewMBean
Returns:
The number of consumers subscribed this destination.

getQueueSize

public long getQueueSize()
Description copied from interface: DestinationViewMBean
Returns the number of messages in this destination which are yet to be consumed

Specified by:
getQueueSize in interface DestinationViewMBean
Returns:
Returns the number of messages in this destination which are yet to be consumed

getMessagesCached

public long getMessagesCached()

getMemoryPercentUsage

public int getMemoryPercentUsage()
Specified by:
getMemoryPercentUsage in interface DestinationViewMBean
Returns:
the percentage of amount of memory used

getMemoryUsageByteCount

public long getMemoryUsageByteCount()
Specified by:
getMemoryUsageByteCount in interface DestinationViewMBean
Returns:
the amount of memory currently used by this destination

getMemoryLimit

public long getMemoryLimit()
Specified by:
getMemoryLimit in interface DestinationViewMBean
Returns:
the amount of memory allocated to this destination

setMemoryLimit

public void setMemoryLimit(long limit)
Description copied from interface: DestinationViewMBean
set the amount of memory allocated to this destination

Specified by:
setMemoryLimit in interface DestinationViewMBean

getAverageEnqueueTime

public double getAverageEnqueueTime()
Specified by:
getAverageEnqueueTime in interface DestinationViewMBean

getMaxEnqueueTime

public long getMaxEnqueueTime()
Specified by:
getMaxEnqueueTime in interface DestinationViewMBean
Returns:
longest time a message is held by a destination

getMinEnqueueTime

public long getMinEnqueueTime()
Specified by:
getMinEnqueueTime in interface DestinationViewMBean
Returns:
shortest time a message is held by a destination

getAverageMessageSize

public double getAverageMessageSize()
Specified by:
getAverageMessageSize in interface DestinationViewMBean
Returns:
the average size of a message (bytes)

getMaxMessageSize

public long getMaxMessageSize()
Specified by:
getMaxMessageSize in interface DestinationViewMBean
Returns:
the max size of a message (bytes)

getMinMessageSize

public long getMinMessageSize()
Specified by:
getMinMessageSize in interface DestinationViewMBean
Returns:
the min size of a message (bytes)

isPrioritizedMessages

public boolean isPrioritizedMessages()
Specified by:
isPrioritizedMessages in interface DestinationViewMBean
Returns:
true if prioritized messages are enabled for the destination

browse

public CompositeData[] browse()
                       throws OpenDataException
Specified by:
browse in interface DestinationViewMBean
Returns:
An array of all the messages in the destination's queue.
Throws:
OpenDataException

browse

public CompositeData[] browse(String selector)
                       throws OpenDataException,
                              InvalidSelectorException
Specified by:
browse in interface DestinationViewMBean
Returns:
An array of all the messages in the destination's queue.
Throws:
InvalidSelectorException
OpenDataException

browseMessages

public List<Object> browseMessages()
                            throws InvalidSelectorException
Browses the current destination returning a list of messages

Specified by:
browseMessages in interface DestinationViewMBean
Throws:
InvalidSelectorException

browseMessages

public List<Object> browseMessages(String selector)
                            throws InvalidSelectorException
Browses the current destination with the given selector returning a list of messages

Specified by:
browseMessages in interface DestinationViewMBean
Throws:
InvalidSelectorException

browseAsTable

public TabularData browseAsTable()
                          throws OpenDataException
Specified by:
browseAsTable in interface DestinationViewMBean
Returns:
A list of all the messages in the destination's queue.
Throws:
OpenDataException

browseAsTable

public TabularData browseAsTable(String selector)
                          throws OpenDataException,
                                 InvalidSelectorException
Specified by:
browseAsTable in interface DestinationViewMBean
Returns:
A list of all the messages in the destination's queue.
Throws:
InvalidSelectorException
OpenDataException

sendTextMessageWithProperties

public String sendTextMessageWithProperties(String properties)
                                     throws Exception
Description copied from interface: DestinationViewMBean
Sends a TextMessage to the destination.

Specified by:
sendTextMessageWithProperties in interface DestinationViewMBean
Parameters:
properties - the message properties to set as a comma sep name=value list. Can only contain Strings maped to primitive types or JMS properties. eg: body=hi,JMSReplyTo=Queue2
Returns:
the message id of the message sent.
Throws:
Exception

sendTextMessage

public String sendTextMessage(String body)
                       throws Exception
Description copied from interface: DestinationViewMBean
Sends a TextMesage to the destination.

Specified by:
sendTextMessage in interface DestinationViewMBean
Parameters:
body - the text to send
Returns:
the message id of the message sent.
Throws:
Exception

sendTextMessage

public String sendTextMessage(Map headers,
                              String body)
                       throws Exception
Description copied from interface: DestinationViewMBean
Sends a TextMesage to the destination.

Specified by:
sendTextMessage in interface DestinationViewMBean
Parameters:
headers - the message headers and properties to set. Can only container Strings maped to primitive types.
body - the text to send
Returns:
the message id of the message sent.
Throws:
Exception

sendTextMessage

public String sendTextMessage(String body,
                              String user,
                              String password)
                       throws Exception
Description copied from interface: DestinationViewMBean
Sends a TextMesage to the destination.

Specified by:
sendTextMessage in interface DestinationViewMBean
Parameters:
body - the text to send
Returns:
Throws:
Exception

sendTextMessage

public String sendTextMessage(Map<String,String> headers,
                              String body,
                              String userName,
                              String password)
                       throws Exception
Specified by:
sendTextMessage in interface DestinationViewMBean
Parameters:
headers - the message headers and properties to set. Can only container Strings maped to primitive types.
body - the text to send
Returns:
Throws:
Exception

getMaxAuditDepth

public int getMaxAuditDepth()
Specified by:
getMaxAuditDepth in interface DestinationViewMBean
Returns:
the maxAuditDepth

getMaxProducersToAudit

public int getMaxProducersToAudit()
Specified by:
getMaxProducersToAudit in interface DestinationViewMBean
Returns:
the maxProducersToAudit

isEnableAudit

public boolean isEnableAudit()

setEnableAudit

public void setEnableAudit(boolean enableAudit)

setMaxAuditDepth

public void setMaxAuditDepth(int maxAuditDepth)
Specified by:
setMaxAuditDepth in interface DestinationViewMBean
Parameters:
maxAuditDepth - the maxAuditDepth to set

setMaxProducersToAudit

public void setMaxProducersToAudit(int maxProducersToAudit)
Specified by:
setMaxProducersToAudit in interface DestinationViewMBean
Parameters:
maxProducersToAudit - the maxProducersToAudit to set

getMemoryUsagePortion

public float getMemoryUsagePortion()
Specified by:
getMemoryUsagePortion in interface DestinationViewMBean
Returns:
the portion of memory from the broker memory limit for this destination

getProducerCount

public long getProducerCount()
Specified by:
getProducerCount in interface DestinationViewMBean
Returns:
the number of producers publishing to the destination

isProducerFlowControl

public boolean isProducerFlowControl()
Specified by:
isProducerFlowControl in interface DestinationViewMBean
Returns:
the producerFlowControl

setMemoryUsagePortion

public void setMemoryUsagePortion(float value)
Description copied from interface: DestinationViewMBean
set the portion of memory from the broker memory limit for this destination

Specified by:
setMemoryUsagePortion in interface DestinationViewMBean

setProducerFlowControl

public void setProducerFlowControl(boolean producerFlowControl)
Specified by:
setProducerFlowControl in interface DestinationViewMBean
Parameters:
producerFlowControl - the producerFlowControl to set

isAlwaysRetroactive

public boolean isAlwaysRetroactive()
Specified by:
isAlwaysRetroactive in interface DestinationViewMBean
Returns:
if we treat consumers as alwaysRetroactive

setAlwaysRetroactive

public void setAlwaysRetroactive(boolean alwaysRetroactive)
Specified by:
setAlwaysRetroactive in interface DestinationViewMBean
Parameters:
alwaysRetroactive - set as always retroActive

setBlockedProducerWarningInterval

public void setBlockedProducerWarningInterval(long blockedProducerWarningInterval)
Set's the interval at which warnings about producers being blocked by resource usage will be triggered. Values of 0 or less will disable warnings

Specified by:
setBlockedProducerWarningInterval in interface DestinationViewMBean
Parameters:
blockedProducerWarningInterval - the interval at which warning about blocked producers will be triggered.

getBlockedProducerWarningInterval

public long getBlockedProducerWarningInterval()
Specified by:
getBlockedProducerWarningInterval in interface DestinationViewMBean
Returns:
the interval at which warning about blocked producers will be triggered.

getMaxPageSize

public int getMaxPageSize()
Specified by:
getMaxPageSize in interface DestinationViewMBean
Returns:
the maximum number of message to be paged into the destination

setMaxPageSize

public void setMaxPageSize(int pageSize)
Specified by:
setMaxPageSize in interface DestinationViewMBean
Parameters:
pageSize - Set the maximum number of messages to page into the destination

isUseCache

public boolean isUseCache()
Specified by:
isUseCache in interface DestinationViewMBean
Returns:
true if caching is allowed of for the destination

setUseCache

public void setUseCache(boolean value)
Specified by:
setUseCache in interface DestinationViewMBean
Parameters:
value - enable/disable caching on the destination

getSubscriptions

public ObjectName[] getSubscriptions()
                              throws IOException,
                                     MalformedObjectNameException
Description copied from interface: DestinationViewMBean
Returns all the current subscription MBeans matching this destination

Specified by:
getSubscriptions in interface DestinationViewMBean
Returns:
the names of the subscriptions for this destination
Throws:
IOException
MalformedObjectNameException

getSlowConsumerStrategy

public ObjectName getSlowConsumerStrategy()
                                   throws IOException,
                                          MalformedObjectNameException
Description copied from interface: DestinationViewMBean
Returns the slow consumer strategy MBean for this destination

Specified by:
getSlowConsumerStrategy in interface DestinationViewMBean
Returns:
the name of the slow consumer handler MBean for this destination
Throws:
IOException
MalformedObjectNameException

getOptions

public String getOptions()
Specified by:
getOptions in interface DestinationViewMBean
Returns:
A string of destination options, name value pairs as URL queryString.

isDLQ

public boolean isDLQ()
Specified by:
isDLQ in interface DestinationViewMBean
Returns:
true if this is dead letter queue

getBlockedSends

public long getBlockedSends()
Specified by:
getBlockedSends in interface DestinationViewMBean

getAverageBlockedTime

public double getAverageBlockedTime()
Specified by:
getAverageBlockedTime in interface DestinationViewMBean

getTotalBlockedTime

public long getTotalBlockedTime()
Specified by:
getTotalBlockedTime in interface DestinationViewMBean


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.