activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1434926 - /activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerMBeanSupport.java
Date Thu, 17 Jan 2013 21:43:11 GMT
Author: tabish
Date: Thu Jan 17 21:43:10 2013
New Revision: 1434926

URL: http://svn.apache.org/viewvc?rev=1434926&view=rev
Log:
Add some methods for creating destination queries 

Modified:
    activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerMBeanSupport.java

Modified: activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerMBeanSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerMBeanSupport.java?rev=1434926&r1=1434925&r2=1434926&view=diff
==============================================================================
--- activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerMBeanSupport.java
(original)
+++ activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerMBeanSupport.java
Thu Jan 17 21:43:10 2013
@@ -220,12 +220,36 @@ public class BrokerMBeanSupport {
     // MBean Query Creation
 
     public static ObjectName createConnectionQuery(String jmxDomainName, String brokerName,
String name) throws MalformedObjectNameException {
-        return new ObjectName(jmxDomainName + ":type=Broker,brokerName="
-                              + JMXSupport.encodeObjectNamePart(brokerName) + ","
+        ObjectName brokerMBeanName = createBrokerObjectName(jmxDomainName, brokerName);
+        return createConnectionQuery(brokerMBeanName.toString(), name);
+    }
+
+    public static ObjectName createConnectionQuery(String brokerMBeanName, String name) throws
MalformedObjectNameException {
+        return new ObjectName(brokerMBeanName + ","
                               + "connector=*," + "connectorName=*," + "connectionViewType=*,"
                               + "connectionName=" + JMXSupport.encodeObjectNamePart(name));
     }
 
+    public static ObjectName createQueueQuery(String brokerMBeanName) throws MalformedObjectNameException
{
+        return createConnectionQuery(brokerMBeanName, "*");
+    }
+
+    public static ObjectName createQueueQuery(String brokerMBeanName, String destinationName)
throws MalformedObjectNameException {
+        return new ObjectName(brokerMBeanName + ","
+                              + "destinationType=Queue,"
+                              + "destinationName=" + JMXSupport.encodeObjectNamePart(destinationName));
+    }
+
+    public static ObjectName createTopicQuery(String brokerMBeanName) throws MalformedObjectNameException
{
+        return createConnectionQuery(brokerMBeanName, "*");
+    }
+
+    public static ObjectName createTopicQuery(String brokerMBeanName, String destinationName)
throws MalformedObjectNameException {
+        return new ObjectName(brokerMBeanName + ","
+                              + "destinationType=Topic,"
+                              + "destinationName=" + JMXSupport.encodeObjectNamePart(destinationName));
+    }
+
     public static ObjectName createConsumerQueury(String jmxDomainName, String clientId)
throws MalformedObjectNameException {
         return createConsumerQueury(jmxDomainName, null, clientId);
     }



Mime
View raw message