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:
Gary Tully 2008-09-09 10:05:32 +00:00
parent db4ed3fb35
commit a38e372ef4
3 changed files with 7 additions and 0 deletions

View File

@ -151,6 +151,10 @@ public class BrokerView implements BrokerViewMBean {
return brokerService.isPersistent();
}
public boolean isSlave() {
return brokerService.isSlave();
}
public void terminateJVM(int exitCode) {
System.exit(exitCode);
}

View File

@ -81,6 +81,8 @@ public interface BrokerViewMBean extends Service {
boolean isPersistent();
boolean isSlave();
/**
* Shuts down the JVM.
*

View File

@ -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");