activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-297 Including acceptor name on logs
Date Thu, 05 Nov 2015 16:06:16 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master d585d465b -> 4dfe81d4d


ARTEMIS-297 Including acceptor name on logs


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

Branch: refs/heads/master
Commit: 9a2bebe443528d0e6d00ea2a9cd6509fe406b91a
Parents: d585d46
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Wed Nov 4 22:48:55 2015 -0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Nov 4 22:54:12 2015 -0500

----------------------------------------------------------------------
 .../artemis/core/remoting/impl/invm/InVMAcceptor.java   | 12 +++++++++++-
 .../core/remoting/impl/invm/InVMAcceptorFactory.java    |  2 +-
 .../artemis/core/remoting/impl/netty/NettyAcceptor.java |  4 ++++
 .../core/remoting/server/impl/RemotingServiceImpl.java  |  6 +++---
 .../artemis/core/server/ActiveMQServerLogger.java       |  4 ++--
 .../activemq/artemis/spi/core/remoting/Acceptor.java    |  4 ++++
 .../artemis/tests/unit/core/remoting/AcceptorsTest.java |  3 ++-
 .../remoting/server/impl/fake/FakeAcceptorFactory.java  |  4 ++++
 8 files changed, 31 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9a2bebe4/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
index a603365..f6a00be 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
@@ -66,11 +66,17 @@ public final class InVMAcceptor implements Acceptor {
 
    private final long connectionsAllowed;
 
-   public InVMAcceptor(final ClusterConnection clusterConnection,
+   private final String name;
+
+   public InVMAcceptor(final String name,
+                       final ClusterConnection clusterConnection,
                        final Map<String, Object> configuration,
                        final BufferHandler handler,
                        final ConnectionLifeCycleListener listener,
                        final Executor threadPool) {
+
+      this.name = name;
+
       this.clusterConnection = clusterConnection;
 
       this.configuration = configuration;
@@ -86,6 +92,10 @@ public final class InVMAcceptor implements Acceptor {
       connectionsAllowed = ConfigurationHelper.getLongProperty(TransportConstants.CONNECTIONS_ALLOWED,
TransportConstants.DEFAULT_CONNECTIONS_ALLOWED, configuration);
    }
 
+   public String getName() {
+      return name;
+   }
+
    public Map<String, Object> getConfiguration() {
       return configuration;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9a2bebe4/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptorFactory.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptorFactory.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptorFactory.java
index e227bce..49de7e9 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptorFactory.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptorFactory.java
@@ -37,6 +37,6 @@ public class InVMAcceptorFactory implements AcceptorFactory {
                                   final Executor threadPool,
                                   final ScheduledExecutorService scheduledThreadPool,
                                   final Map<String, ProtocolManager> protocolHandler)
{
-      return new InVMAcceptor(clusterConnection, configuration, handler, listener, threadPool);
+      return new InVMAcceptor(name, clusterConnection, configuration, handler, listener,
threadPool);
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9a2bebe4/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
index 62e93bd..9905ca1 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
@@ -411,6 +411,10 @@ public class NettyAcceptor implements Acceptor {
       }
    }
 
+   public String getName() {
+      return name;
+   }
+
    /**
     * Transfers the Netty channel that has been created outside of this NettyAcceptor
     * to control it and configure it according to this NettyAcceptor setting.

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9a2bebe4/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
index d3bfdb1..b2bca01 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
@@ -304,7 +304,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
             acceptor.pause();
          }
          catch (Exception e) {
-            ActiveMQServerLogger.LOGGER.errorStoppingAcceptor();
+            ActiveMQServerLogger.LOGGER.errorStoppingAcceptor(acceptor.getName());
          }
       }
    }
@@ -351,7 +351,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
             acceptor.pause();
          }
          catch (Throwable t) {
-            ActiveMQServerLogger.LOGGER.errorStoppingAcceptor();
+            ActiveMQServerLogger.LOGGER.errorStoppingAcceptor(acceptor.getName());
          }
 
       }
@@ -379,7 +379,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
             acceptor.stop();
          }
          catch (Throwable t) {
-            ActiveMQServerLogger.LOGGER.errorStoppingAcceptor();
+            ActiveMQServerLogger.LOGGER.errorStoppingAcceptor(acceptor.getName());
          }
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9a2bebe4/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 be167ec..ab52191 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
@@ -1292,8 +1292,8 @@ public interface ActiveMQServerLogger extends BasicLogger {
    void errorWritingToInvmConnector(@Cause Exception e, Runnable runnable);
 
    @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224028, value = "Failed to stop acceptor", format = Message.Format.MESSAGE_FORMAT)
-   void errorStoppingAcceptor();
+   @Message(id = 224028, value = "Failed to stop accepto {0}r", format = Message.Format.MESSAGE_FORMAT)
+   void errorStoppingAcceptor(String name);
 
    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 224029, value = "large message sync: largeMessage instance is incompatible
with it, ignoring data", format = Message.Format.MESSAGE_FORMAT)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9a2bebe4/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Acceptor.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Acceptor.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Acceptor.java
index 517ea3c..dbd2618 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Acceptor.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Acceptor.java
@@ -29,6 +29,10 @@ import org.apache.activemq.artemis.core.server.management.NotificationService;
  */
 public interface Acceptor extends ActiveMQComponent {
 
+   /** The name of the acceptor used on the configuration.
+    *  for logging and debug purposes. */
+   String getName();
+
    /**
     * Pause the acceptor and stop it from receiving client requests.
     */

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9a2bebe4/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/AcceptorsTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/AcceptorsTest.java
b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/AcceptorsTest.java
index 88f02b2..f6aae80 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/AcceptorsTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/AcceptorsTest.java
@@ -24,6 +24,7 @@ import java.util.Set;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.tests.unit.core.remoting.server.impl.fake.FakeAcceptorFactory;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Test;
 
@@ -32,7 +33,7 @@ public class AcceptorsTest extends ActiveMQTestBase {
    @Test
    public void testMultipleAcceptorsWithSameHostPortDifferentName() throws Exception
    {
-      final String acceptorFactoryClass = "org.apache.activemq.artemis.tests.unit.core.remoting.server.impl.fake.FakeAcceptorFactory";
+      final String acceptorFactoryClass = FakeAcceptorFactory.class.getName();
 
       Map<String, Object> params = new HashMap<>();
       params.put("host", "localhost");

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9a2bebe4/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/server/impl/fake/FakeAcceptorFactory.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/server/impl/fake/FakeAcceptorFactory.java
b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/server/impl/fake/FakeAcceptorFactory.java
index 3ced505..f351dfb 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/server/impl/fake/FakeAcceptorFactory.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/server/impl/fake/FakeAcceptorFactory.java
@@ -47,6 +47,10 @@ public class FakeAcceptorFactory implements AcceptorFactory {
 
    private final class FakeAcceptor implements Acceptor {
 
+      public String getName() {
+         return "fake";
+      }
+
       @Override
       public void pause() {
 


Mime
View raw message