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 java.lang.Object
implements DestinationViewMBean


Field Summary
protected  ManagedRegionBroker broker
           
protected  Destination destination
           
 
Constructor Summary
DestinationView(ManagedRegionBroker broker, Destination destination)
           
 
Method Summary
 javax.management.openmbean.CompositeData[] browse()
           
 javax.management.openmbean.CompositeData[] browse(java.lang.String selector)
           
 javax.management.openmbean.TabularData browseAsTable()
           
 javax.management.openmbean.TabularData browseAsTable(java.lang.String selector)
           
 java.util.List<java.lang.Object> browseMessages()
          Browses the current destination returning a list of messages
 java.util.List<java.lang.Object> browseMessages(java.lang.String selector)
          Browses the current destination with the given selector returning a list of messages
 void gc()
           
 double getAverageEnqueueTime()
           
 long getBlockedProducerWarningInterval()
           
 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()
           
 int getMaxPageSize()
           
 int getMaxProducersToAudit()
           
 long getMemoryLimit()
           
 int getMemoryPercentUsage()
           
 float getMemoryUsagePortion()
           
 long getMessagesCached()
           
 long getMinEnqueueTime()
           
 java.lang.String getName()
          Returns the name of this destination
 long getProducerCount()
           
 long getQueueSize()
          Returns the number of messages in this destination which are yet to be consumed
 javax.management.ObjectName getSlowConsumerStrategy()
          Returns the slow consumer strategy MBean for this destination
 javax.management.ObjectName[] getSubscriptions()
          Returns all the current subscription MBeans matching this destination
 boolean isEnableAudit()
           
 boolean isPrioritizedMessages()
           
 boolean isProducerFlowControl()
           
 boolean isUseCache()
           
 void resetStatistics()
          Resets the managment counters.
 java.lang.String sendTextMessage(java.util.Map headers, java.lang.String body)
          Sends a TextMesage to the destination.
 java.lang.String sendTextMessage(java.util.Map headers, java.lang.String body, java.lang.String userName, java.lang.String password)
           
 java.lang.String sendTextMessage(java.lang.String body)
          Sends a TextMesage to the destination.
 java.lang.String sendTextMessage(java.lang.String body, java.lang.String user, java.lang.String password)
          Sends a TextMesage to the destination.
 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 java.lang.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

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
Returns:
average time a message is held by a destination

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

isPrioritizedMessages

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

browse

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

browse

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

browseMessages

public java.util.List<java.lang.Object> browseMessages()
                                                throws javax.jms.InvalidSelectorException
Browses the current destination returning a list of messages

Specified by:
browseMessages in interface DestinationViewMBean
Throws:
javax.jms.InvalidSelectorException

browseMessages

public java.util.List<java.lang.Object> browseMessages(java.lang.String selector)
                                                throws javax.jms.InvalidSelectorException
Browses the current destination with the given selector returning a list of messages

Specified by:
browseMessages in interface DestinationViewMBean
Throws:
javax.jms.InvalidSelectorException

browseAsTable

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

browseAsTable

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

sendTextMessage

public java.lang.String sendTextMessage(java.lang.String body)
                                 throws java.lang.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:
java.lang.Exception

sendTextMessage

public java.lang.String sendTextMessage(java.util.Map headers,
                                        java.lang.String body)
                                 throws java.lang.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:
java.lang.Exception

sendTextMessage

public java.lang.String sendTextMessage(java.lang.String body,
                                        java.lang.String user,
                                        java.lang.String password)
                                 throws java.lang.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:
java.lang.Exception

sendTextMessage

public java.lang.String sendTextMessage(java.util.Map headers,
                                        java.lang.String body,
                                        java.lang.String userName,
                                        java.lang.String password)
                                 throws java.lang.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:
java.lang.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

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 javax.management.ObjectName[] getSubscriptions()
                                               throws java.io.IOException,
                                                      javax.management.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:
java.io.IOException
javax.management.MalformedObjectNameException

getSlowConsumerStrategy

public javax.management.ObjectName getSlowConsumerStrategy()
                                                    throws java.io.IOException,
                                                           javax.management.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:
java.io.IOException
javax.management.MalformedObjectNameException


Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.