[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/multiplex ...

Ron Sigal ron_sigal at yahoo.com
Sat Jul 22 18:04:47 EDT 2006


  User: rsigal  
  Date: 06/07/22 18:04:47

  Modified:    src/main/org/jboss/remoting/transport/multiplex 
                        MultiplexingManager.java
  Log:
  JBREM-534:  Whenever InputMultiplexor or OutputMultiplexor encounter an unrecoverable errror, they inform MultiplexingManager, which informs all of the registered virtual sockets.  MultiplexingManager will also remove itself from all Maps, effectively hiding its existence so that it will never be reused.
  
  Revision  Changes    Path
  1.50      +36 -1     JBossRemoting/src/main/org/jboss/remoting/transport/multiplex/MultiplexingManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MultiplexingManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/multiplex/MultiplexingManager.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -b -r1.49 -r1.50
  --- MultiplexingManager.java	19 Jul 2006 23:22:28 -0000	1.49
  +++ MultiplexingManager.java	22 Jul 2006 22:04:47 -0000	1.50
  @@ -32,6 +32,7 @@
   import java.net.SocketAddress;
   import java.net.SocketTimeoutException;
   import java.nio.channels.Channels;
  +import java.nio.channels.ClosedChannelException;
   import java.nio.channels.SocketChannel;
   import java.util.ArrayList;
   import java.util.Collection;
  @@ -1766,6 +1767,7 @@
    */
      public synchronized void outputFlushed()
      {
  +      if (shutdownThread != null)
         shutdownThread.setSafeToShutdown(true);
         notifyAll();
      }
  @@ -2023,6 +2025,16 @@
      }
      
      
  +/*
  + *
  + */
  +   protected void unregisterAllMaps()
  +   {
  +      unregisterByLocalAddress();
  +      unregisterByRemoteAddress();
  +      unregisterShareable();
  +   }
  +   
   /**
    * @param socketId
    */
  @@ -2068,6 +2080,14 @@
         // (readException != null) after setReadException() sets readException.  Then 
         // if it created a new InputStream "is", it will set the read exception for "is".
         
  +      // Remove from shareable map (if it's in map).
  +      unregisterAllMaps();
  +      notifySocketsOfException();
  +      
  +      // Unregister with input thread.
  +      if (multiGroupInputThread != null)
  +         multiGroupInputThread.unregisterSocketGroup(this);
  +      
         readException = e;
         
         HashSet tempSet;
  @@ -2088,6 +2108,13 @@
      protected void setWriteException(IOException e)
      {
         // Note.  See Note in setReadException().
  +      // If this connection is unusable, take out of shareable map (if it's in shareable map).
  +      unregisterAllMaps();
  +      notifySocketsOfException();
  +      
  +      // Unregister with output thread.
  +      outputMultiplexor.unregister(this);
  +         
         writeException = e;
         
         HashSet tempSet;   
  @@ -2105,6 +2132,14 @@
      }
      
      
  +   protected void notifySocketsOfException()
  +   {
  +      Iterator it = socketMap.values().iterator();
  +      while (it.hasNext())
  +         ((VirtualSocket) it.next()).notifyOfException();
  +   }
  +   
  +   
      protected void setEOF()
      {
         // Note.  See Note in setReadException().
  
  
  



More information about the jboss-cvs-commits mailing list