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

Ron Sigal ron_sigal at yahoo.com
Thu Aug 30 13:48:38 EDT 2007


  User: rsigal  
  Date: 07/08/30 13:48:38

  Modified:    src/main/org/jboss/remoting/transport/socket  Tag:
                        remoting_2_x SocketServerInvoker.java
  Log:
  Synchronizing with branch remoting_2_2_0_GA: JBREM-766: Added shutdown() to ServerSocketRefresh thread so stopping thread no longer relies on interrupt.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.30.2.13 +16 -7     JBossRemoting/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SocketServerInvoker.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java,v
  retrieving revision 1.30.2.12
  retrieving revision 1.30.2.13
  diff -u -b -r1.30.2.12 -r1.30.2.13
  --- SocketServerInvoker.java	11 Mar 2007 20:49:11 -0000	1.30.2.12
  +++ SocketServerInvoker.java	30 Aug 2007 17:48:38 -0000	1.30.2.13
  @@ -49,7 +49,7 @@
    * @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
    *
  - * @version $Revision: 1.30.2.12 $
  + * @version $Revision: 1.30.2.13 $
    * @jmx:mbean
    */
   public class SocketServerInvoker extends ServerInvoker implements Runnable, SocketServerInvokerMBean
  @@ -196,7 +196,7 @@
            catch(IOException e)
            {
               log.error("Error starting ServerSocket.  Bind port: " + getServerBindPort() +
  -               ", bind address: " + bindAddress);
  +               ", bind address: " + bindAddress, e);
               throw e;
            }
   
  @@ -554,7 +554,7 @@
         }
         finally
         {
  -         thread.interrupt();
  +         thread.shutdown();
         }
      }
   
  @@ -671,6 +671,8 @@
       */
      public class ServerSocketRefresh extends Thread
      {  
  +      private boolean running = true;
  +      
         public ServerSocketRefresh()
         {
            super("ServerSocketRefresh");
  @@ -678,10 +680,8 @@
         
         public void run()
         {
  -         while(true)
  +         while(running)
            {
  -            if(isInterrupted())break;
  -            
               synchronized (serverSocketFactoryLock)
               {  
                  if(newServerSocketFactory)
  @@ -706,7 +706,6 @@
                  }
                  catch (InterruptedException e)
                  {
  -                  break;
                  }
               }
            }
  @@ -726,6 +725,16 @@
               log.trace("passed through ServerSocketRefresh.release()");
            }
         }
  +      
  +      public void shutdown()
  +      {
  +         running = false;
  +         
  +         synchronized (serverSocketFactoryLock)
  +         {
  +            serverSocketFactoryLock.notify();
  +         }
  +      }
      }
   
      /**
  
  
  



More information about the jboss-cvs-commits mailing list