OpenAMQ JMS API update and expansion patch

This patch updates the OpenAMQ JMS client to provide more flexible functionality similar to that provided by the WireApi C client. Specifically it provides more options when declaring exchanges and queues and creating queue bindings. It also switches all of the logging to use the more generic slf4j rather than log4j. Finally I was getting error messages like the following when trying to connect to the server:

INFO [openamq.client.protocol.AMQProtocolHandler] Exception caught therefore going to attempt failover: org.openamq.AMQException: AMQMethodEvent Method event:
Channel id: 1
Method: class org.openamq.framing.BasicQosOkBody Class: 60 Method: 11 was not processed by any listener.
org.openamq.AMQException: AMQMethodEvent Method event:
Channel id: 1

I found that this was caused by the BasicQosOkBody message from the server not being properly consumed. I made a change to handle that message and that cleared up the error messages and the problems I had in connecting to the server reliably.

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff -Naur java-orig/src/org/openamq/AMQException.java java/src/org/openamq/AMQException.java
--- java-orig/src/org/openamq/AMQException.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/AMQException.java    2008-10-13 09:12:57.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

 /**
  * Generic AMQ exception.
diff -Naur java-orig/src/org/openamq/client/AMQConnection.java java/src/org/openamq/client/AMQConnection.java
--- java-orig/src/org/openamq/client/AMQConnection.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/AMQConnection.java    2008-10-14 11:06:28.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;
 import org.openamq.AMQUndeliveredException;
 import org.openamq.client.protocol.AMQProtocolHandler;
@@ -10,6 +11,7 @@
 import org.openamq.client.transport.TransportConnection;
 import org.openamq.framing.AMQFrame;
 import org.openamq.framing.BasicQosBody;
+import org.openamq.framing.BasicQosOkBody;
 import org.openamq.framing.ChannelOpenBody;
 import org.openamq.framing.ChannelOpenOkBody;
 import org.openamq.framing.TxSelectBody;
@@ -42,7 +44,7 @@

 public class AMQConnection extends Closeable implements Connection, QueueConnection, TopicConnection
 {
-    private static final Logger _logger = Logger.getLogger(AMQConnection.class);
+    private static final Logger _logger = LoggerFactory.getLogger(AMQConnection.class);

     private final IdFactory _idFactory = new IdFactory();

@@ -380,7 +382,7 @@
                         _protocolHandler.writeCommandFrameAndWaitForReply(frame,
                                                                           new SpecificMethodFrameListener(channelId,
                                                                                                           ChannelOpenOkBody.class));
-                        _protocolHandler.writeFrame(BasicQosBody.createAMQFrame(channelId, 0, prefetch, false));
+                        _protocolHandler.writeCommandFrameAndWaitForReply(BasicQosBody.createAMQFrame(channelId, 0, prefetch, false), new SpecificMethodFrameListener(channelId, BasicQosOkBody.class));
                         if(transacted)
                         {
                             if (_logger.isDebugEnabled())
diff -Naur java-orig/src/org/openamq/client/AMQDestination.java java/src/org/openamq/client/AMQDestination.java
--- java-orig/src/org/openamq/client/AMQDestination.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/AMQDestination.java    2008-10-14 08:51:09.000000000 -0600
@@ -16,10 +16,6 @@

     public final static String HEADERS_EXCHANGE_CLASS = "headers";

-    protected final String _exchangeName;
-
-    protected final String _exchangeClass;
-
     protected final String _destinationName;

     protected boolean _isDurable;
@@ -30,19 +26,37 @@

     protected String _queueName;

+    protected String _exchangeName;
+
+    protected String _exchangeClass;
+
+    protected final boolean _isExchangeDurable;
+
+    protected final boolean _isExchangeAutoDelete;
+
     protected AMQDestination(String exchangeName, String exchangeClass, String destinationName, String queueName)
     {
-        this(exchangeName, exchangeClass, destinationName, false, false, queueName);
+        this(exchangeName, exchangeClass, false, false, destinationName, false, false, false, queueName);
     }

     protected AMQDestination(String exchangeName, String exchangeClass, String destinationName)
     {
-        this(exchangeName, exchangeClass, destinationName, false, false, null);
+        this(exchangeName, exchangeClass, false, false, destinationName, false, false, true, destinationName);
     }

     protected AMQDestination(String exchangeName, String exchangeClass, String destinationName, boolean isExclusive,
                              boolean isAutoDelete, String queueName)
     {
+        this(exchangeName, exchangeClass, false, false, destinationName, false, isExclusive, isAutoDelete, queueName);
+    }
+
+    protected AMQDestination(String exchangeName, String exchangeClass, String destinationName, boolean isDurable, boolean isExclusive, boolean isAutoDelete, String queueName)
+    {
+        this(exchangeName, exchangeClass, false, false, destinationName, isDurable, isExclusive, isAutoDelete, queueName);
+    }
+
+    protected AMQDestination(String exchangeName, String exchangeClass, boolean isExchangeDurable, boolean isExchangeAutoDelete, String destinationName, boolean isDurable, boolean isExclusive, boolean isAutoDelete, String queueName)
+    {
         if (destinationName == null)
         {
             throw new IllegalArgumentException("Destination name must not be null");
@@ -61,6 +75,9 @@
         _isExclusive = isExclusive;
         _isAutoDelete = isAutoDelete;
         _queueName = queueName;
+        _isDurable = isDurable;
+        _isExchangeDurable = isExchangeDurable;
+        _isExchangeAutoDelete = isExchangeAutoDelete;
     }

     public abstract String getEncodedName();
@@ -80,14 +97,34 @@
         return _exchangeClass;
     }

+    public boolean getExchangeDurable()
+    {
+        return _isExchangeDurable;
+    }
+
+    public boolean getExchangeAutoDelete()
+    {
+        return _isExchangeAutoDelete;
+    }
+
+    public void setExchangeName(String exchangeName)
+    {
+        _exchangeName = exchangeName;
+    }
+
+    public void setExchangeClass(String exchangeClass)
+    {
+        _exchangeClass = exchangeClass;
+    }
+
     public boolean isTopic()
     {
-        return TOPIC_EXCHANGE_NAME.equals(_exchangeName);
+        return TOPIC_EXCHANGE_CLASS.equals(_exchangeClass);
     }

     public boolean isQueue()
     {
-        return QUEUE_EXCHANGE_NAME.equals(_exchangeName);
+        return QUEUE_EXCHANGE_CLASS.equals(_exchangeClass);
     }

     public String getDestinationName()
@@ -117,6 +154,16 @@
         return _isAutoDelete;
     }

+    public boolean isExchangeDurable()
+    {
+        return _isExchangeDurable;
+    }
+
+    public boolean isExchangeAutoDelete()
+    {
+        return _isExchangeAutoDelete;
+    }
+
     public abstract boolean isNameRequired();

     public String toString()
diff -Naur java-orig/src/org/openamq/client/AMQQueue.java java/src/org/openamq/client/AMQQueue.java
--- java-orig/src/org/openamq/client/AMQQueue.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/AMQQueue.java    2008-10-14 08:49:38.000000000 -0600
@@ -4,6 +4,7 @@

 public class AMQQueue extends AMQDestination implements Queue
 {
+    private String _routingKey;
     /**
      * Create a reference to a non temporary queue. Note this does not actually imply the queue exists.
      * @param name the name of the queue
@@ -41,6 +42,92 @@
               autoDelete, queueName);
     }

+    /**
+     * Create a reference to a queue. Note this does not actually imply the queue exists.
+     * @param destinationName the queue name
+     * @param queueName the queue name
+     * @param durable true if the queue should survive server restart
+     * @param exclusive true if the queue should only permit a single consumer
+     * @param autoDelete true if the queue should be deleted automatically when the last consumers detaches
+     */
+    public AMQQueue(String destinationName, String queueName, boolean durable, boolean exclusive, boolean autoDelete)
+    {
+        super(AMQDestination.QUEUE_EXCHANGE_NAME, AMQDestination.QUEUE_EXCHANGE_CLASS, destinationName, durable, exclusive, autoDelete, queueName);
+    }
+
+    /**
+     * Create a reference to a queue. Note this does not actually imply the queue exists.
+     * @param destinationName the queue name
+     * @param queueName the queue name
+     * @param exchangeName the exchange name
+     * @param exchangeClass the exchange type
+     * @param durable true if the queue should survive server restart
+     * @param exclusive true if the queue should only permit a single consumer
+     * @param autoDelete true if the queue should be deleted automatically when the last consumers detaches
+     */
+    public AMQQueue(String destinationName, String queueName, String exchangeName, String exchangeClass, String routingKey, boolean durable, boolean exclusive, boolean autoDelete)
+    {
+        super(exchangeName, exchangeClass, destinationName, durable, exclusive,
+              autoDelete, queueName);
+        if (exchangeClass == "fanout")
+        {
+            _routingKey = new String("");
+        }
+        else if (routingKey != null) 
+        {
+           _routingKey = routingKey; 
+        }
+    }
+
+    /**
+     * Create a reference to a queue. Note this does not actually imply the queue exists.
+     * @param destinationName the queue name
+     * @param queueName the queue name
+     * @param exchangeName the exchange name
+     * @param exchangeClass the exchange type
+     * @param exchangeDurable true if the exchange should survive server restart
+     * @param exchangeAutoDelete true if the exchange should be deleted automatically when unused
+     * @param durable true if the queue should survive server restart
+     * @param exclusive true if the queue should only permit a single consumer
+     * @param autoDelete true if the queue should be deleted automatically when the last consumers detaches
+     */
+    public AMQQueue(String destinationName, String queueName, String exchangeName, String exchangeClass, boolean exchangeDurable, boolean exchangeAutoDelete, String routingKey, boolean durable, boolean exclusive, boolean autoDelete)
+    {
+        super(exchangeName, exchangeClass, exchangeDurable, exchangeAutoDelete, destinationName, durable, exclusive,
+              autoDelete, queueName);
+        if (exchangeClass == "fanout")
+        {
+            _routingKey = new String("");
+        }
+        else if (routingKey != null) 
+        {
+           _routingKey = routingKey; 
+        }
+    }
+
+    /**
+     * Create a reference to a queue. Note this does not actually imply the queue exists.
+     * @param destinationName the queue name
+     * @param queueName the queue name
+     * @param exchangeName the exchange name
+     * @param exchangeClass the exchange type
+     * @param exclusive true if the queue should only permit a single consumer
+     * @param autoDelete true if the queue should be deleted automatically when the last consumers detaches
+     */
+    public AMQQueue(String destinationName, String queueName, String exchangeName, String exchangeClass, String routingKey, boolean exclusive, boolean autoDelete)
+    {
+        super(exchangeName, exchangeClass, destinationName, exclusive,
+              autoDelete, queueName);
+        if (exchangeClass == "fanout")
+        {
+            _routingKey = new String("");
+        }
+        else if (routingKey != null) 
+        {
+           _routingKey = routingKey; 
+        }
+    }
+
     public String getEncodedName()
     {
         return 'Q' + getQueueName();
@@ -48,7 +135,14 @@

     public String getRoutingKey()
     {
-        return getQueueName();
+        if (_routingKey == null)
+        {
+            return getQueueName();
+        }
+        else
+        {
+            return _routingKey;
+        }
     }

     public boolean isNameRequired()
diff -Naur java-orig/src/org/openamq/client/AMQSession.java java/src/org/openamq/client/AMQSession.java
--- java-orig/src/org/openamq/client/AMQSession.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/AMQSession.java    2008-10-14 14:12:36.000000000 -0600
@@ -2,7 +2,8 @@

 import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
 import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQDisconnectedException;
 import org.openamq.AMQException;
 import org.openamq.AMQUndeliveredException;
@@ -28,7 +29,7 @@

 public class AMQSession extends Closeable implements Session, QueueSession, TopicSession
 {
-    private static final Logger _logger = Logger.getLogger(AMQSession.class);
+    private static final Logger _logger = LoggerFactory.getLogger(AMQSession.class);

     public static final int DEFAULT_PREFETCH = 5000;

@@ -831,9 +832,14 @@
         declareExchange(name, type, _connection.getProtocolHandler());
     }

+    public void declareExchange(String name, String type, boolean durable, boolean autoDelete) throws AMQException
+    {
+        declareExchange(name, type, durable, autoDelete, _connection.getProtocolHandler());
+    }
+
     private void declareExchange(AMQDestination amqd, AMQProtocolHandler protocolHandler) throws AMQException
     {
-        declareExchange(amqd.getExchangeName(), amqd.getExchangeClass(), protocolHandler);
+        declareExchange(amqd.getExchangeName(), amqd.getExchangeClass(), amqd.getExchangeDurable(), amqd.getExchangeAutoDelete(), protocolHandler);
     }

     private void declareExchange(String name, String type, AMQProtocolHandler protocolHandler) throws AMQException
@@ -842,6 +848,27 @@
         protocolHandler.writeFrame(exchangeDeclare);
     }

+    private void declareExchange(String name, String type, boolean durable, boolean autoDelete, AMQProtocolHandler protocolHandler) throws AMQException
+    {
+        AMQFrame exchangeDeclare = ExchangeDeclareBody.createAMQFrame(_channelId, 0, name, type, false, durable, autoDelete, false, true, null);
+        protocolHandler.writeFrame(exchangeDeclare);
+    }
+
+    /**
+     * Declare the queue.
+     * @param name The queue name
+     * @param durable true if the queue should survive server restart
+     * @param exclusive true if the queue should only permit a single consumer
+     * @param autoDelete true if the queue should be deleted automatically when the last consumers detaches
+     * @param protocolHandler
+     * @return the queue name. This is useful where the broker is generating a queue name on behalf of the client.
+     * @throws AMQException
+     */
+    public String declareQueue(String name, boolean durable, boolean exclusive, boolean autoDelete) throws AMQException
+    {
+        return declareQueue(new AMQQueue(name, name, durable, exclusive, autoDelete), _connection.getProtocolHandler());
+    }
+
     /**
      * Declare the queue.
      * @param amqd
@@ -854,10 +881,11 @@
         //BLZ-24: For queues (but not topics) we generate the name in the client rather than the
         //        server. This allows the name to be reused on failover if required. In general,
         //        the destination indicates whether it wants a name generated or not.
-        if(amqd.isNameRequired())
+        if((amqd.getQueueName() == null || amqd.getQueueName().equals("")) || amqd.isNameRequired())
         {
             amqd.setQueueName(protocolHandler.generateQueueName());
         }
+        _logger.debug("Declaring queue: " + amqd.getQueueName());

         AMQFrame queueDeclare = QueueDeclareBody.createAMQFrame(_channelId, 0, amqd.getQueueName(),
                                                                 false, amqd.isDurable(), amqd.isExclusive(),
@@ -1081,11 +1109,19 @@
      */
     void registerConsumer(BasicMessageConsumer consumer) throws AMQException
     {
+        registerConsumer(consumer, true);
+    }
+
+    void registerConsumer(BasicMessageConsumer consumer, boolean createExchange) throws AMQException
+    {
         AMQDestination amqd = consumer.getDestination();

         AMQProtocolHandler protocolHandler = _connection.getProtocolHandler();

-        declareExchange(amqd, protocolHandler);
+        if (createExchange)
+        {
+            declareExchange(amqd, protocolHandler);
+        }

         String queueName = declareQueue(amqd, protocolHandler);

diff -Naur java-orig/src/org/openamq/client/BasicMessageConsumer.java java/src/org/openamq/client/BasicMessageConsumer.java
--- java-orig/src/org/openamq/client/BasicMessageConsumer.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/BasicMessageConsumer.java    2008-10-14 13:24:23.000000000 -0600
@@ -4,7 +4,8 @@
 import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
 import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean;
 import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicReference;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;
 import org.openamq.client.message.MessageFactoryRegistry;
 import org.openamq.client.message.UnprocessedMessage;
@@ -22,7 +23,7 @@

 public class BasicMessageConsumer extends Closeable implements MessageConsumer
 {
-    private static final Logger _logger = Logger.getLogger(BasicMessageConsumer.class);
+    private static final Logger _logger = LoggerFactory.getLogger(BasicMessageConsumer.class);

     /**
      * The connection being used by this consumer
diff -Naur java-orig/src/org/openamq/client/BasicMessageProducer.java java/src/org/openamq/client/BasicMessageProducer.java
--- java-orig/src/org/openamq/client/BasicMessageProducer.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/BasicMessageProducer.java    2008-10-13 09:16:40.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ByteBuffer;
 import org.openamq.client.protocol.AMQProtocolHandler;
 import org.openamq.client.state.listener.SpecificMethodFrameListener;
@@ -14,7 +15,7 @@

 public class BasicMessageProducer extends Closeable implements org.openamq.jms.MessageProducer
 {
-    protected final Logger _logger = Logger.getLogger(getClass());
+    protected final Logger _logger = LoggerFactory.getLogger(getClass());

     private AMQConnection _connection;

diff -Naur java-orig/src/org/openamq/client/Closeable.java java/src/org/openamq/client/Closeable.java
--- java-orig/src/org/openamq/client/Closeable.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/Closeable.java    2008-10-14 13:24:39.000000000 -0600
@@ -13,7 +13,7 @@
      * We use an atomic boolean so that we do not have to synchronized access to this flag. Synchronizing
      * access to this flag would mean have a synchronized block in every method.
      */
-    protected final AtomicBoolean _closed = new AtomicBoolean(false);
+    protected AtomicBoolean _closed = new AtomicBoolean(false);

     protected void checkNotClosed()
     {
diff -Naur java-orig/src/org/openamq/client/handler/BasicDeliverMethodHandler.java java/src/org/openamq/client/handler/BasicDeliverMethodHandler.java
--- java-orig/src/org/openamq/client/handler/BasicDeliverMethodHandler.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/handler/BasicDeliverMethodHandler.java    2008-10-10 16:50:10.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.handler;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;
 import org.openamq.framing.BasicDeliverBody;
 import org.openamq.client.state.AMQStateManager;
@@ -10,7 +11,7 @@

 public class BasicDeliverMethodHandler implements StateAwareMethodListener
 {
-    private static final Logger _logger = Logger.getLogger(BasicDeliverMethodHandler.class);
+    private static final Logger _logger = LoggerFactory.getLogger(BasicDeliverMethodHandler.class);

     private static final BasicDeliverMethodHandler _instance = new BasicDeliverMethodHandler();

diff -Naur java-orig/src/org/openamq/client/handler/BasicReturnMethodHandler.java java/src/org/openamq/client/handler/BasicReturnMethodHandler.java
--- java-orig/src/org/openamq/client/handler/BasicReturnMethodHandler.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/handler/BasicReturnMethodHandler.java    2008-10-10 16:48:56.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.handler;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;
 import org.openamq.client.message.UnprocessedMessage;
 import org.openamq.client.protocol.AMQMethodEvent;
@@ -10,7 +11,7 @@

 public class BasicReturnMethodHandler implements StateAwareMethodListener
 {
-    private static final Logger _logger = Logger.getLogger(BasicReturnMethodHandler.class);
+    private static final Logger _logger = LoggerFactory.getLogger(BasicReturnMethodHandler.class);

     private static final BasicReturnMethodHandler _instance = new BasicReturnMethodHandler();

diff -Naur java-orig/src/org/openamq/client/handler/ChannelCloseMethodHandler.java java/src/org/openamq/client/handler/ChannelCloseMethodHandler.java
--- java-orig/src/org/openamq/client/handler/ChannelCloseMethodHandler.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/handler/ChannelCloseMethodHandler.java    2008-10-10 16:49:17.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.handler;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQChannelClosedException;
 import org.openamq.AMQException;
 import org.openamq.client.protocol.AMQConstant;
@@ -13,7 +14,7 @@

 public class ChannelCloseMethodHandler implements StateAwareMethodListener
 {
-    private static final Logger _logger = Logger.getLogger(ChannelCloseMethodHandler.class);
+    private static final Logger _logger = LoggerFactory.getLogger(ChannelCloseMethodHandler.class);

     private static ChannelCloseMethodHandler _handler = new ChannelCloseMethodHandler();

diff -Naur java-orig/src/org/openamq/client/handler/ChannelFlowOkMethodHandler.java java/src/org/openamq/client/handler/ChannelFlowOkMethodHandler.java
--- java-orig/src/org/openamq/client/handler/ChannelFlowOkMethodHandler.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/handler/ChannelFlowOkMethodHandler.java    2008-10-10 16:06:40.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.handler;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;
 import org.openamq.client.protocol.AMQMethodEvent;
 import org.openamq.client.state.AMQStateManager;
@@ -9,7 +10,7 @@

 public class ChannelFlowOkMethodHandler implements StateAwareMethodListener
 {
-     private static final Logger _logger = Logger.getLogger(ChannelFlowOkMethodHandler.class);
+     private static final Logger _logger = LoggerFactory.getLogger(ChannelFlowOkMethodHandler.class);
      private static final ChannelFlowOkMethodHandler _instance = new ChannelFlowOkMethodHandler();

      public static ChannelFlowOkMethodHandler getInstance()
diff -Naur java-orig/src/org/openamq/client/handler/ConnectionCloseMethodHandler.java java/src/org/openamq/client/handler/ConnectionCloseMethodHandler.java
--- java-orig/src/org/openamq/client/handler/ConnectionCloseMethodHandler.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/handler/ConnectionCloseMethodHandler.java    2008-10-13 09:23:13.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.handler;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;
 import org.openamq.AMQConnectionClosedException;
 import org.openamq.client.protocol.AMQMethodEvent;
@@ -12,7 +13,7 @@

 public class ConnectionCloseMethodHandler implements StateAwareMethodListener
 {
-    private static final Logger _logger = Logger.getLogger(ConnectionCloseMethodHandler.class);
+    private static final Logger _logger = LoggerFactory.getLogger(ConnectionCloseMethodHandler.class);

     private static ConnectionCloseMethodHandler _handler = new ConnectionCloseMethodHandler();

diff -Naur java-orig/src/org/openamq/client/handler/ConnectionOpenOkMethodHandler.java java/src/org/openamq/client/handler/ConnectionOpenOkMethodHandler.java
--- java-orig/src/org/openamq/client/handler/ConnectionOpenOkMethodHandler.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/handler/ConnectionOpenOkMethodHandler.java    2008-10-10 16:48:35.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.handler;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;
 import org.openamq.client.protocol.AMQMethodEvent;
 import org.openamq.client.protocol.AMQProtocolSession;
@@ -12,7 +13,7 @@
 public class ConnectionOpenOkMethodHandler implements StateAwareMethodListener
 {

-    private static final Logger _logger = Logger.getLogger(ConnectionOpenOkMethodHandler.class);
+    private static final Logger _logger = LoggerFactory.getLogger(ConnectionOpenOkMethodHandler.class);

     private static final ConnectionOpenOkMethodHandler _instance = new ConnectionOpenOkMethodHandler();

diff -Naur java-orig/src/org/openamq/client/handler/ConnectionRedirectMethodHandler.java java/src/org/openamq/client/handler/ConnectionRedirectMethodHandler.java
--- java-orig/src/org/openamq/client/handler/ConnectionRedirectMethodHandler.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/handler/ConnectionRedirectMethodHandler.java    2008-10-10 17:20:59.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.handler;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;
 import org.openamq.client.protocol.AMQMethodEvent;
 import org.openamq.client.state.AMQStateManager;
@@ -9,7 +10,7 @@

 public class ConnectionRedirectMethodHandler implements StateAwareMethodListener
 {
-    private static final Logger _logger = Logger.getLogger(ConnectionRedirectMethodHandler.class);
+    private static final Logger _logger = LoggerFactory.getLogger(ConnectionRedirectMethodHandler.class);

     private static final int DEFAULT_REDIRECT_PORT = 5672;

diff -Naur java-orig/src/org/openamq/client/handler/ConnectionStartMethodHandler.java java/src/org/openamq/client/handler/ConnectionStartMethodHandler.java
--- java-orig/src/org/openamq/client/handler/ConnectionStartMethodHandler.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/handler/ConnectionStartMethodHandler.java    2008-10-10 16:50:37.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.handler;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;
 import org.openamq.client.Version;
 import org.openamq.client.protocol.AMQMethodEvent;
@@ -24,7 +25,7 @@
 public class ConnectionStartMethodHandler implements StateAwareMethodListener
 {

-    private static final Logger _log = Logger.getLogger(ConnectionStartMethodHandler.class);
+    private static final Logger _log = LoggerFactory.getLogger(ConnectionStartMethodHandler.class);

     private static final ConnectionStartMethodHandler _instance = new ConnectionStartMethodHandler();

diff -Naur java-orig/src/org/openamq/client/handler/ConnectionTuneMethodHandler.java java/src/org/openamq/client/handler/ConnectionTuneMethodHandler.java
--- java-orig/src/org/openamq/client/handler/ConnectionTuneMethodHandler.java    2007-07-10 01:22:45.000000000 -0600
+++ java/src/org/openamq/client/handler/ConnectionTuneMethodHandler.java    2008-10-13 09:15:36.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.handler;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;
 import org.openamq.client.ConnectionTuneParameters;
 import org.openamq.client.protocol.AMQMethodEvent;
@@ -15,7 +16,7 @@

 public class ConnectionTuneMethodHandler implements StateAwareMethodListener
 {
-    private static final Logger _logger = Logger.getLogger(ConnectionTuneMethodHandler.class);
+    private static final Logger _logger = LoggerFactory.getLogger(ConnectionTuneMethodHandler.class);

     private static final ConnectionTuneMethodHandler _instance = new ConnectionTuneMethodHandler();

diff -Naur java-orig/src/org/openamq/client/message/AbstractJMSMessageFactory.java java/src/org/openamq/client/message/AbstractJMSMessageFactory.java
--- java-orig/src/org/openamq/client/message/AbstractJMSMessageFactory.java    2007-07-10 01:22:43.000000000 -0600
+++ java/src/org/openamq/client/message/AbstractJMSMessageFactory.java    2008-10-10 16:02:20.000000000 -0600
@@ -4,7 +4,8 @@
 import org.openamq.framing.ContentHeaderBody;
 import org.openamq.framing.ContentBody;
 import org.openamq.framing.BasicContentHeaderProperties;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ByteBuffer;

 import javax.jms.JMSException;
@@ -13,7 +14,7 @@

 public abstract class AbstractJMSMessageFactory implements MessageFactory
 {
-    private static final Logger _logger = Logger.getLogger(AbstractJMSMessageFactory.class);
+    private static final Logger _logger = LoggerFactory.getLogger(AbstractJMSMessageFactory.class);

     protected abstract AbstractJMSMessage createMessage(long messageNbr, ByteBuffer data,
diff -Naur java-orig/src/org/openamq/client/message/UnexpectedBodyReceivedException.java java/src/org/openamq/client/message/UnexpectedBodyReceivedException.java
--- java-orig/src/org/openamq/client/message/UnexpectedBodyReceivedException.java    2007-07-10 01:22:43.000000000 -0600
+++ java/src/org/openamq/client/message/UnexpectedBodyReceivedException.java    2008-10-10 15:59:13.000000000 -0600
@@ -1,7 +1,8 @@
 package org.openamq.client.message;

 import org.openamq.AMQException;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

 public class UnexpectedBodyReceivedException extends AMQException
 {
diff -Naur java-orig/src/org/openamq/client/protocol/AMQProtocolHandler.java java/src/org/openamq/client/protocol/AMQProtocolHandler.java
--- java-orig/src/org/openamq/client/protocol/AMQProtocolHandler.java    2007-07-10 01:22:43.000000000 -0600
+++ java/src/org/openamq/client/protocol/AMQProtocolHandler.java    2008-10-13 10:50:06.000000000 -0600
@@ -1,8 +1,9 @@
 package org.openamq.client.protocol;

-import edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArraySet;
-import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
-import org.apache.log4j.Logger;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.CountDownLatch;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.IoHandlerAdapter;
 import org.apache.mina.common.IoSession;
@@ -22,7 +23,7 @@

 public class AMQProtocolHandler extends IoHandlerAdapter
 {
-    private static final Logger _logger = Logger.getLogger(AMQProtocolHandler.class);
+    private static final Logger _logger = LoggerFactory.getLogger(AMQProtocolHandler.class);

     /**
      * The connection that this protocol handler is associated with. There is a 1-1
diff -Naur java-orig/src/org/openamq/client/protocol/AMQProtocolSession.java java/src/org/openamq/client/protocol/AMQProtocolSession.java
--- java-orig/src/org/openamq/client/protocol/AMQProtocolSession.java    2007-07-10 01:22:43.000000000 -0600
+++ java/src/org/openamq/client/protocol/AMQProtocolSession.java    2008-10-14 13:24:03.000000000 -0600
@@ -2,7 +2,8 @@

 import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
 import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.WriteFuture;
 import org.apache.mina.common.IdleStatus;
@@ -27,7 +28,7 @@
  */
 public class AMQProtocolSession
 {
-    private static final Logger _logger = Logger.getLogger(AMQProtocolSession.class);
+    private static final Logger _logger = LoggerFactory.getLogger(AMQProtocolSession.class);

     public static final String PROTOCOL_INITIATION_RECEIVED = "ProtocolInitiatiionReceived";

diff -Naur java-orig/src/org/openamq/client/protocol/FailoverSupport.java java/src/org/openamq/client/protocol/FailoverSupport.java
--- java-orig/src/org/openamq/client/protocol/FailoverSupport.java    2007-07-10 01:22:43.000000000 -0600
+++ java/src/org/openamq/client/protocol/FailoverSupport.java    2008-10-10 16:02:45.000000000 -0600
@@ -1,13 +1,14 @@
 package org.openamq.client.protocol;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.client.AMQConnection;

 import javax.jms.JMSException;

 public abstract class FailoverSupport
 {
-    private static final Logger _log = Logger.getLogger(FailoverSupport.class);
+    private static final Logger _log = LoggerFactory.getLogger(FailoverSupport.class);

     public Object execute(AMQConnection con) throws JMSException
     {
diff -Naur java-orig/src/org/openamq/client/protocol/HeartbeatConfig.java java/src/org/openamq/client/protocol/HeartbeatConfig.java
--- java-orig/src/org/openamq/client/protocol/HeartbeatConfig.java    2007-07-10 01:22:43.000000000 -0600
+++ java/src/org/openamq/client/protocol/HeartbeatConfig.java    2008-10-10 16:03:29.000000000 -0600
@@ -1,10 +1,11 @@
 package org.openamq.client.protocol;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

 class HeartbeatConfig
 {
-    private static final Logger _logger = Logger.getLogger(HeartbeatConfig.class);
+    private static final Logger _logger = LoggerFactory.getLogger(HeartbeatConfig.class);
     static final HeartbeatConfig CONFIG = new HeartbeatConfig();

     /**
diff -Naur java-orig/src/org/openamq/client/protocol/ProtocolBufferMonitorFilter.java java/src/org/openamq/client/protocol/ProtocolBufferMonitorFilter.java
--- java-orig/src/org/openamq/client/protocol/ProtocolBufferMonitorFilter.java    2007-07-10 01:22:43.000000000 -0600
+++ java/src/org/openamq/client/protocol/ProtocolBufferMonitorFilter.java    2008-10-10 16:05:32.000000000 -0600
@@ -2,7 +2,8 @@

 import org.apache.mina.common.IoFilterAdapter;
 import org.apache.mina.common.IoSession;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

 /**
  * A MINA filter that monitors the numbers of messages pending to be sent by MINA. It outputs a message
@@ -12,7 +13,7 @@
  */
 public class ProtocolBufferMonitorFilter extends IoFilterAdapter
 {
-    private static final Logger _logger = Logger.getLogger(ProtocolBufferMonitorFilter.class);
+    private static final Logger _logger = LoggerFactory.getLogger(ProtocolBufferMonitorFilter.class);

     public static long DEFAULT_FREQUENCY = 5000;

diff -Naur java-orig/src/org/openamq/client/security/CallbackHandlerRegistry.java java/src/org/openamq/client/security/CallbackHandlerRegistry.java
--- java-orig/src/org/openamq/client/security/CallbackHandlerRegistry.java    2007-07-10 01:22:44.000000000 -0600
+++ java/src/org/openamq/client/security/CallbackHandlerRegistry.java    2008-10-13 09:17:08.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.security;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

 import java.io.*;
 import java.util.*;
@@ -9,7 +10,7 @@
 {
     private static final String FILE_PROPERTY = "amq.callbackhandler.properties";

-    private static final Logger _logger = Logger.getLogger(CallbackHandlerRegistry.class);
+    private static final Logger _logger = LoggerFactory.getLogger(CallbackHandlerRegistry.class);

     private static CallbackHandlerRegistry _instance = new CallbackHandlerRegistry();

diff -Naur java-orig/src/org/openamq/client/security/DynamicSaslRegistrar.java java/src/org/openamq/client/security/DynamicSaslRegistrar.java
--- java-orig/src/org/openamq/client/security/DynamicSaslRegistrar.java    2007-07-10 01:22:44.000000000 -0600
+++ java/src/org/openamq/client/security/DynamicSaslRegistrar.java    2008-10-13 09:16:52.000000000 -0600
@@ -1,7 +1,8 @@
 package org.openamq.client.security;

-import org.apache.log4j.Logger;

+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import javax.security.sasl.SaslClientFactory;
 import java.io.*;
 import java.util.Properties;
@@ -14,7 +15,7 @@
 {
     private static final String FILE_PROPERTY = "amq.dynamicsaslregistrar.properties";

-    private static final Logger _logger = Logger.getLogger(DynamicSaslRegistrar.class);
+    private static final Logger _logger = LoggerFactory.getLogger(DynamicSaslRegistrar.class);

     public static void registerSaslProviders()
     {
diff -Naur java-orig/src/org/openamq/client/state/AMQStateManager.java java/src/org/openamq/client/state/AMQStateManager.java
--- java-orig/src/org/openamq/client/state/AMQStateManager.java    2007-07-10 01:22:42.000000000 -0600
+++ java/src/org/openamq/client/state/AMQStateManager.java    2008-10-14 13:24:53.000000000 -0600
@@ -1,7 +1,8 @@
 package org.openamq.client.state;

 import edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArraySet;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;
 import org.openamq.framing.AMQMethodBody;
 import org.openamq.client.protocol.*;
@@ -20,7 +21,7 @@
  */
 public class AMQStateManager implements AMQMethodListener
 {
-    private static final Logger _logger = Logger.getLogger(AMQStateManager.class);
+    private static final Logger _logger = LoggerFactory.getLogger(AMQStateManager.class);

     /**
      * The current state
diff -Naur java-orig/src/org/openamq/client/state/StateWaiter.java java/src/org/openamq/client/state/StateWaiter.java
--- java-orig/src/org/openamq/client/state/StateWaiter.java    2007-07-10 01:22:42.000000000 -0600
+++ java/src/org/openamq/client/state/StateWaiter.java    2008-10-13 09:17:20.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.state;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;

 /**
@@ -9,7 +10,7 @@
  */
 public class StateWaiter implements StateListener
 {
-    private static final Logger _logger = Logger.getLogger(StateWaiter.class);
+    private static final Logger _logger = LoggerFactory.getLogger(StateWaiter.class);

     private final AMQState _state;

diff -Naur java-orig/src/org/openamq/client/transport/BlockingSocketTransportConnection.java java/src/org/openamq/client/transport/BlockingSocketTransportConnection.java
--- java-orig/src/org/openamq/client/transport/BlockingSocketTransportConnection.java    2007-07-10 01:22:43.000000000 -0600
+++ java/src/org/openamq/client/transport/BlockingSocketTransportConnection.java    2008-10-14 11:05:55.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.transport;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ConnectFuture;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.SimpleByteBufferAllocator;
@@ -16,7 +17,7 @@

 public class BlockingSocketTransportConnection implements ITransportConnection
 {
-    private static final Logger _logger = Logger.getLogger(BlockingSocketTransportConnection.class);
+    private static final Logger _logger = LoggerFactory.getLogger(BlockingSocketTransportConnection.class);

     public void connect(AMQProtocolHandler protocolHandler, AMQConnection.BrokerDetail brokerDetail)
             throws IOException
@@ -47,7 +48,7 @@
         scfg.setSendBufferSize(Integer.getInteger("amqj.sendBufferSize", 32768));
         scfg.setReceiveBufferSize(Integer.getInteger("amqj.receiveBufferSize", 32768));
         final InetSocketAddress address = new InetSocketAddress(brokerDetail.host, brokerDetail.port);
-        _logger.info("Attempting connection to " + address);
+        _logger.info("Attempting connection to " + address.getHostName() + ":" + Integer.toString(address.getPort()));
         ConnectFuture future = ioConnector.connect(address, protocolHandler);
         // wait for connection to complete
         future.join();
diff -Naur java-orig/src/org/openamq/client/transport/SocketTransportConnection.java java/src/org/openamq/client/transport/SocketTransportConnection.java
--- java-orig/src/org/openamq/client/transport/SocketTransportConnection.java    2007-07-10 01:22:43.000000000 -0600
+++ java/src/org/openamq/client/transport/SocketTransportConnection.java    2008-10-14 11:05:39.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.client.transport;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ConnectFuture;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.SimpleByteBufferAllocator;
@@ -16,7 +17,7 @@

 public class SocketTransportConnection implements ITransportConnection
 {
-    private static final Logger _logger = Logger.getLogger(SocketTransportConnection.class);
+    private static final Logger _logger = LoggerFactory.getLogger(SocketTransportConnection.class);

     public void connect(AMQProtocolHandler protocolHandler, AMQConnection.BrokerDetail brokerDetail)
             throws IOException
@@ -47,7 +48,8 @@
         scfg.setSendBufferSize(Integer.getInteger("amqj.sendBufferSize", 32768));
         scfg.setReceiveBufferSize(Integer.getInteger("amqj.receiveBufferSize", 32768));
         final InetSocketAddress address = new InetSocketAddress(brokerDetail.host, brokerDetail.port);
-        _logger.info("Attempting connection to " + address);
+        _logger.info("Attempting connection to " + address.getHostName() + ":" + Integer.toString(address.getPort()));
+        ioConnector.setWorkerTimeout(3);
         ConnectFuture future = ioConnector.connect(address, protocolHandler);
         // wait for connection to complete
         future.join();
diff -Naur java-orig/src/org/openamq/framing/AMQDataBlockDecoder.java java/src/org/openamq/framing/AMQDataBlockDecoder.java
--- java-orig/src/org/openamq/framing/AMQDataBlockDecoder.java    2007-07-10 01:22:39.000000000 -0600
+++ java/src/org/openamq/framing/AMQDataBlockDecoder.java    2008-10-13 09:15:10.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.framing;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
@@ -10,7 +11,7 @@

 public class AMQDataBlockDecoder
 {
-    Logger _logger = Logger.getLogger(AMQDataBlockDecoder.class);
+    Logger _logger = LoggerFactory.getLogger(AMQDataBlockDecoder.class);

     private final Map _supportedBodies = new HashMap();

diff -Naur java-orig/src/org/openamq/framing/AMQDataBlockEncoder.java java/src/org/openamq/framing/AMQDataBlockEncoder.java
--- java-orig/src/org/openamq/framing/AMQDataBlockEncoder.java    2007-07-10 01:22:39.000000000 -0600
+++ java/src/org/openamq/framing/AMQDataBlockEncoder.java    2008-10-13 09:14:03.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.framing;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.filter.codec.demux.MessageEncoder;
@@ -11,7 +12,7 @@

 public class AMQDataBlockEncoder implements MessageEncoder
 {
-    Logger _logger = Logger.getLogger(AMQDataBlockEncoder.class);
+    Logger _logger = LoggerFactory.getLogger(AMQDataBlockEncoder.class);

     private Set _messageTypes;

diff -Naur java-orig/src/org/openamq/framing/AMQFrameDecodingException.java java/src/org/openamq/framing/AMQFrameDecodingException.java
--- java-orig/src/org/openamq/framing/AMQFrameDecodingException.java    2007-07-10 01:22:39.000000000 -0600
+++ java/src/org/openamq/framing/AMQFrameDecodingException.java    2008-10-13 09:14:58.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.framing;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.openamq.AMQException;

 public class AMQFrameDecodingException extends AMQException
diff -Naur java-orig/src/org/openamq/framing/AMQMethodBodyFactory.java java/src/org/openamq/framing/AMQMethodBodyFactory.java
--- java-orig/src/org/openamq/framing/AMQMethodBodyFactory.java    2007-07-10 01:22:39.000000000 -0600
+++ java/src/org/openamq/framing/AMQMethodBodyFactory.java    2008-10-13 09:13:44.000000000 -0600
@@ -1,11 +1,12 @@
 package org.openamq.framing;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ByteBuffer;

 public class AMQMethodBodyFactory implements BodyFactory
 {
-    private static final Logger _log = Logger.getLogger(AMQMethodBodyFactory.class);
+    private static final Logger _log = LoggerFactory.getLogger(AMQMethodBodyFactory.class);

     private static final AMQMethodBodyFactory _instance = new AMQMethodBodyFactory();

diff -Naur java-orig/src/org/openamq/framing/BasicContentHeaderProperties.java java/src/org/openamq/framing/BasicContentHeaderProperties.java
--- java-orig/src/org/openamq/framing/BasicContentHeaderProperties.java    2007-07-10 01:22:39.000000000 -0600
+++ java/src/org/openamq/framing/BasicContentHeaderProperties.java    2008-10-13 09:14:47.000000000 -0600
@@ -1,11 +1,12 @@
 package org.openamq.framing;

 import org.apache.mina.common.ByteBuffer;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

 public class BasicContentHeaderProperties implements ContentHeaderProperties
 {
-    private static final Logger _logger = Logger.getLogger(BasicContentHeaderProperties.class);
+    private static final Logger _logger = LoggerFactory.getLogger(BasicContentHeaderProperties.class);

     /**
      * We store the encoded form when we decode the content header so that if we need to
diff -Naur java-orig/src/org/openamq/framing/ContentBodyFactory.java java/src/org/openamq/framing/ContentBodyFactory.java
--- java-orig/src/org/openamq/framing/ContentBodyFactory.java    2007-07-10 01:22:39.000000000 -0600
+++ java/src/org/openamq/framing/ContentBodyFactory.java    2008-10-13 09:15:21.000000000 -0600
@@ -1,11 +1,12 @@
 package org.openamq.framing;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ByteBuffer;

 public class ContentBodyFactory implements BodyFactory
 {
-    private static final Logger _log = Logger.getLogger(AMQMethodBodyFactory.class);
+    private static final Logger _log = LoggerFactory.getLogger(AMQMethodBodyFactory.class);

     private static final ContentBodyFactory _instance = new ContentBodyFactory();

diff -Naur java-orig/src/org/openamq/framing/ContentHeaderBodyFactory.java java/src/org/openamq/framing/ContentHeaderBodyFactory.java
--- java-orig/src/org/openamq/framing/ContentHeaderBodyFactory.java    2007-07-10 01:22:39.000000000 -0600
+++ java/src/org/openamq/framing/ContentHeaderBodyFactory.java    2008-10-13 09:13:26.000000000 -0600
@@ -1,11 +1,12 @@
 package org.openamq.framing;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ByteBuffer;

 public class ContentHeaderBodyFactory implements BodyFactory
 {
-    private static final Logger _log = Logger.getLogger(AMQMethodBodyFactory.class);
+    private static final Logger _log = LoggerFactory.getLogger(AMQMethodBodyFactory.class);

     private static final ContentHeaderBodyFactory _instance = new ContentHeaderBodyFactory();

diff -Naur java-orig/src/org/openamq/framing/EncodingUtils.java java/src/org/openamq/framing/EncodingUtils.java
--- java-orig/src/org/openamq/framing/EncodingUtils.java    2007-07-10 01:22:39.000000000 -0600
+++ java/src/org/openamq/framing/EncodingUtils.java    2008-10-13 09:14:18.000000000 -0600
@@ -1,13 +1,14 @@
 package org.openamq.framing;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ByteBuffer;

 import java.nio.charset.Charset;

 public class EncodingUtils
 {
-    private static final Logger _logger = Logger.getLogger(EncodingUtils.class);
+    private static final Logger _logger = LoggerFactory.getLogger(EncodingUtils.class);

     private static final String STRING_ENCODING = "iso8859-15";

diff -Naur java-orig/src/org/openamq/nio/SocketIoProcessor.java java/src/org/openamq/nio/SocketIoProcessor.java
--- java-orig/src/org/openamq/nio/SocketIoProcessor.java    2007-07-10 01:22:41.000000000 -0600
+++ java/src/org/openamq/nio/SocketIoProcessor.java    2008-10-13 09:18:38.000000000 -0600
@@ -18,7 +18,8 @@
  */
 package org.openamq.nio;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.ExceptionMonitor;
 import org.apache.mina.common.IdleStatus;
@@ -42,7 +43,7 @@
  */
 class SocketIoProcessor
 {
-    private static final Logger _logger = Logger.getLogger(SocketIoProcessor.class);
+    private static final Logger _logger = LoggerFactory.getLogger(SocketIoProcessor.class);

     private static final String PROCESSORS_PROPERTY = "mina.socket.processors";
     private static final String THREAD_PREFIX = "SocketIoProcessor-";
diff -Naur java-orig/src/org/openamq/pool/Event.java java/src/org/openamq/pool/Event.java
--- java-orig/src/org/openamq/pool/Event.java    2007-07-10 01:22:42.000000000 -0600
+++ java/src/org/openamq/pool/Event.java    2008-10-13 09:18:21.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.pool;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.IoFilter;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.IdleStatus;
@@ -15,7 +16,7 @@

 class Event
 {
-    private static final Logger _log = Logger.getLogger(Event.class);
+    private static final Logger _log = LoggerFactory.getLogger(Event.class);

     private final EventType type;
     private final IoFilter.NextFilter nextFilter;
diff -Naur java-orig/src/org/openamq/pool/PoolingFilter.java java/src/org/openamq/pool/PoolingFilter.java
--- java-orig/src/org/openamq/pool/PoolingFilter.java    2007-07-10 01:22:42.000000000 -0600
+++ java/src/org/openamq/pool/PoolingFilter.java    2008-10-14 13:35:34.000000000 -0600
@@ -1,6 +1,7 @@
 package org.openamq.pool;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.IoFilterAdapter;
 import org.apache.mina.common.IoSession;
@@ -13,7 +14,7 @@

 public class PoolingFilter extends IoFilterAdapter implements Job.JobCompletionHandler
 {
-    private static final Logger _logger = Logger.getLogger(PoolingFilter.class);
+    private static final Logger _logger = LoggerFactory.getLogger(PoolingFilter.class);
     public static final Set<EventType> READ_EVENTS = new HashSet<EventType>(Arrays.asList(EventType.RECEIVED));
     public static final Set<EventType> WRITE_EVENTS = new HashSet<EventType>(Arrays.asList(EventType.WRITE));

Comments

Add a New Comment

Edit | Files | Tags | Print

rating: +1+x

Submitted by

Kelly McLaughlin <moc.liamg|77nilhgualcm#moc.liamg|77nilhgualcm>

We tag patches

Use one of these tags to say what state the patch is in:

  • open - a new, open patch that applies to the current release of OpenAMQ.
  • closed - patch has been moved to source tree and is closed.
  • rejected - patch has been rejected.

Most recent

All open

OpenAMQ JMS API update and expansion patch (15 Oct 2008 16:43) [open]