activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martyntay...@apache.org
Subject [1/2] activemq-6 git commit: improved logging on Netty Acceptor
Date Fri, 27 Feb 2015 11:38:27 GMT
Repository: activemq-6
Updated Branches:
  refs/heads/master a895bf334 -> 5079dfd64


improved logging on Netty Acceptor


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

Branch: refs/heads/master
Commit: 695c1cd46c862357f48dfebc7bc9852963a34aa4
Parents: a895bf3
Author: Andy Taylor <andytaylor@apache.org>
Authored: Thu Feb 26 15:22:52 2015 +0000
Committer: Martyn Taylor <mtaylor@redhat.com>
Committed: Fri Feb 27 11:13:37 2015 +0000

----------------------------------------------------------------------
 .../core/remoting/impl/netty/NettyAcceptor.java | 23 +++++++++++++++++++-
 .../core/server/ActiveMQServerLogger.java       |  4 ++--
 2 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/695c1cd4/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyAcceptor.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyAcceptor.java
b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyAcceptor.java
index d135209..47f64c0 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyAcceptor.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyAcceptor.java
@@ -96,6 +96,8 @@ public class NettyAcceptor implements Acceptor
       // Disable resource leak detection for performance reasons by default
       ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED);
    }
+   //just for debug
+   private final String protocolsString;
 
    private final String name;
 
@@ -206,6 +208,8 @@ public class NettyAcceptor implements Acceptor
 
       this.protocolHandler = new ProtocolHandler(protocolMap, this, configuration, scheduledThreadPool);
 
+      this.protocolsString = getProtocols(protocolMap);
+
       host = ConfigurationHelper.getStringProperty(TransportConstants.HOST_PROP_NAME,
                                                    TransportConstants.DEFAULT_HOST,
                                                    configuration);
@@ -478,7 +482,7 @@ public class NettyAcceptor implements Acceptor
                                                                             TimeUnit.MILLISECONDS);
          }
 
-         ActiveMQServerLogger.LOGGER.startedNettyAcceptor(TransportConstants.NETTY_VERSION,
host, port);
+         ActiveMQServerLogger.LOGGER.startedNettyAcceptor(TransportConstants.NETTY_VERSION,
host, port, protocolsString);
       }
    }
 
@@ -666,6 +670,23 @@ public class NettyAcceptor implements Acceptor
       return new ActiveMQServerChannelHandler(channelGroup, handler, new Listener());
    }
 
+   private static String getProtocols(Map<String, ProtocolManager> protocolManager)
+   {
+      StringBuilder sb = new StringBuilder();
+      if (protocolManager != null)
+      {
+         Set<String> strings = protocolManager.keySet();
+         for (String string : strings)
+         {
+            if (sb.length() > 0)
+            {
+               sb.append(",");
+            }
+            sb.append(string);
+         }
+      }
+      return sb.toString();
+   }
    // Inner classes -----------------------------------------------------------------------------
 
    private final class ActiveMQServerChannelHandler extends ActiveMQChannelHandler implements
ConnectionCreator

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/695c1cd4/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServerLogger.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServerLogger.java
b/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServerLogger.java
index 7d6889d..bb6a269 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServerLogger.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServerLogger.java
@@ -167,8 +167,8 @@ public interface ActiveMQServerLogger extends BasicLogger
    void journalUnreferencedMessage(Long messageID);
 
    @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221020, value = "Started Netty Acceptor version {0} {1}:{2,number,#}", format
= Message.Format.MESSAGE_FORMAT)
-   void startedNettyAcceptor(String id, String host, Integer port);
+   @Message(id = 221020, value = "Started Netty Acceptor version {0} {1}:{2,number,#} for
protocols [{3}]", format = Message.Format.MESSAGE_FORMAT)
+   void startedNettyAcceptor(String id, String host, Integer port, String enabledProtocols);
 
    @LogMessage(level = Logger.Level.INFO)
    @Message(id = 221021, value = "failed to remove connection", format = Message.Format.MESSAGE_FORMAT)


Mime
View raw message