You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2007/03/27 18:36:39 UTC

svn commit: r522990 - in /incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client: AMQSession.java handler/ChannelCloseMethodHandler.java protocol/AMQProtocolHandler.java

Author: ritchiem
Date: Tue Mar 27 09:36:34 2007
New Revision: 522990

URL: http://svn.apache.org/viewvc?view=rev&rev=522990
Log:
Added additional logging and comments

Modified:
    incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
    incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java
    incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java

Modified: incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?view=diff&rev=522990&r1=522989&r2=522990
==============================================================================
--- incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/AMQSession.java (original)
+++ incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/AMQSession.java Tue Mar 27 09:36:34 2007
@@ -1248,8 +1248,10 @@
                 {
                     JMSException ex = new JMSException("Error registering consumer: " + e);
 
-                    //todo remove
-                    e.printStackTrace();
+                    if (_logger.isDebugEnabled())
+                    {
+                        e.printStackTrace();
+                    }
                     ex.setLinkedException(e);
                     throw ex;
                 }
@@ -2089,7 +2091,7 @@
         // Remove the consumer from the map
         BasicMessageConsumer consumer = (BasicMessageConsumer) _consumers.get(consumerTag);
         if (consumer != null)
-        {            
+        {
 //            fixme this isn't right.. needs to check if _queue contains data for this consumer
             if (consumer.isAutoClose())// && _queue.isEmpty())
             {

Modified: incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java?view=diff&rev=522990&r1=522989&r2=522990
==============================================================================
--- incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java (original)
+++ incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java Tue Mar 27 09:36:34 2007
@@ -94,6 +94,8 @@
             }
 
         }
+        //fixme why is this only done when the close is expected...
+        // should the above forced closes not also cause a close?
         protocolSession.channelClosed(evt.getChannelId(), errorCode, String.valueOf(reason));
     }
 }

Modified: incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java?view=diff&rev=522990&r1=522989&r2=522990
==============================================================================
--- incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java (original)
+++ incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java Tue Mar 27 09:36:34 2007
@@ -34,6 +34,7 @@
 import org.apache.qpid.AMQDisconnectedException;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.AMQTimeoutException;
+import org.apache.qpid.AMQChannelClosedException;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.client.SSLConfiguration;
@@ -248,6 +249,12 @@
 
                 sessionClosed(session);
             }
+
+            //FIXME Need to correctly handle other exceptions. Things like ...
+//            if (cause instanceof AMQChannelClosedException)
+            // which will cause the JMSSession to end due to a channel close and so that Session needs
+            // to be removed from the map so we can correctly still call close without an exception when trying to close
+            // the server closed session.  See also CloseChannelMethodHandler as the sessionClose is never called on exception
         }
         // we reach this point if failover was attempted and failed therefore we need to let the calling app
         // know since we cannot recover the situation