Package org.apache.activemq.broker.jmx
Class BrokerView
- java.lang.Object
-
- org.apache.activemq.broker.jmx.BrokerView
-
- All Implemented Interfaces:
BrokerViewMBean
,Service
public class BrokerView extends Object implements BrokerViewMBean
-
-
Constructor Summary
Constructors Constructor Description BrokerView(BrokerService brokerService, ManagedRegionBroker managedBroker)
-
Method Summary
-
-
-
Constructor Detail
-
BrokerView
public BrokerView(BrokerService brokerService, ManagedRegionBroker managedBroker) throws Exception
- Throws:
Exception
-
-
Method Detail
-
getBroker
public ManagedRegionBroker getBroker()
-
setBroker
public void setBroker(ManagedRegionBroker broker)
-
getBrokerId
public String getBrokerId()
- Specified by:
getBrokerId
in interfaceBrokerViewMBean
- Returns:
- The unique id of the broker.
-
getBrokerName
public String getBrokerName()
- Specified by:
getBrokerName
in interfaceBrokerViewMBean
- Returns:
- The name of the broker.
-
getBrokerVersion
public String getBrokerVersion()
- Specified by:
getBrokerVersion
in interfaceBrokerViewMBean
- Returns:
- The name of the broker.
-
getUptime
public String getUptime()
- Specified by:
getUptime
in interfaceBrokerViewMBean
- Returns:
- Uptime of the broker.
-
getUptimeMillis
public long getUptimeMillis()
- Specified by:
getUptimeMillis
in interfaceBrokerViewMBean
- Returns:
- Uptime of the broker in milliseconds.
-
getCurrentConnectionsCount
public int getCurrentConnectionsCount()
- Specified by:
getCurrentConnectionsCount
in interfaceBrokerViewMBean
- Returns:
- The current number of active connections on this Broker.
-
getTotalConnectionsCount
public long getTotalConnectionsCount()
- Specified by:
getTotalConnectionsCount
in interfaceBrokerViewMBean
- Returns:
- The total number of connections serviced since this Broker was started.
-
gc
public void gc() throws Exception
Description copied from interface:BrokerViewMBean
The Broker will flush it's caches so that the garbage collector can reclaim more memory.- Specified by:
gc
in interfaceBrokerViewMBean
- Throws:
Exception
-
start
public void start() 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 interfaceBrokerViewMBean
- Specified by:
stop
in interfaceService
- Throws:
Exception
-
restart
public void restart() throws Exception
Description copied from interface:BrokerViewMBean
Restart the broker and all it's components.- Specified by:
restart
in interfaceBrokerViewMBean
- Throws:
Exception
-
stopGracefully
public void stopGracefully(String connectorName, String queueName, long timeout, long pollInterval) throws Exception
- Specified by:
stopGracefully
in interfaceBrokerViewMBean
- Throws:
Exception
-
getTotalEnqueueCount
public long getTotalEnqueueCount()
- Specified by:
getTotalEnqueueCount
in interfaceBrokerViewMBean
-
getTotalDequeueCount
public long getTotalDequeueCount()
- Specified by:
getTotalDequeueCount
in interfaceBrokerViewMBean
-
getTotalConsumerCount
public long getTotalConsumerCount()
- Specified by:
getTotalConsumerCount
in interfaceBrokerViewMBean
-
getTotalProducerCount
public long getTotalProducerCount()
- Specified by:
getTotalProducerCount
in interfaceBrokerViewMBean
-
getTotalMessageCount
public long getTotalMessageCount()
- Specified by:
getTotalMessageCount
in interfaceBrokerViewMBean
-
getAverageMessageSize
public long getAverageMessageSize()
- Specified by:
getAverageMessageSize
in interfaceBrokerViewMBean
- Returns:
- the average size of a message (bytes)
-
getMaxMessageSize
public long getMaxMessageSize()
- Specified by:
getMaxMessageSize
in interfaceBrokerViewMBean
- Returns:
- the max size of a message (bytes)
-
getMinMessageSize
public long getMinMessageSize()
- Specified by:
getMinMessageSize
in interfaceBrokerViewMBean
- Returns:
- the min size of a message (bytes)
-
getTotalMessagesCached
public long getTotalMessagesCached()
-
getMemoryPercentUsage
public int getMemoryPercentUsage()
- Specified by:
getMemoryPercentUsage
in interfaceBrokerViewMBean
-
getMemoryLimit
public long getMemoryLimit()
- Specified by:
getMemoryLimit
in interfaceBrokerViewMBean
-
setMemoryLimit
public void setMemoryLimit(long limit)
- Specified by:
setMemoryLimit
in interfaceBrokerViewMBean
-
getStoreLimit
public long getStoreLimit()
- Specified by:
getStoreLimit
in interfaceBrokerViewMBean
-
getStorePercentUsage
public int getStorePercentUsage()
- Specified by:
getStorePercentUsage
in interfaceBrokerViewMBean
-
getTempLimit
public long getTempLimit()
- Specified by:
getTempLimit
in interfaceBrokerViewMBean
-
getTempPercentUsage
public int getTempPercentUsage()
- Specified by:
getTempPercentUsage
in interfaceBrokerViewMBean
-
getJobSchedulerStoreLimit
public long getJobSchedulerStoreLimit()
- Specified by:
getJobSchedulerStoreLimit
in interfaceBrokerViewMBean
-
getJobSchedulerStorePercentUsage
public int getJobSchedulerStorePercentUsage()
- Specified by:
getJobSchedulerStorePercentUsage
in interfaceBrokerViewMBean
-
setStoreLimit
public void setStoreLimit(long limit)
- Specified by:
setStoreLimit
in interfaceBrokerViewMBean
-
setTempLimit
public void setTempLimit(long limit)
- Specified by:
setTempLimit
in interfaceBrokerViewMBean
-
setJobSchedulerStoreLimit
public void setJobSchedulerStoreLimit(long limit)
- Specified by:
setJobSchedulerStoreLimit
in interfaceBrokerViewMBean
-
resetStatistics
public void resetStatistics()
- Specified by:
resetStatistics
in interfaceBrokerViewMBean
-
enableStatistics
public void enableStatistics()
- Specified by:
enableStatistics
in interfaceBrokerViewMBean
-
disableStatistics
public void disableStatistics()
- Specified by:
disableStatistics
in interfaceBrokerViewMBean
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
- Specified by:
isStatisticsEnabled
in interfaceBrokerViewMBean
-
isPersistent
public boolean isPersistent()
- Specified by:
isPersistent
in interfaceBrokerViewMBean
-
terminateJVM
public void terminateJVM(int exitCode)
Description copied from interface:BrokerViewMBean
Shuts down the JVM.- Specified by:
terminateJVM
in interfaceBrokerViewMBean
- Parameters:
exitCode
- the exit code that will be reported by the JVM process when it exits.
-
getTopics
public ObjectName[] getTopics()
- Specified by:
getTopics
in interfaceBrokerViewMBean
-
getQueues
public ObjectName[] getQueues()
- Specified by:
getQueues
in interfaceBrokerViewMBean
-
queryQueues
public String queryQueues(String filter, int page, int pageSize) throws IOException
Description copied from interface:BrokerViewMBean
Queue Query API, take a look atDestinationsViewFilter
for more information- Specified by:
queryQueues
in interfaceBrokerViewMBean
- Throws:
IOException
-
queryTopics
public String queryTopics(String filter, int page, int pageSize) throws IOException
Description copied from interface:BrokerViewMBean
Topic Query API, take a look atDestinationsViewFilter
for more information- Specified by:
queryTopics
in interfaceBrokerViewMBean
- Throws:
IOException
-
browseQueue
public CompositeData[] browseQueue(String queueName) throws OpenDataException, MalformedObjectNameException
- Specified by:
browseQueue
in interfaceBrokerViewMBean
- Throws:
OpenDataException
MalformedObjectNameException
-
getTemporaryTopics
public ObjectName[] getTemporaryTopics()
- Specified by:
getTemporaryTopics
in interfaceBrokerViewMBean
-
getTemporaryQueues
public ObjectName[] getTemporaryQueues()
- Specified by:
getTemporaryQueues
in interfaceBrokerViewMBean
-
getTopicSubscribers
public ObjectName[] getTopicSubscribers()
- Specified by:
getTopicSubscribers
in interfaceBrokerViewMBean
-
getDurableTopicSubscribers
public ObjectName[] getDurableTopicSubscribers()
- Specified by:
getDurableTopicSubscribers
in interfaceBrokerViewMBean
-
getQueueSubscribers
public ObjectName[] getQueueSubscribers()
- Specified by:
getQueueSubscribers
in interfaceBrokerViewMBean
-
getTemporaryTopicSubscribers
public ObjectName[] getTemporaryTopicSubscribers()
- Specified by:
getTemporaryTopicSubscribers
in interfaceBrokerViewMBean
-
getTemporaryQueueSubscribers
public ObjectName[] getTemporaryQueueSubscribers()
- Specified by:
getTemporaryQueueSubscribers
in interfaceBrokerViewMBean
-
getInactiveDurableTopicSubscribers
public ObjectName[] getInactiveDurableTopicSubscribers()
- Specified by:
getInactiveDurableTopicSubscribers
in interfaceBrokerViewMBean
-
getTopicProducers
public ObjectName[] getTopicProducers()
- Specified by:
getTopicProducers
in interfaceBrokerViewMBean
-
getQueueProducers
public ObjectName[] getQueueProducers()
- Specified by:
getQueueProducers
in interfaceBrokerViewMBean
-
getTemporaryTopicProducers
public ObjectName[] getTemporaryTopicProducers()
- Specified by:
getTemporaryTopicProducers
in interfaceBrokerViewMBean
-
getTemporaryQueueProducers
public ObjectName[] getTemporaryQueueProducers()
- Specified by:
getTemporaryQueueProducers
in interfaceBrokerViewMBean
-
getDynamicDestinationProducers
public ObjectName[] getDynamicDestinationProducers()
- Specified by:
getDynamicDestinationProducers
in interfaceBrokerViewMBean
-
addConnector
public String addConnector(String discoveryAddress) throws Exception
- Specified by:
addConnector
in interfaceBrokerViewMBean
- Throws:
Exception
-
addNetworkConnector
public String addNetworkConnector(String discoveryAddress) throws Exception
- Specified by:
addNetworkConnector
in interfaceBrokerViewMBean
- Throws:
Exception
-
removeConnector
public boolean removeConnector(String connectorName) throws Exception
- Specified by:
removeConnector
in interfaceBrokerViewMBean
- Throws:
Exception
-
removeNetworkConnector
public boolean removeNetworkConnector(String connectorName) throws Exception
- Specified by:
removeNetworkConnector
in interfaceBrokerViewMBean
- Throws:
Exception
-
addTopic
public void addTopic(String name) throws Exception
Description copied from interface:BrokerViewMBean
Adds a Topic destination to the broker.- Specified by:
addTopic
in interfaceBrokerViewMBean
- 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 interfaceBrokerViewMBean
- 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 interfaceBrokerViewMBean
- 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 interfaceBrokerViewMBean
- 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 interfaceBrokerViewMBean
- Parameters:
clientId
- the JMS client IDsubscriberName
- the durable subscriber nametopicName
- the name of the topic to subscribe toselector
- 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 interfaceBrokerViewMBean
- Parameters:
clientId
- the JMS client IDsubscriberName
- the durable subscriber name- Throws:
Exception
-
reloadLog4jProperties
public void reloadLog4jProperties() throws Throwable
Description copied from interface:BrokerViewMBean
Reloads log4j.properties from the classpath. This methods calls org.apache.activemq.transport.TransportLoggerControl.reloadLog4jProperties- Specified by:
reloadLog4jProperties
in interfaceBrokerViewMBean
- Throws:
Throwable
-
getTransportConnectors
public Map<String,String> getTransportConnectors()
- Specified by:
getTransportConnectors
in interfaceBrokerViewMBean
-
getTransportConnectorByType
public String getTransportConnectorByType(String type)
- Specified by:
getTransportConnectorByType
in interfaceBrokerViewMBean
-
getVMURL
public String getVMURL()
- Specified by:
getVMURL
in interfaceBrokerViewMBean
-
getDataDirectory
public String getDataDirectory()
- Specified by:
getDataDirectory
in interfaceBrokerViewMBean
-
getJMSJobScheduler
public ObjectName getJMSJobScheduler()
- Specified by:
getJMSJobScheduler
in interfaceBrokerViewMBean
-
setJMSJobScheduler
public void setJMSJobScheduler(ObjectName name)
-
isSlave
public boolean isSlave()
- Specified by:
isSlave
in interfaceBrokerViewMBean
-
-