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 browseMessages()
          Browses the current destination returning a list of messages
 List browseMessages(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()
           
 String getName()
          Returns the name of this destination
 long getQueueSize()
           
 void resetStatistics()
          Resets the managment counters.
 String sendTextMessage(Map headers, String body)
          Sends a TextMesage to the destination.
 String sendTextMessage(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 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 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,
                              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
OpenDataException

browseMessages

public 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 List browseMessages(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 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,
                                 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
OpenDataException

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


Copyright © 2011 Apache Software Foundation. All Rights Reserved.