[hornetq-commits] JBoss hornetq SVN: r12009 - in branches/Branch_2_2_EAP/src/main/org/hornetq: core/protocol/stomp and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Jan 11 17:42:56 EST 2012


Author: clebert.suconic at jboss.com
Date: 2012-01-11 17:42:54 -0500 (Wed, 11 Jan 2012)
New Revision: 12009

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompConnection.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
Log:
https://issues.jboss.org/browse/JBPAPP-7205 - fixing test on shutdown server after critical IO failure

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java	2012-01-11 21:25:18 UTC (rev 12008)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java	2012-01-11 22:42:54 UTC (rev 12009)
@@ -361,7 +361,7 @@
       callClosingListeners();
    }
    
-   public void disconnect()
+   public void disconnect(final boolean criticalError)
    {
       Channel channel0 = getChannel(0, -1);
 
@@ -371,13 +371,23 @@
       
       Set<Channel> allChannels = new HashSet<Channel>(channels.values());
 
-      removeAllChannels();
+      if (!criticalError)
+      {
+         removeAllChannels();
+      }
+      else
+      {
+         channels.clear();
+      }
 
       // Now we are 100% sure that no more packets will be processed we can flush then send the disconnect
       
-      for (Channel channel: allChannels)
+      if (!criticalError)
       {
-         channel.flushConfirmations();
+         for (Channel channel: allChannels)
+         {
+            channel.flushConfirmations();
+         }
       }
 
       Packet disconnect = new DisconnectMessage(nodeID);

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompConnection.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompConnection.java	2012-01-11 21:25:18 UTC (rev 12008)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompConnection.java	2012-01-11 22:42:54 UTC (rev 12009)
@@ -209,7 +209,7 @@
       manager.cleanup(this);
    }
 
-   public void disconnect()
+   public void disconnect(final boolean criticalError)
    {
    }
 

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java	2012-01-11 21:25:18 UTC (rev 12008)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java	2012-01-11 22:42:54 UTC (rev 12009)
@@ -306,7 +306,7 @@
             log.trace("Sending connection.disconnection packet to " + conn);
          }
 
-         conn.disconnect();
+         conn.disconnect(criticalError);
       }
 
       for (Acceptor acceptor : acceptors)

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java	2012-01-11 21:25:18 UTC (rev 12008)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java	2012-01-11 22:42:54 UTC (rev 12009)
@@ -151,7 +151,7 @@
    /**
     * Disconnect the connection, closing all channels
     */
-   void disconnect();
+   void disconnect(boolean criticalError);
    
    /**
     * returns true if any data has been received since the last time this method was called.



More information about the hornetq-commits mailing list