Add some methods for creating destination queries

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1434926 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2013-01-17 21:43:10 +00:00
parent 1cd3bd8d95
commit 5d4d7487e4
1 changed files with 26 additions and 2 deletions

View File

@ -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);
}