activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQ-4526 - prevent JMX restart if restartAllowed=false
Date Fri, 31 Jan 2014 11:26:53 GMT
Updated Branches:
  refs/heads/trunk d36e3c0e9 -> d4d985503


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


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/d4d98550
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/d4d98550
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/d4d98550

Branch: refs/heads/trunk
Commit: d4d985503e79334b45cc13d5757a47a7afbb68da
Parents: d36e3c0
Author: Dejan Bosanac <dejan@nighttale.net>
Authored: Fri Jan 31 12:26:20 2014 +0100
Committer: Dejan Bosanac <dejan@nighttale.net>
Committed: Fri Jan 31 12:26:41 2014 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/activemq/broker/jmx/BrokerView.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/d4d98550/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
index f0c92c3..b0ddf70 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
@@ -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


Mime
View raw message