activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1499141 - /activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/RemoteJMXBrokerFacade.java
Date Tue, 02 Jul 2013 22:54:21 GMT
Author: chirino
Date: Tue Jul  2 22:54:20 2013
New Revision: 1499141

URL: http://svn.apache.org/r1499141
Log:
Applying patch and fix for AMQ-3303: Standalone web console crashes when accessing broker
via master-slave failover.

Patch supplied by Arnaud BRAND.  Many thanks!  Fix confirmed by Jamie Goodyear.

Modified:
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/RemoteJMXBrokerFacade.java

Modified: activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/RemoteJMXBrokerFacade.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/RemoteJMXBrokerFacade.java?rev=1499141&r1=1499140&r2=1499141&view=diff
==============================================================================
--- activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/RemoteJMXBrokerFacade.java
(original)
+++ activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/RemoteJMXBrokerFacade.java
Tue Jul  2 22:54:20 2013
@@ -20,6 +20,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -204,7 +205,12 @@ public class RemoteJMXBrokerFacade exten
 		}
 
 		Set<ObjectName> brokers = connection.queryNames(name, null);
-		return brokers;
+		Set<ObjectName> masterBrokers = new HashSet<ObjectName>();
+		for (ObjectName objectName : brokers) {
+			BrokerViewMBean mbean = (BrokerViewMBean)MBeanServerInvocationHandler.newProxyInstance(connection,
objectName, BrokerViewMBean.class, true);
+			if (!mbean.isSlave()) masterBrokers.add(objectName);
+		}
+		return masterBrokers;
 	}
 	
 	public void purgeQueue(ActiveMQDestination destination) throws Exception {



Mime
View raw message