mirror of https://github.com/apache/activemq.git
use the standard JMX quote method when creating JMX names
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@356559 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e73312534d
commit
a558fef374
|
@ -65,7 +65,7 @@ public class ManagedRegionBroker extends RegionBroker {
|
|||
|
||||
// Build the object name for the destination
|
||||
Hashtable map = new Hashtable(brokerObjectName.getKeyPropertyList());
|
||||
map.put("Type",destName.getDestinationTypeAsString());
|
||||
map.put("Type",ObjectName.quote(destName.getDestinationTypeAsString()));
|
||||
map.put("Destination", JMXSupport.encodeObjectNamePart(destName.getPhysicalName()));
|
||||
ObjectName destObjectName= new ObjectName(brokerObjectName.getDomain(), map);
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class ManagedRegionBroker extends RegionBroker {
|
|||
public void unregister(ActiveMQDestination destName) throws Throwable {
|
||||
// Build the object name for the destination
|
||||
Hashtable map = new Hashtable(brokerObjectName.getKeyPropertyList());
|
||||
map.put("Type",destName.getDestinationTypeAsString());
|
||||
map.put("Type",ObjectName.quote(destName.getDestinationTypeAsString()));
|
||||
map.put("Destination", JMXSupport.encodeObjectNamePart(destName.getPhysicalName()));
|
||||
ObjectName destObjectName= new ObjectName(brokerObjectName.getDomain(), map);
|
||||
|
||||
|
|
|
@ -115,8 +115,7 @@ public class ManagedTransportConnection extends TransportConnection {
|
|||
// Build the object name for the destination
|
||||
Hashtable map = new Hashtable(connectorName.getKeyPropertyList());
|
||||
map.put("Type", "Connection");
|
||||
// lets avoid any JMX sensitive characters
|
||||
String jmxConnectionId = connectionId.replace(':', '_');
|
||||
String jmxConnectionId = ObjectName.quote(connectionId);
|
||||
map.put("Connection", jmxConnectionId);
|
||||
try {
|
||||
return new ObjectName(connectorName.getDomain(), map);
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
package org.activemq.util;
|
||||
|
||||
import javax.management.ObjectName;
|
||||
|
||||
public class JMXSupport {
|
||||
static public String encodeObjectNamePart(String part) {
|
||||
return ObjectName.quote(part);
|
||||
/*
|
||||
String answer = part.replaceAll("[\\:\\,\\'\\\"]", "_");
|
||||
answer = answer.replaceAll("\\?", "&qe;");
|
||||
answer = answer.replaceAll("=", "&");
|
||||
return answer;
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue