org.apache.activemq.broker.jmx
Class BrokerView

java.lang.Object
  extended by org.apache.activemq.broker.jmx.BrokerView
All Implemented Interfaces:
BrokerViewMBean, Service

public class BrokerView
extends Object
implements BrokerViewMBean


Constructor Summary
BrokerView(BrokerService brokerService, ManagedRegionBroker managedBroker)
           
 
Method Summary
 void addQueue(String name)
          Adds a Queue destination to the broker.
 void addTopic(String name)
          Adds a Topic destination to the broker.
protected static ConnectionContext createAdminConnectionContext(Broker broker)
          Factory method to create the new administration connection context object.
 ObjectName createDurableSubscriber(String clientId, String subscriberName, String topicName, String selector)
          Creates a new durable topic subscriber
 void destroyDurableSubscriber(String clientId, String subscriberName)
          Destroys a durable subscriber
 void gc()
          The Broker will fush it's caches so that the garbage collector can recalaim more memory.
 ManagedRegionBroker getBroker()
           
 String getBrokerId()
           
static ConnectionContext getConnectionContext(Broker broker)
          Returns the broker's administration connection context used for configuring the broker at startup
 ObjectName[] getDurableTopicSubscribers()
           
 ObjectName[] getInactiveDurableTopicSubscribers()
           
 long getMemoryLimit()
           
 int getMemoryPercentageUsed()
           
 ObjectName[] getQueues()
           
 ObjectName[] getQueueSubscribers()
           
 ObjectName[] getTemporaryQueues()
           
 ObjectName[] getTemporaryQueueSubscribers()
           
 ObjectName[] getTemporaryTopics()
           
 ObjectName[] getTemporaryTopicSubscribers()
           
 ObjectName[] getTopics()
           
 ObjectName[] getTopicSubscribers()
           
 long getTotalConsumerCount()
           
 long getTotalDequeueCount()
           
 long getTotalEnqueueCount()
           
 long getTotalMessageCount()
           
 long getTotalMessagesCached()
           
 void removeQueue(String name)
          Removes a Queue destination from the broker.
 void removeTopic(String name)
          Removes a Topic destination from the broker.
 void resetStatistics()
           
 void setMemoryLimit(long limit)
           
 void start()
           
 void stop()
          Stop the broker and all it's components.
 void terminateJVM(int exitCode)
          Shuts down the JVM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrokerView

public BrokerView(BrokerService brokerService,
                  ManagedRegionBroker managedBroker)
           throws Exception
Throws:
Exception
Method Detail

getBroker

public ManagedRegionBroker getBroker()

getBrokerId

public String getBrokerId()
Specified by:
getBrokerId in interface BrokerViewMBean
Returns:
The unique id of the broker.

gc

public void gc()
        throws Exception
Description copied from interface: BrokerViewMBean
The Broker will fush it's caches so that the garbage collector can recalaim more memory.

Specified by:
gc in interface BrokerViewMBean
Throws:
Exception

start

public void start()
           throws Exception
Specified by:
start in interface Service
Throws:
Exception

stop

public void stop()
          throws Exception
Description copied from interface: BrokerViewMBean
Stop the broker and all it's components.

Specified by:
stop in interface BrokerViewMBean
Specified by:
stop in interface Service
Throws:
Exception

getTotalEnqueueCount

public long getTotalEnqueueCount()
Specified by:
getTotalEnqueueCount in interface BrokerViewMBean

getTotalDequeueCount

public long getTotalDequeueCount()
Specified by:
getTotalDequeueCount in interface BrokerViewMBean

getTotalConsumerCount

public long getTotalConsumerCount()
Specified by:
getTotalConsumerCount in interface BrokerViewMBean

getTotalMessageCount

public long getTotalMessageCount()
Specified by:
getTotalMessageCount in interface BrokerViewMBean

getTotalMessagesCached

public long getTotalMessagesCached()

getMemoryPercentageUsed

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

getMemoryLimit

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

setMemoryLimit

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

resetStatistics

public void resetStatistics()
Specified by:
resetStatistics in interface BrokerViewMBean

terminateJVM

public void terminateJVM(int exitCode)
Description copied from interface: BrokerViewMBean
Shuts down the JVM.

Specified by:
terminateJVM in interface BrokerViewMBean
Parameters:
exitCode - the exit code that will be reported by the JVM process when it exits.

getTopics

public ObjectName[] getTopics()
Specified by:
getTopics in interface BrokerViewMBean

getQueues

public ObjectName[] getQueues()
Specified by:
getQueues in interface BrokerViewMBean

getTemporaryTopics

public ObjectName[] getTemporaryTopics()
Specified by:
getTemporaryTopics in interface BrokerViewMBean

getTemporaryQueues

public ObjectName[] getTemporaryQueues()
Specified by:
getTemporaryQueues in interface BrokerViewMBean

getTopicSubscribers

public ObjectName[] getTopicSubscribers()
Specified by:
getTopicSubscribers in interface BrokerViewMBean

getDurableTopicSubscribers

public ObjectName[] getDurableTopicSubscribers()
Specified by:
getDurableTopicSubscribers in interface BrokerViewMBean

getQueueSubscribers

public ObjectName[] getQueueSubscribers()
Specified by:
getQueueSubscribers in interface BrokerViewMBean

getTemporaryTopicSubscribers

public ObjectName[] getTemporaryTopicSubscribers()
Specified by:
getTemporaryTopicSubscribers in interface BrokerViewMBean

getTemporaryQueueSubscribers

public ObjectName[] getTemporaryQueueSubscribers()
Specified by:
getTemporaryQueueSubscribers in interface BrokerViewMBean

getInactiveDurableTopicSubscribers

public ObjectName[] getInactiveDurableTopicSubscribers()
Specified by:
getInactiveDurableTopicSubscribers in interface BrokerViewMBean

addTopic

public void addTopic(String name)
              throws Exception
Description copied from interface: BrokerViewMBean
Adds a Topic destination to the broker.

Specified by:
addTopic in interface BrokerViewMBean
Parameters:
name - The name of the Topic
Throws:
Exception

addQueue

public void addQueue(String name)
              throws Exception
Description copied from interface: BrokerViewMBean
Adds a Queue destination to the broker.

Specified by:
addQueue in interface BrokerViewMBean
Parameters:
name - The name of the Queue
Throws:
Exception

removeTopic

public void removeTopic(String name)
                 throws Exception
Description copied from interface: BrokerViewMBean
Removes a Topic destination from the broker.

Specified by:
removeTopic in interface BrokerViewMBean
Parameters:
name - The name of the Topic
Throws:
Exception

removeQueue

public void removeQueue(String name)
                 throws Exception
Description copied from interface: BrokerViewMBean
Removes a Queue destination from the broker.

Specified by:
removeQueue in interface BrokerViewMBean
Parameters:
name - The name of the Queue
Throws:
Exception

createDurableSubscriber

public ObjectName createDurableSubscriber(String clientId,
                                          String subscriberName,
                                          String topicName,
                                          String selector)
                                   throws Exception
Description copied from interface: BrokerViewMBean
Creates a new durable topic subscriber

Specified by:
createDurableSubscriber in interface BrokerViewMBean
Parameters:
clientId - the JMS client ID
subscriberName - the durable subscriber name
topicName - the name of the topic to subscribe to
selector - a selector or null
Returns:
the object name of the MBean registered in JMX
Throws:
Exception

destroyDurableSubscriber

public void destroyDurableSubscriber(String clientId,
                                     String subscriberName)
                              throws Exception
Description copied from interface: BrokerViewMBean
Destroys a durable subscriber

Specified by:
destroyDurableSubscriber in interface BrokerViewMBean
Parameters:
clientId - the JMS client ID
subscriberName - the durable subscriber name
Throws:
Exception

getConnectionContext

public static ConnectionContext getConnectionContext(Broker broker)
Returns the broker's administration connection context used for configuring the broker at startup


createAdminConnectionContext

protected static ConnectionContext createAdminConnectionContext(Broker broker)
Factory method to create the new administration connection context object. Note this method is here rather than inside a default broker implementation to ensure that the broker reference inside it is the outer most interceptor



Copyright © 2011 Apache Software Foundation. All Rights Reserved.