activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johndam...@apache.org
Subject [2/5] activemq-artemis git commit: ARTEMIS-601 Highlighting reload events with log.info
Date Wed, 10 Aug 2016 23:56:14 GMT
ARTEMIS-601 Highlighting reload events with log.info


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

Branch: refs/heads/master
Commit: 3099c4bd8c239eedda329eac0bffdbf651189e68
Parents: 53bb3ea
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Wed Aug 10 17:34:55 2016 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Aug 10 18:37:53 2016 -0400

----------------------------------------------------------------------
 .../activemq/artemis/jms/server/impl/JMSServerManagerImpl.java  | 3 +++
 .../activemq/artemis/core/server/ActiveMQServerLogger.java      | 5 +++++
 .../activemq/artemis/core/server/impl/ActiveMQServerImpl.java   | 2 ++
 .../activemq/artemis/core/server/reload/ReloadManagerImpl.java  | 3 ++-
 4 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3099c4bd/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 364bb75..ce9a27c 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
@@ -56,6 +56,7 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.security.Role;
 import org.apache.activemq.artemis.core.server.ActivateCallback;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
 import org.apache.activemq.artemis.core.server.PostQueueCreationCallback;
 import org.apache.activemq.artemis.core.server.PostQueueDeletionCallback;
 import org.apache.activemq.artemis.core.server.Queue;
@@ -1761,6 +1762,8 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
    private final class JMSReloader implements ReloadCallback {
       @Override
       public void reload(URL url) throws Exception {
+         ActiveMQServerLogger.LOGGER.reloadingConfiguration("jms");
+
          InputStream input = url.openStream();
          Reader reader = new InputStreamReader(input);
          String xml = XMLUtil.readerToString(reader);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3099c4bd/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
index 663c15c..7ff773b 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
@@ -328,6 +328,11 @@ public interface ActiveMQServerLogger extends BasicLogger {
       format = Message.Format.MESSAGE_FORMAT)
    void removingBackupData(String path);
 
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221056, value = "Reloading configuration ...{0}",
+      format = Message.Format.MESSAGE_FORMAT)
+   void reloadingConfiguration(String module);
+
    @LogMessage(level = Logger.Level.WARN)
    @Message(id = 222000, value = "ActiveMQServer is being finalized and has not been stopped.
Please remember to stop the server before letting it go out of scope",
       format = Message.Format.MESSAGE_FORMAT)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3099c4bd/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 7edd985..3b86c22 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
@@ -2373,7 +2373,9 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       @Override
       public void reload(URL uri) throws Exception {
          Configuration config = new FileConfigurationParser().parseMainConfig(uri.openStream());
+         ActiveMQServerLogger.LOGGER.reloadingConfiguration("security");
          securityRepository.swap(config.getSecurityRoles().entrySet());
+         ActiveMQServerLogger.LOGGER.reloadingConfiguration("address settings");
          addressSettingsRepository.swap(config.getAddressesSettings().entrySet());
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3099c4bd/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java
index 0ccbea1..a735b93 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java
@@ -121,12 +121,13 @@ public class ReloadManagerImpl implements ReloadManager {
    class ReloadRegistry {
       private final File file;
       private final URL uri;
-      private volatile long lastModified;
+      private long lastModified;
 
       private final List<ReloadCallback> callbacks = new LinkedList<>();
 
       ReloadRegistry(URL uri) {
          this.file = new File(uri.getPath());
+         this.lastModified = file.lastModified();
          this.uri = uri;
       }
 


Mime
View raw message