You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2016/08/11 22:27:16 UTC

[2/3] activemq-artemis git commit: ARTEMIS-601 Reload manager wasn't working with backups

ARTEMIS-601 Reload manager wasn't working with backups


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

Branch: refs/heads/master
Commit: c568a9774fdd4625ef4190d8a73d2f7c31f16bca
Parents: a53dd92
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Aug 11 17:24:37 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Aug 11 17:25:08 2016 -0400

----------------------------------------------------------------------
 .../java/org/apache/activemq/artemis/cli/Artemis.java  |  7 +++++++
 .../artemis/jms/server/impl/JMSServerManagerImpl.java  |  9 ++++-----
 .../artemis/core/server/impl/ActiveMQServerImpl.java   | 13 +++++++------
 3 files changed, 18 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c568a977/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
index 40b52bf..bd64b33 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
@@ -84,6 +84,13 @@ public class Artemis {
          System.err.println(cliException.getMessage());
          return cliException;
       }
+      catch (NullPointerException e) {
+         // Yeah.. I really meant System.err..
+         // this is the CLI and System.out and System.err are common places for interacting with the user
+         // this is a programming error that must be visualized and corrected
+         e.printStackTrace();
+         return e;
+      }
       catch (RuntimeException re) {
          System.err.println(re.getMessage());
          System.out.println();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c568a977/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
index ce9a27c..8e313a3 100644
--- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
+++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
@@ -274,6 +274,10 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
    @Override
    public void activationComplete() {
+      ReloadManager reloadManager = server.getReloadManager();
+      if (config != null && config.getConfigurationUrl() != null && reloadManager != null) {
+         reloadManager.addCallback(config.getConfigurationUrl(), new JMSReloader());
+      }
 
    }
 
@@ -406,11 +410,6 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
        */
       startCalled = true;
       server.start();
-      ReloadManager reloadManager = server.getReloadManager();
-      if (config != null && config.getConfigurationUrl() != null && reloadManager != null) {
-         reloadManager.addCallback(config.getConfigurationUrl(), new JMSReloader());
-      }
-
 
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c568a977/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 3b86c22..0d25271 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -461,12 +461,6 @@ public class ActiveMQServerImpl implements ActiveMQServer {
          // start connector service
          connectorsService = new ConnectorsService(configuration, storageManager, scheduledPool, postOffice, serviceRegistry);
          connectorsService.start();
-
-         this.reloadManager = new ReloadManagerImpl(getScheduledPool(), configuration.getConfigurationFileRefreshPeriod());
-
-         if (configuration.getConfigurationUrl() != null && getScheduledPool() != null) {
-            reloadManager.addCallback(configuration.getConfigurationUrl(), new ConfigurationFileReloader());
-         }
       }
       finally {
          // this avoids embedded applications using dirty contexts from startup
@@ -1952,6 +1946,13 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
       deployGroupingHandlerConfiguration(configuration.getGroupingHandlerConfiguration());
 
+      this.reloadManager = new ReloadManagerImpl(getScheduledPool(), configuration.getConfigurationFileRefreshPeriod());
+
+      if (configuration.getConfigurationUrl() != null && getScheduledPool() != null) {
+         reloadManager.addCallback(configuration.getConfigurationUrl(), new ConfigurationFileReloader());
+      }
+
+
       return true;
    }