mirror of https://github.com/apache/activemq.git
AMQ-984, add isSlave jmx attribute to broker mbean
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@693414 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
db4ed3fb35
commit
a38e372ef4
|
@ -151,6 +151,10 @@ public class BrokerView implements BrokerViewMBean {
|
||||||
return brokerService.isPersistent();
|
return brokerService.isPersistent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSlave() {
|
||||||
|
return brokerService.isSlave();
|
||||||
|
}
|
||||||
|
|
||||||
public void terminateJVM(int exitCode) {
|
public void terminateJVM(int exitCode) {
|
||||||
System.exit(exitCode);
|
System.exit(exitCode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,8 @@ public interface BrokerViewMBean extends Service {
|
||||||
|
|
||||||
boolean isPersistent();
|
boolean isPersistent();
|
||||||
|
|
||||||
|
boolean isSlave();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shuts down the JVM.
|
* Shuts down the JVM.
|
||||||
*
|
*
|
||||||
|
|
|
@ -424,6 +424,7 @@ public class MBeanTest extends EmbeddedBrokerTestSupport {
|
||||||
ObjectName brokerName = assertRegisteredObjectName(domain + ":Type=Broker,BrokerName=localhost");
|
ObjectName brokerName = assertRegisteredObjectName(domain + ":Type=Broker,BrokerName=localhost");
|
||||||
BrokerViewMBean broker = (BrokerViewMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer, brokerName, BrokerViewMBean.class, true);
|
BrokerViewMBean broker = (BrokerViewMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer, brokerName, BrokerViewMBean.class, true);
|
||||||
|
|
||||||
|
assertTrue("broker is not a slave", !broker.isSlave());
|
||||||
// create 2 topics
|
// create 2 topics
|
||||||
broker.addTopic(getDestinationString() + "1");
|
broker.addTopic(getDestinationString() + "1");
|
||||||
broker.addTopic(getDestinationString() + "2");
|
broker.addTopic(getDestinationString() + "2");
|
||||||
|
|
Loading…
Reference in New Issue