You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2007/12/20 22:18:16 UTC

svn commit: r606028 - in /incubator/qpid/branches/M2: ./ java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java

Author: rgodfrey
Date: Thu Dec 20 13:18:15 2007
New Revision: 606028

URL: http://svn.apache.org/viewvc?rev=606028&view=rev
Log:
Merged revisions 592373 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1

........
  r592373 | ritchiem | 2007-11-06 11:12:06 +0000 (Tue, 06 Nov 2007) | 1 line
  
  QPID-663 Messages fail to be received after fail over. This is due to the old protocol session being reinstated after fail over. The new protocol session needs to be set in the StateManager as this maintains its own reference which is not being updated hence messages are being lost.
........

Modified:
    incubator/qpid/branches/M2/   (props changed)
    incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java

Propchange: incubator/qpid/branches/M2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Dec 20 13:18:15 2007
@@ -1 +1 @@
-/incubator/qpid/branches/M2.1:1-573736,573738-577772,577774-578732,578734,578736-578744,578746-578827,578829-587922
+/incubator/qpid/branches/M2.1:1-573736,573738-577772,577774-578732,578734,578736-578744,578746-578827,578829-587922,592373

Modified: incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java?rev=606028&r1=606027&r2=606028&view=diff
==============================================================================
--- incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java (original)
+++ incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java Thu Dec 20 13:18:15 2007
@@ -48,10 +48,10 @@
  * <ol>
  * <li>Sets the failing over condition to true.</li>
  * <li>Creates a {@link FailoverException} and gets the protocol connection handler to propagate this event to all
- *     interested parties.</li>
+ * interested parties.</li>
  * <li>Takes the failover mutex on the protocol connection handler.</li>
  * <li>Abandons the fail over if any of the interested parties vetoes it. The mutex is released and the condition
- *     reset.</li>
+ * reset.</li>
  * <li>Creates a new {@link AMQStateManager} and re-established the connection through it.</li>
  * <li>Informs the AMQConnection if the connection cannot be re-established.</li>
  * <li>Recreates all sessions from the old connection to the new.</li>
@@ -64,17 +64,14 @@
  * </table>
  *
  * @todo The failover latch and mutex are used like a lock and condition. If the retrotranlator supports lock/condition
- *       then could change over to using them. 1.4 support still needed.
- *
+ * then could change over to using them. 1.4 support still needed.
  * @todo If the condition is set to null on a vetoes fail-over and there are already other threads waiting on the
- *       condition, they will never be released. It might be an idea to reset the condition in a finally block.
- *
+ * condition, they will never be released. It might be an idea to reset the condition in a finally block.
  * @todo Creates a {@link AMQDisconnectedException} and passes it to the AMQConnection. No need to use an
- *       exception-as-argument here, could just as easily call a specific method for this purpose on AMQConnection.
- *
+ * exception-as-argument here, could just as easily call a specific method for this purpose on AMQConnection.
  * @todo Creates a {@link FailoverException} and propagates it to the MethodHandlers. No need to use an
- *       exception-as-argument here, could just as easily call a specific method for this purpose on
- *       {@link org.apache.qpid.protocol.AMQMethodListener}.
+ * exception-as-argument here, could just as easily call a specific method for this purpose on
+ * {@link org.apache.qpid.protocol.AMQMethodListener}.
  */
 public class FailoverHandler implements Runnable
 {
@@ -182,6 +179,7 @@
             }
             else
             {
+                existingStateManager.setProtocolSession(_amqProtocolHandler.getProtocolSession());                
                 _amqProtocolHandler.setStateManager(existingStateManager);
                 try
                 {