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.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1499141 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2013-07-02 22:54:20 +00:00
parent 34f3329370
commit d2836d1362
1 changed files with 7 additions and 1 deletions

View File

@ -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 extends BrokerFacadeSupport {
}
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 {