https://issues.apache.org/jira/browse/AMQ-4526 - prevent JMX restart if restartAllowed=false

This commit is contained in:
Dejan Bosanac 2014-01-31 12:26:20 +01:00
parent d36e3c0e95
commit d4d985503e
1 changed files with 6 additions and 2 deletions

View File

@ -120,8 +120,12 @@ public class BrokerView implements BrokerViewMBean {
@Override
public void restart() throws Exception {
brokerService.requestRestart();
brokerService.stop();
if (brokerService.isRestartAllowed()) {
brokerService.requestRestart();
brokerService.stop();
} else {
throw new Exception("Restart is not allowed");
}
}
@Override