You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2015/08/31 08:31:03 UTC

svn commit: r1700208 - in /qpid/java/trunk: client/src/main/java/org/apache/qpid/client/transport/ common/src/main/java/org/apache/qpid/properties/ common/src/main/java/org/apache/qpid/transport/ common/src/main/java/org/apache/qpid/transport/network/i...

Author: kwall
Date: Mon Aug 31 06:31:02 2015
New Revision: 1700208

URL: http://svn.apache.org/r1700208
Log:
QPID-6720: Replace calls to o.a.q.t.Logger with direct calls to SLF4J

Removed:
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/util/Logger.java
Modified:
    qpid/java/trunk/client/src/main/java/org/apache/qpid/client/transport/ClientConnectionDelegate.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/properties/ConnectionStartProperties.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/Connection.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/Session.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/SessionDelegate.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLSender.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/QpidClientX509KeyManager.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLReceiver.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java
    qpid/java/trunk/common/src/test/java/org/apache/qpid/transport/network/io/IoTransport.java

Modified: qpid/java/trunk/client/src/main/java/org/apache/qpid/client/transport/ClientConnectionDelegate.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/client/src/main/java/org/apache/qpid/client/transport/ClientConnectionDelegate.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/client/src/main/java/org/apache/qpid/client/transport/ClientConnectionDelegate.java (original)
+++ qpid/java/trunk/client/src/main/java/org/apache/qpid/client/transport/ClientConnectionDelegate.java Mon Aug 31 06:31:02 2015
@@ -27,6 +27,8 @@ import org.ietf.jgss.GSSException;
 import org.ietf.jgss.GSSManager;
 import org.ietf.jgss.GSSName;
 import org.ietf.jgss.Oid;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import org.apache.qpid.client.security.AMQCallbackHandler;
 import org.apache.qpid.client.security.CallbackHandlerRegistry;
@@ -36,7 +38,6 @@ import org.apache.qpid.transport.Connect
 import org.apache.qpid.transport.ConnectionException;
 import org.apache.qpid.transport.ConnectionOpenOk;
 import org.apache.qpid.transport.ConnectionSettings;
-import org.apache.qpid.transport.util.Logger;
 import org.apache.qpid.util.Strings;
 
 import javax.security.sasl.Sasl;
@@ -51,7 +52,7 @@ import java.util.Map;
  */
 public class ClientConnectionDelegate extends ClientDelegate
 {
-    private static final Logger LOGGER = Logger.get(ClientDelegate.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(ClientConnectionDelegate.class);
 
     private static final String KRB5_OID_STR = "1.2.840.113554.1.2.2";
     protected static final Oid KRB5_OID;

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/properties/ConnectionStartProperties.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/properties/ConnectionStartProperties.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/properties/ConnectionStartProperties.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/properties/ConnectionStartProperties.java Mon Aug 31 06:31:02 2015
@@ -20,7 +20,9 @@
  */
 package org.apache.qpid.properties;
 
-import org.apache.qpid.transport.util.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.util.SystemUtils;
 
 /**
@@ -29,7 +31,7 @@ import org.apache.qpid.util.SystemUtils;
  */
 public class ConnectionStartProperties
 {
-    private static final Logger LOGGER = Logger.get(ConnectionStartProperties.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(ConnectionStartProperties.class);
 
     /**
      * Used for 0-8/0-9/0-9-1 connections to choose to close

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java Mon Aug 31 06:31:02 2015
@@ -30,10 +30,12 @@ import java.util.Map;
 import javax.security.sasl.SaslClient;
 import javax.security.sasl.SaslException;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.common.QpidProperties;
 import org.apache.qpid.configuration.ClientProperties;
 import org.apache.qpid.properties.ConnectionStartProperties;
-import org.apache.qpid.transport.util.Logger;
 
 
 /**
@@ -43,9 +45,7 @@ import org.apache.qpid.transport.util.Lo
 
 public class ClientDelegate extends ConnectionDelegate
 {
-    private static final Logger log = Logger.get(ClientDelegate.class);
-
-
+    private static final Logger LOGGER = LoggerFactory.getLogger(ClientDelegate.class);
 
     private final ConnectionSettings _connectionSettings;
 
@@ -206,7 +206,7 @@ public class ClientDelegate extends Conn
         int i = heartbeat;
         if (i == 0)
         {
-            log.info("Heartbeat interval is 0 sec. Heartbeats are disabled.");
+            LOGGER.info("Heartbeat interval is 0 sec. Heartbeats are disabled.");
             return 0; // heartbeats are disabled.
         }
         else if (i >= min && i <= max)
@@ -215,8 +215,8 @@ public class ClientDelegate extends Conn
         }
         else
         {
-            log.info("The broker does not support the configured connection heartbeat interval of %s sec," +
-                     " using the brokers max supported value of %s sec instead.", i,max);
+            LOGGER.info("The broker does not support the configured connection heartbeat interval of {} sec," +
+                     " using the brokers max supported value of {} sec instead.", i, max);
             return max;
         }
     }

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/Connection.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/Connection.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/Connection.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/Connection.java Mon Aug 31 06:31:02 2015
@@ -40,6 +40,9 @@ import java.util.concurrent.atomic.Atomi
 import javax.security.sasl.SaslClient;
 import javax.security.sasl.SaslServer;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.properties.ConnectionStartProperties;
 import org.apache.qpid.transport.network.Assembler;
 import org.apache.qpid.transport.network.Disassembler;
@@ -49,7 +52,6 @@ import org.apache.qpid.transport.network
 import org.apache.qpid.transport.network.io.IoNetworkTransport;
 import org.apache.qpid.transport.network.security.SecurityLayer;
 import org.apache.qpid.transport.network.security.SecurityLayerFactory;
-import org.apache.qpid.transport.util.Logger;
 import org.apache.qpid.transport.util.Waiter;
 import org.apache.qpid.util.Strings;
 
@@ -67,8 +69,7 @@ import org.apache.qpid.util.Strings;
 public class Connection extends ConnectionInvoker
     implements ProtocolEventReceiver, ProtocolEventSender
 {
-
-    protected static final Logger log = Logger.get(Connection.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(Connection.class);
 
     //Usable channels are numbered 0 to <ChannelMax> - 1
     public static final int MAX_CHANNEL_MAX = 0xFFFF;
@@ -392,9 +393,9 @@ public class Connection extends Connecti
     public void received(ProtocolEvent event)
     {
         _lastReadTime = System.currentTimeMillis();
-        if(log.isDebugEnabled())
+        if(LOGGER.isDebugEnabled())
         {
-            log.debug("RECV: [%s] %s", this, event);
+            LOGGER.debug("RECV: [{}] {}", this, String.valueOf(event));
         }
         event.delegate(this, delegate);
     }
@@ -402,9 +403,9 @@ public class Connection extends Connecti
     public void send(ProtocolEvent event)
     {
         _lastSendTime = System.currentTimeMillis();
-        if(log.isDebugEnabled())
+        if(LOGGER.isDebugEnabled())
         {
-            log.debug("SEND: [%s] %s", this, event);
+            LOGGER.debug("SEND: [{}] {}", this, String.valueOf(event));
         }
         ProtocolEventSender s = sender;
         if (s == null)
@@ -416,9 +417,9 @@ public class Connection extends Connecti
 
     public void flush()
     {
-        if(log.isDebugEnabled())
+        if(LOGGER.isDebugEnabled())
         {
-            log.debug("FLUSH: [%s]", this);
+            LOGGER.debug("FLUSH: [{}]", this);
         }
         final ProtocolEventSender theSender = sender;
         if(theSender != null)
@@ -451,9 +452,9 @@ public class Connection extends Connecti
              * A peer receiving any other control on a detached transport MUST discard it and
              * send a session.detached with the "not-attached" reason code.
              */
-            if(log.isDebugEnabled())
+            if(LOGGER.isDebugEnabled())
             {
-                log.debug("Control received on unattached channel : %d", channel);
+                LOGGER.debug("Control received on unattached channel : {}", channel);
             }
             invokeSessionDetached(channel, SessionDetachCode.NOT_ATTACHED);
         }
@@ -572,7 +573,7 @@ public class Connection extends Connecti
             exception(new ConnectionException("connection aborted"));
         }
 
-        log.debug("connection closed: %s", this);
+        LOGGER.debug("connection closed: {}", this);
 
         synchronized (lock)
         {
@@ -795,7 +796,7 @@ public class Connection extends Connecti
         @Override
         public void readerIdle()
         {
-            log.error("Closing connection as no heartbeat or other activity detected within specified interval");
+            LOGGER.error("Closing connection as no heartbeat or other activity detected within specified interval");
             _networkConnection.close();
         }
     }

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java Mon Aug 31 06:31:02 2015
@@ -20,10 +20,11 @@
  */
 package org.apache.qpid.transport;
 
-import org.apache.qpid.transport.util.Logger;
-
 import static org.apache.qpid.transport.Connection.State.CLOSE_RCVD;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 
 /**
  * ConnectionDelegate
@@ -42,7 +43,7 @@ public abstract class ConnectionDelegate
     implements ProtocolDelegate<Connection>
 {
 
-    private static final Logger log = Logger.get(ConnectionDelegate.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(ConnectionDelegate.class);
 
     public void control(Connection conn, Method method)
     {

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/Session.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/Session.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/Session.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/Session.java Mon Aug 31 06:31:02 2015
@@ -23,7 +23,6 @@ package org.apache.qpid.transport;
 
 import org.apache.qpid.configuration.ClientProperties;
 import org.apache.qpid.transport.network.Frame;
-import org.apache.qpid.transport.util.Logger;
 import org.apache.qpid.transport.util.Waiter;
 import static org.apache.qpid.transport.Option.COMPLETED;
 import static org.apache.qpid.transport.Option.SYNC;
@@ -44,11 +43,13 @@ import static org.apache.qpid.util.Strin
 import java.nio.ByteBuffer;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.TreeMap;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * Session
  *
@@ -57,7 +58,7 @@ import java.util.concurrent.atomic.Atomi
 
 public class Session extends SessionInvoker
 {
-    private static final Logger log = Logger.get(Session.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(Session.class);
 
     public enum State { NEW, DETACHED, RESUMING, OPEN, CLOSING, CLOSED }
 
@@ -70,12 +71,12 @@ public class Session extends SessionInvo
 
         public void message(Session ssn, MessageTransfer xfr)
         {
-            log.info("message: %s", xfr);
+            LOGGER.info("message: {}", xfr);
         }
 
         public void exception(Session ssn, SessionException exc)
         {
-            log.error(exc, "session exception");
+            LOGGER.error("session exception", exc);
         }
 
         public void closed(Session ssn) {}
@@ -255,13 +256,13 @@ public class Session extends SessionInvo
                 while(totalWait <= blockedSendTimeout && !credit.tryAcquire(wait, TimeUnit.MILLISECONDS))
                 {
                     totalWait+=wait;
-                    log.warn("Message send delayed by " + (totalWait)/1000 + "s due to broker enforced flow control");
+                    LOGGER.warn("Message send delayed by {}s due to broker enforced flow control", (totalWait) / 1000);
 
 
                 }
                 if(totalWait > blockedSendTimeout)
                 {
-                    log.error("Message send failed due to timeout waiting on broker enforced flow control");
+                    LOGGER.error("Message send failed due to timeout waiting on broker enforced flow control");
                     throw new SessionException
                             ("timed out waiting for message credit");
                 }
@@ -370,21 +371,6 @@ public class Session extends SessionInvo
         return commands.remove(id);
     }
 
-    void dump()
-    {
-        synchronized (commandsLock)
-        {
-            TreeMap<Integer, Method> ordered = new TreeMap<Integer, Method>(commands);
-            for (Method m : ordered.values())
-            {
-                if (m != null)
-                {
-                    log.debug("%s", m);
-                }
-            }
-        }
-    }
-
     final void commandPoint(int id)
     {
         synchronized (processedLock)
@@ -424,9 +410,9 @@ public class Session extends SessionInvo
         int id = nextCommandId();
         cmd.setId(id);
 
-        if(log.isDebugEnabled())
+        if(LOGGER.isDebugEnabled())
         {
-            log.debug("identify: ch=%s, commandId=%s", this.channel, id);
+            LOGGER.debug("identify: ch={}, commandId={}", this.channel, id);
         }
 
         if ((id & 0xff) == 0)
@@ -453,17 +439,17 @@ public class Session extends SessionInvo
 
     public void processed(int lower, int upper)
     {
-        if(log.isDebugEnabled())
+        if(LOGGER.isDebugEnabled())
         {
-            log.debug("%s ch=%s processed([%d,%d]) %s %s", this, channel, lower, upper, syncPoint, maxProcessed);
+            LOGGER.debug("{} ch={} processed([{},{}]) {} {}", new Object[] {this, channel, lower, upper, syncPoint, maxProcessed});
         }
 
         boolean flush;
         synchronized (processedLock)
         {
-            if(log.isDebugEnabled())
+            if(LOGGER.isDebugEnabled())
             {
-                log.debug("%s processed: %s", this, processed);
+                LOGGER.debug("{} processed: {}", this, processed);
             }
 
             if (ge(upper, commandsIn))
@@ -544,7 +530,7 @@ public class Session extends SessionInvo
     void syncPoint()
     {
         int id = getCommandsIn() - 1;
-        log.debug("%s synced to %d", this, id);
+        LOGGER.debug("{} synced to {}", this, id);
         boolean flush;
         synchronized (processedLock)
         {
@@ -560,9 +546,9 @@ public class Session extends SessionInvo
     protected boolean complete(int lower, int upper)
     {
         //avoid autoboxing
-        if(log.isDebugEnabled())
+        if(LOGGER.isDebugEnabled())
         {
-            log.debug("%s complete(%d, %d)", this, lower, upper);
+            LOGGER.debug("{} complete({}, {})", new Object[] {this, lower, upper});
         }
         synchronized (commandsLock)
         {
@@ -581,9 +567,9 @@ public class Session extends SessionInvo
                 maxComplete = max(maxComplete, upper);
             }
 
-            if(log.isDebugEnabled())
+            if(LOGGER.isDebugEnabled())
             {
-                log.debug("%s   commands remaining: %s", this, commandsOut - maxComplete);
+                LOGGER.debug("{}   commands remaining: {}", this, commandsOut - maxComplete);
             }
 
             commandsLock.notifyAll();
@@ -716,7 +702,7 @@ public class Session extends SessionInvo
                                 {
                                     // if expiry is > 0 then this will
                                     // happen again on resume
-                                    log.error(e, "error sending flush (full replay buffer)");
+                                    LOGGER.error("error sending flush (full replay buffer)", e);
                                 }
                                 else
                                 {
@@ -777,7 +763,7 @@ public class Session extends SessionInvo
                     {
                         // if we are not closing then this will happen
                         // again on resume
-                        log.error(e, "error sending command");
+                        LOGGER.error("error sending command", e);
                     }
                     else
                     {
@@ -803,7 +789,7 @@ public class Session extends SessionInvo
                         {
                             // if expiry is > 0 then this will happen
                             // again on resume
-                            log.error(e, "error sending flush (periodic)");
+                            LOGGER.error("error sending flush (periodic)", e);
                         }
                         else
                         {
@@ -839,7 +825,7 @@ public class Session extends SessionInvo
 
     public void sync(long timeout)
     {
-        log.debug("%s sync()", this);
+        LOGGER.debug("{} sync()", this);
         synchronized (commandsLock)
         {
             int point = commandsOut - 1;
@@ -853,9 +839,9 @@ public class Session extends SessionInvo
             while (w.hasTime() && state != CLOSED && lt(maxComplete, point))
             {
                 checkFailoverRequired("Session sync was interrupted by failover.");
-                if(log.isDebugEnabled())
+                if(LOGGER.isDebugEnabled())
                 {
-                    log.debug("%s   waiting for[%d]: %d, %s", this, point, maxComplete, commands);
+                    LOGGER.debug("{}   waiting for[{}]: {}, {}", new Object[] {this, point, maxComplete, commands});
                 }
                 w.await();
             }
@@ -897,9 +883,9 @@ public class Session extends SessionInvo
         }
         else
         {
-            log.warn("Received a response to a command" +
-            		" that's no longer valid on the client side." +
-            		" [ command id : %s , result : %s ]",command, result);
+            LOGGER.warn("Received a response to a command" +
+                     " that's no longer valid on the client side." +
+                     " [ command id : {} , result : {} ]", command, result);
         }
     }
 
@@ -967,7 +953,7 @@ public class Session extends SessionInvo
                 while (w.hasTime() && state != CLOSED && !isDone())
                 {
                     checkFailoverRequired("Operation was interrupted by failover.");
-                    log.debug("%s waiting for result: %s", Session.this, this);
+                    LOGGER.debug("{} waiting for result: {}", Session.this, this);
                     w.await();
                 }
             }
@@ -1032,9 +1018,9 @@ public class Session extends SessionInvo
 
     public void close()
     {
-        if (log.isDebugEnabled())
+        if (LOGGER.isDebugEnabled())
         {
-            log.debug("Closing [%s] in state [%s]", this, state);
+            LOGGER.debug("Closing [{}] in state [{}]", this, state);
         }
         synchronized (commandsLock)
         {
@@ -1075,7 +1061,7 @@ public class Session extends SessionInvo
 
     public void exception(Throwable t)
     {
-        log.error(t, "caught exception");
+        LOGGER.error("caught exception", t);
     }
 
     public void closed()

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/SessionDelegate.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/SessionDelegate.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/SessionDelegate.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/SessionDelegate.java Mon Aug 31 06:31:02 2015
@@ -20,7 +20,9 @@
  */
 package org.apache.qpid.transport;
 
-import org.apache.qpid.transport.util.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 
 
 /**
@@ -33,11 +35,11 @@ public class SessionDelegate
     extends MethodDelegate<Session>
     implements ProtocolDelegate<Session>
 {
-    protected static final Logger log = Logger.get(SessionDelegate.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(SessionDelegate.class);
 
     public void init(Session ssn, ProtocolHeader hdr)
     {
-        log.warn("INIT: [%s] %s", ssn, hdr);
+        LOGGER.warn("INIT: [{}] {}", ssn, hdr);
     }
 
     public void control(Session ssn, Method method)
@@ -61,12 +63,12 @@ public class SessionDelegate
 
     public void error(Session ssn, ProtocolError error)
     {
-        log.warn("ERROR: [%s] %s", ssn, error);
+        LOGGER.warn("ERROR: [{}] {}", ssn, error);
     }
 
     public void handle(Session ssn, Method method)
     {
-        log.warn("UNHANDLED: [%s] %s", ssn, method);
+        LOGGER.warn("UNHANDLED: [{}] {}", ssn, method);
     }
 
     @Override public void sessionRequestTimeout(Session ssn, SessionRequestTimeout t)
@@ -228,7 +230,7 @@ public class SessionDelegate
 
     public void closed(Session session)
     {
-        log.debug("CLOSED: [%s]", session);
+        LOGGER.debug("CLOSED: [{}]", session);
         synchronized (session.getStateLock())
         {
             session.getStateLock().notifyAll();
@@ -237,7 +239,7 @@ public class SessionDelegate
 
     public void detached(Session session)
     {
-        log.debug("DETACHED: [%s]", session);
+        LOGGER.debug("DETACHED: [{}]", session);
         synchronized (session.getStateLock())
         {
             session.getStateLock().notifyAll();

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java Mon Aug 31 06:31:02 2015
@@ -30,11 +30,13 @@ import java.util.concurrent.atomic.Atomi
 
 import javax.net.ssl.SSLSocket;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.thread.Threading;
 import org.apache.qpid.transport.ExceptionHandlingByteBufferReceiver;
 import org.apache.qpid.transport.TransportException;
 import org.apache.qpid.transport.network.Ticker;
-import org.apache.qpid.transport.util.Logger;
 import org.apache.qpid.util.SystemUtils;
 
 /**
@@ -44,8 +46,7 @@ import org.apache.qpid.util.SystemUtils;
 
 final class IoReceiver implements Runnable
 {
-
-    private static final Logger log = Logger.get(IoReceiver.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(IoReceiver.class);
 
     private final ExceptionHandlingByteBufferReceiver receiver;
     private final int bufferSize;
@@ -226,7 +227,7 @@ final class IoReceiver implements Runnab
             }
             catch(Exception e)
             {
-                log.warn(e, "Error closing socket");
+                LOGGER.warn("Error closing socket", e);
             }
         }
     }

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java Mon Aug 31 06:31:02 2015
@@ -23,25 +23,26 @@ import static org.apache.qpid.transport.
 import java.io.IOException;
 import java.io.OutputStream;
 import java.net.Socket;
-import java.nio.ByteBuffer;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.net.ssl.SSLSocket;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.bytebuffer.QpidByteBuffer;
 import org.apache.qpid.thread.Threading;
 import org.apache.qpid.transport.ByteBufferSender;
 import org.apache.qpid.transport.SenderClosedException;
 import org.apache.qpid.transport.SenderException;
 import org.apache.qpid.transport.TransportException;
-import org.apache.qpid.transport.util.Logger;
 import org.apache.qpid.util.SystemUtils;
 
 
 public final class IoSender implements Runnable, ByteBufferSender
 {
 
-    private static final Logger log = Logger.get(IoSender.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(IoSender.class);
 
     // by starting here, we ensure that we always test the wraparound
     // case, we should probably make this configurable somehow so that
@@ -159,7 +160,7 @@ public final class IoSender implements R
                     {
                         try
                         {
-                            log.error("write timed out for socket %s: head %d, tail %d", _remoteSocketAddress, head, tail);
+                            LOGGER.error("write timed out for socket {}: head {}, tail {}", new Object[] {_remoteSocketAddress, head, tail});
                             throw new SenderException(String.format("write timed out for socket %s: head %d, tail %d",  _remoteSocketAddress, head, tail));
                         }
                         finally
@@ -248,7 +249,7 @@ public final class IoSender implements R
             }
             catch(RuntimeException e)
             {
-                log.error(e, "Exception closing receiver for socket %s", _remoteSocketAddress);
+                LOGGER.error("Exception closing receiver for socket {}", _remoteSocketAddress, e);
                 throw new SenderException(e.getMessage(), e);
             }
         }
@@ -310,7 +311,7 @@ public final class IoSender implements R
             }
             catch (IOException e)
             {
-                log.info("Exception in thread sending to '" + _remoteSocketAddress + "': " + e);
+                LOGGER.info("Exception in thread sending to '{}' : {}", _remoteSocketAddress, e.getMessage());
                 exception = e;
                 close(false, false);
                 break;
@@ -352,13 +353,13 @@ public final class IoSender implements R
                 senderThread.join(timeout);
                 if (senderThread.isAlive())
                 {
-                    log.error("join timed out for socket %s to stop", _remoteSocketAddress);
+                    LOGGER.error("join timed out for socket {} to stop", _remoteSocketAddress);
                     throw new SenderException(String.format("join timed out for socket %s to stop", _remoteSocketAddress));
                 }
             }
             catch (InterruptedException e)
             {
-                log.error("interrupted whilst waiting for sender thread for socket %s to stop", _remoteSocketAddress);
+                LOGGER.error("interrupted whilst waiting for sender thread for socket {} to stop", _remoteSocketAddress);
                 throw new SenderException(e);
             }
         }

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java Mon Aug 31 06:31:02 2015
@@ -25,17 +25,19 @@ import java.nio.ByteBuffer;
 
 import javax.security.sasl.SaslException;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.transport.ExceptionHandlingByteBufferReceiver;
 import org.apache.qpid.transport.SenderException;
-import org.apache.qpid.transport.util.Logger;
 
 public class SASLReceiver extends SASLEncryptor implements ExceptionHandlingByteBufferReceiver
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger(SASLReceiver.class);
 
     private ExceptionHandlingByteBufferReceiver delegate;
     private byte[] netData;
-    private static final Logger log = Logger.get(SASLReceiver.class);
-    
+
     public SASLReceiver(ExceptionHandlingByteBufferReceiver delegate)
     {
         this.delegate = delegate;
@@ -80,7 +82,7 @@ public class SASLReceiver extends SASLEn
     public void securityLayerEstablished()
     {
         netData = new byte[getRecvBuffSize()];
-        log.debug("SASL Security Layer Established");
+        LOGGER.debug("SASL Security Layer Established");
     }
 
 }

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLSender.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLSender.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLSender.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLSender.java Mon Aug 31 06:31:02 2015
@@ -21,28 +21,29 @@
 package org.apache.qpid.transport.network.security.sasl;
 
 
-import java.nio.ByteBuffer;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.security.sasl.SaslException;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.bytebuffer.QpidByteBuffer;
 import org.apache.qpid.transport.ByteBufferSender;
 import org.apache.qpid.transport.SenderException;
-import org.apache.qpid.transport.util.Logger;
 
 public class SASLSender extends SASLEncryptor implements ByteBufferSender
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger(SASLSender.class);
 
     private ByteBufferSender delegate;
     private byte[] appData;
     private final AtomicBoolean closed = new AtomicBoolean(false);
-    private static final Logger log = Logger.get(SASLSender.class);
-    
+
     public SASLSender(ByteBufferSender delegate)
     {
         this.delegate = delegate;
-        log.debug("SASL Sender enabled");
+        LOGGER.debug("SASL Sender enabled");
     }
 
     public void close() 
@@ -82,20 +83,20 @@ public class SASLSender extends SASLEncr
             while (buf.hasRemaining())
             {
                 int length = Math.min(buf.remaining(), getSendBuffSize());
-                log.debug("sendBuffSize %s", getSendBuffSize());
-                log.debug("buf.remaining() %s", buf.remaining());
+                LOGGER.debug("sendBuffSize {}", getSendBuffSize());
+                LOGGER.debug("buf.remaining() {}", buf.remaining());
 
                 buf.get(appData, 0, length);
                 try
                 {
                     byte[] out = getSaslClient().wrap(appData, 0, length);
-                    log.debug("out.length %s", out.length);
+                    LOGGER.debug("out.length {}", out.length);
 
                     delegate.send(QpidByteBuffer.wrap(out));
                 }
                 catch (SaslException e)
                 {
-                    log.error("Exception while encrypting data.",e);
+                    LOGGER.error("Exception while encrypting data.", e);
                     throw new SenderException("SASL Sender, Error occurred while encrypting data",e);
                 }
             }
@@ -111,7 +112,7 @@ public class SASLSender extends SASLEncr
     public void securityLayerEstablished()
     {
         appData = new byte[getSendBuffSize()];
-        log.debug("SASL Security Layer Established");
+       LOGGER.debug("SASL Security Layer Established");
     }
 
 }

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/QpidClientX509KeyManager.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/QpidClientX509KeyManager.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/QpidClientX509KeyManager.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/QpidClientX509KeyManager.java Mon Aug 31 06:31:02 2015
@@ -20,8 +20,6 @@
  */
 package org.apache.qpid.transport.network.security.ssl;
 
-import org.apache.qpid.transport.util.Logger;
-
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLEngine;
 import javax.net.ssl.X509ExtendedKeyManager;
@@ -34,10 +32,13 @@ import java.security.Principal;
 import java.security.PrivateKey;
 import java.security.cert.X509Certificate;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class QpidClientX509KeyManager extends X509ExtendedKeyManager
 {
-    private static final Logger log = Logger.get(QpidClientX509KeyManager.class);
-    
+    private static final Logger LOGGER = LoggerFactory.getLogger(QpidClientX509KeyManager.class);
+
     private X509ExtendedKeyManager delegate;
     private String alias;
     
@@ -73,7 +74,7 @@ public class QpidClientX509KeyManager ex
 
     public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)
     {
-        log.debug("chooseClientAlias:Returning alias " + alias);
+        LOGGER.debug("chooseClientAlias:Returning alias {}", alias);
         return alias;
     }
 
@@ -89,7 +90,7 @@ public class QpidClientX509KeyManager ex
 
     public String[] getClientAliases(String keyType, Principal[] issuers)
     {
-        log.debug("getClientAliases:Returning alias " + alias);
+        LOGGER.debug("getClientAliases:Returning alias {}", alias);
         return new String[]{alias};
     }
 
@@ -105,7 +106,7 @@ public class QpidClientX509KeyManager ex
 
     public String chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine)
     {
-        log.debug("chooseEngineClientAlias:Returning alias " + alias);
+        LOGGER.debug("chooseEngineClientAlias:Returning alias {}", alias);
         return alias;
     }
 

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLReceiver.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLReceiver.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLReceiver.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLReceiver.java Mon Aug 31 06:31:02 2015
@@ -28,14 +28,16 @@ import javax.net.ssl.SSLEngineResult.Han
 import javax.net.ssl.SSLEngineResult.Status;
 import javax.net.ssl.SSLException;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.transport.ExceptionHandlingByteBufferReceiver;
 import org.apache.qpid.transport.TransportException;
 import org.apache.qpid.transport.network.security.SSLStatus;
-import org.apache.qpid.transport.util.Logger;
 
 public class SSLReceiver implements ExceptionHandlingByteBufferReceiver
 {
-    private static final Logger log = Logger.get(SSLReceiver.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(SSLReceiver.class);
 
     private final ExceptionHandlingByteBufferReceiver delegate;
     private final SSLEngine engine;
@@ -187,9 +189,9 @@ public class SSLReceiver implements Exce
             }
             catch(SSLException e)
             {
-                if (log.isDebugEnabled())
+                if (LOGGER.isDebugEnabled())
                 {
-                    log.debug(e, "Error caught in SSLReceiver");
+                    LOGGER.debug("Error caught in SSLReceiver", e);
                 }
                 _sslStatus.setSslErrorFlag();
                 synchronized(_sslStatus.getSslLock())
@@ -205,7 +207,8 @@ public class SSLReceiver implements Exce
     private void doTasks()
     {
         Runnable runnable;
-        while ((runnable = engine.getDelegatedTask()) != null) {
+        while ((runnable = engine.getDelegatedTask()) != null)
+        {
             runnable.run();
         }
     }

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java Mon Aug 31 06:31:02 2015
@@ -28,15 +28,17 @@ import javax.net.ssl.SSLEngineResult.Han
 import javax.net.ssl.SSLEngineResult.Status;
 import javax.net.ssl.SSLException;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.bytebuffer.QpidByteBuffer;
 import org.apache.qpid.transport.ByteBufferSender;
 import org.apache.qpid.transport.SenderException;
 import org.apache.qpid.transport.network.security.SSLStatus;
-import org.apache.qpid.transport.util.Logger;
 
 public class SSLSender implements ByteBufferSender
 {
-    private static final Logger log = Logger.get(SSLSender.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(SSLSender.class);
 
     private final ByteBufferSender delegate;
     private final SSLEngine engine;
@@ -73,7 +75,7 @@ public class SSLSender implements ByteBu
             {
                 return;
             }
-            log.debug("Closing SSL connection");
+            LOGGER.debug("Closing SSL connection");
 
             engine.closeOutbound();
             try

Modified: qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java (original)
+++ qpid/java/trunk/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java Mon Aug 31 06:31:02 2015
@@ -67,12 +67,15 @@ import javax.net.ssl.SSLServerSocket;
 import javax.net.ssl.SSLSocket;
 import javax.xml.bind.DatatypeConverter;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.transport.TransportException;
-import org.apache.qpid.transport.util.Logger;
 
 public class SSLUtil
 {
-    private static final Logger log = Logger.get(SSLUtil.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(SSLUtil.class);
+
     private static final Integer DNS_NAME_TYPE = 2;
     public static final String SSLV3_PROTOCOL = "SSLv3";
 
@@ -89,7 +92,7 @@ public class SSLUtil
         }
         catch(SSLPeerUnverifiedException e)
         {
-            log.warn("Exception received while trying to verify hostname",e);
+            LOGGER.warn("Exception received while trying to verify hostname", e);
             // For some reason the SSL engine sets the handshake status to FINISH twice
             // in succession. The first time the peer certificate
             // info is not available. The second time it works !
@@ -205,7 +208,7 @@ public class SSLUtil
             }
             catch (InvalidNameException e)
             {
-                log.warn("Invalid name: '"+dn+"'. ");
+                LOGGER.warn("Invalid name: '{}'", dn);
                 return "";
             }
         }
@@ -224,9 +227,9 @@ public class SSLUtil
         }
         catch (Exception e)
         {
-            log.info("Exception received while trying to retrieve client identity from SSL cert", e);
+            LOGGER.info("Exception received while trying to retrieve client identity from SSL cert", e);
         }
-        log.debug("Extracted Identity from client certificate : " + id);
+        LOGGER.debug("Extracted Identity from client certificate : {}", id);
         return id;
     }
 

Modified: qpid/java/trunk/common/src/test/java/org/apache/qpid/transport/network/io/IoTransport.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/common/src/test/java/org/apache/qpid/transport/network/io/IoTransport.java?rev=1700208&r1=1700207&r2=1700208&view=diff
==============================================================================
--- qpid/java/trunk/common/src/test/java/org/apache/qpid/transport/network/io/IoTransport.java (original)
+++ qpid/java/trunk/common/src/test/java/org/apache/qpid/transport/network/io/IoTransport.java Mon Aug 31 06:31:02 2015
@@ -21,10 +21,12 @@ package org.apache.qpid.transport.networ
 
 import java.net.Socket;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.transport.ByteBufferSender;
 import org.apache.qpid.transport.Connection;
 import org.apache.qpid.transport.network.ConnectionBinding;
-import org.apache.qpid.transport.util.Logger;
 
 /**
  * This class provides a socket based transport using the java.io
@@ -37,10 +39,9 @@ import org.apache.qpid.transport.util.Lo
  */
 public final class IoTransport
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger(IoTransport.class);
 
 
-    private static final Logger log = Logger.get(IoTransport.class);
-
     private static int DEFAULT_READ_WRITE_BUFFER_SIZE = 64 * 1024;
     private static int readBufferSize = Integer.getInteger
         ("amqj.receiveBufferSize", DEFAULT_READ_WRITE_BUFFER_SIZE);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org