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

Ron Sigal ron_sigal at yahoo.com
Thu Aug 30 13:35:14 EDT 2007


  User: rsigal  
  Date: 07/08/30 13:35:14

  Modified:    src/main/org/jboss/remoting/transport/socket  Tag:
                        remoting_2_x ServerThread.java
  Log:
  Synchronizing with branch remoting_2_2_0_GA: JBREM-766: In run() put wait() in a loop and no longer rethrows InterruptedException; JBREM-781:  Responds to "$GET_CLIENT_LOCAL_ADDRESS$" request.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.29.2.24 +29 -15    JBossRemoting/src/main/org/jboss/remoting/transport/socket/ServerThread.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ServerThread.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/socket/ServerThread.java,v
  retrieving revision 1.29.2.23
  retrieving revision 1.29.2.24
  diff -u -b -r1.29.2.23 -r1.29.2.24
  --- ServerThread.java	7 Jul 2007 01:03:00 -0000	1.29.2.23
  +++ ServerThread.java	30 Aug 2007 17:35:14 -0000	1.29.2.24
  @@ -44,6 +44,7 @@
   import java.io.InterruptedIOException;
   import java.io.OutputStream;
   import java.lang.reflect.Constructor;
  +import java.net.InetAddress;
   import java.net.Socket;
   import java.net.SocketAddress;
   import java.net.SocketException;
  @@ -67,7 +68,7 @@
    * @author <a href="mailto:tom at jboss.org">Tom Elrod</a>
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
    *
  - * @version $Revision: 1.29.2.23 $
  + * @version $Revision: 1.29.2.24 $
    */
   public class ServerThread extends Thread
   {
  @@ -203,6 +204,8 @@
                     }
                  }
   
  +               while (true)
  +               {
                  try
                  {
                     if(trace) { log.trace(this + " begins to wait"); }
  @@ -210,6 +213,8 @@
                     wait();
   
                     if(trace) { log.trace(this + " woke up after wait"); }
  +                     
  +                     break;
                  }
                  catch (InterruptedException e)
                  {
  @@ -218,8 +223,7 @@
                        invoker = null;
                        return; // exit thread
                     }
  -
  -                  throw e;
  +                  }
                  }
               }
            }
  @@ -558,8 +562,18 @@
   
            if(trace) { log.trace("about to call " + invoker + ".invoke()"); }
   
  +         // handle socket-specific invocations
  +         if ("$GET_CLIENT_LOCAL_ADDRESS$".equals(req.getParameter()))
  +         {
  +            Socket s = socketWrapper.getSocket();
  +            InetAddress a = s.getInetAddress();
  +            resp = new InvocationResponse(req.getSessionId(), a, false, null);
  +         }
  +         else
  +         {
            // call transport on the subclass, get the result to handback
            resp = invoker.invoke(req);
  +         }
   
            if(trace) { log.trace(invoker + ".invoke() returned " + resp); }
         }
  
  
  



More information about the jboss-cvs-commits mailing list