From d724f9ed4d85d398dd5fe4b44157ca7c5ec2afba Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Thu, 6 Apr 2006 19:15:29 +0000 Subject: [PATCH] Group the connections using the connector name that they were created from. git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@392043 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/broker/BrokerService.java | 20 ++++++++++--------- .../jmx/ManagedTransportConnection.java | 3 ++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java index 021da94c73..62ac019bab 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java @@ -773,16 +773,10 @@ public class BrokerService implements Service, Serializable { } - protected void registerConnectorMBean(TransportConnector connector) throws IOException, URISyntaxException { + protected void registerConnectorMBean(TransportConnector connector, ObjectName objectName) throws IOException, URISyntaxException { MBeanServer mbeanServer = getManagementContext().getMBeanServer(); ConnectorViewMBean view = new ConnectorView(connector); try { - ObjectName objectName = new ObjectName( - managementContext.getJmxDomainName()+":"+ - "BrokerName="+JMXSupport.encodeObjectNamePart(getBrokerName())+","+ - "Type=Connector,"+ - "ConnectorName="+JMXSupport.encodeObjectNamePart(connector.getName()) - ); mbeanServer.registerMBean(view, objectName); registeredMBeanNames.add(objectName); } @@ -1088,8 +1082,16 @@ public class BrokerService implements Service, Serializable { } if (isUseJmx()) { - connector = connector.asManagedConnector(getManagementContext().getMBeanServer(), getBrokerObjectName()); - registerConnectorMBean(connector); + + ObjectName objectName = new ObjectName( + managementContext.getJmxDomainName()+":"+ + "BrokerName="+JMXSupport.encodeObjectNamePart(getBrokerName())+","+ + "Type=Connector,"+ + "ConnectorName="+JMXSupport.encodeObjectNamePart(connector.getName()) + ); + + connector = connector.asManagedConnector(getManagementContext().getMBeanServer(), objectName); + registerConnectorMBean(connector, objectName); } connector.start(); } diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java index e3e44f9b61..34a3682e91 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java @@ -117,8 +117,9 @@ public class ManagedTransportConnection extends TransportConnection { try { return new ObjectName( connectorName.getDomain()+":"+ - "BrokerName="+map.get("BrokerName")+","+ + "BrokerName="+JMXSupport.encodeObjectNamePart((String) map.get("BrokerName"))+","+ "Type=Connection,"+ + "ConnectorName="+JMXSupport.encodeObjectNamePart((String) map.get("ConnectorName"))+","+ "Connection="+JMXSupport.encodeObjectNamePart(connectionId) ); }