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 browseMessages()
          Browses the current destination returning a list of messages
 java.util.List browseMessages(java.lang.String selector)
          Browses the current destination with the given selector returning a list of messages
 void gc()
           
 long getConsumerCount()
           
 long getDequeueCount()
           
 long getDispatchCount()
           
 long getEnqueueCount()
           
 long getMemoryLimit()
           
 int getMemoryPercentageUsed()
           
 long getMessagesCached()
           
 java.lang.String getName()
          Returns the name of this destination
 long getQueueSize()
           
 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.lang.String body)
          Sends a TextMesage to the destination.
 void setMemoryLimit(long limit)
           
 
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()
Specified by:
getEnqueueCount in interface DestinationViewMBean
Returns:
The number of messages that have been sent to the destination.

getDequeueCount

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

getDispatchCount

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

getConsumerCount

public long getConsumerCount()
Specified by:
getConsumerCount in interface DestinationViewMBean
Returns:
The number of consmers subscribed to messages from this destination.

getQueueSize

public long getQueueSize()
Specified by:
getQueueSize in interface DestinationViewMBean
Returns:
The number of messages being buffered by this destination

getMessagesCached

public long getMessagesCached()

getMemoryPercentageUsed

public int getMemoryPercentageUsed()
Specified by:
getMemoryPercentageUsed in interface DestinationViewMBean

getMemoryLimit

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

setMemoryLimit

public void setMemoryLimit(long limit)
Specified by:
setMemoryLimit in interface DestinationViewMBean

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 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 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


Copyright © 2010 Apache Software Foundation. All Rights Reserved.