diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java index b2321ff6e1..9dd45df515 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java @@ -150,6 +150,10 @@ public class BrokerView implements BrokerViewMBean { public boolean isPersistent() { return brokerService.isPersistent(); } + + public boolean isSlave() { + return brokerService.isSlave(); + } public void terminateJVM(int exitCode) { System.exit(exitCode); diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java index 6589489aa5..c0e21b0b0a 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java @@ -80,6 +80,8 @@ public interface BrokerViewMBean extends Service { void setTempLimit(long limit); boolean isPersistent(); + + boolean isSlave(); /** * Shuts down the JVM. diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java index 846c2d8099..be0c99cd42 100644 --- a/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java @@ -424,6 +424,7 @@ public class MBeanTest extends EmbeddedBrokerTestSupport { ObjectName brokerName = assertRegisteredObjectName(domain + ":Type=Broker,BrokerName=localhost"); BrokerViewMBean broker = (BrokerViewMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer, brokerName, BrokerViewMBean.class, true); + assertTrue("broker is not a slave", !broker.isSlave()); // create 2 topics broker.addTopic(getDestinationString() + "1"); broker.addTopic(getDestinationString() + "2");