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

Ron Sigal ron_sigal at yahoo.com
Tue Nov 20 04:18:10 EST 2007


  User: rsigal  
  Date: 07/11/20 04:18:10

  Modified:    src/main/org/jboss/remoting/transport/socket  Tag:
                        remoting_2_x ServerThread.java
  Log:
  JBREM-758:  Puts client address in InvocationRequest requestPayload.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.29.2.27 +11 -6     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.26
  retrieving revision 1.29.2.27
  diff -u -b -r1.29.2.26 -r1.29.2.27
  --- ServerThread.java	13 Nov 2007 08:57:12 -0000	1.29.2.26
  +++ ServerThread.java	20 Nov 2007 09:18:10 -0000	1.29.2.27
  @@ -27,6 +27,7 @@
   import org.jboss.remoting.InvocationRequest;
   import org.jboss.remoting.InvocationResponse;
   import org.jboss.remoting.InvokerLocator;
  +import org.jboss.remoting.Remoting;
   import org.jboss.remoting.ServerInvoker;
   import org.jboss.remoting.Version;
   import org.jboss.remoting.Client;
  @@ -68,7 +69,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.26 $
  + * @version $Revision: 1.29.2.27 $
    */
   public class ServerThread extends Thread
   {
  @@ -561,6 +562,7 @@
         }
   
         boolean isServerSideOnewayRequest = isServerSideOneway(req);
  +      InetAddress clientAddress = socketWrapper.getSocket().getInetAddress();
         Object resp = null;
   
         try
  @@ -573,12 +575,15 @@
            // 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);
  +            resp = new InvocationResponse(req.getSessionId(), clientAddress, false, null);
            }
            else
            {
  +            if (req.getRequestPayload() == null)
  +               req.setRequestPayload(new HashMap());
  +            
  +            req.getRequestPayload().put(Remoting.CLIENT_ADDRESS, clientAddress);
  +            
                // call transport on the subclass, get the result to handback
                resp = invoker.invoke(req);
            }
  @@ -777,7 +782,7 @@
   
            return new InvocationRequest(remoteAddress.toString(),
                                         invoker.getSupportedSubsystems()[0],
  -                                      obj, null, null, null);
  +                                      obj, new HashMap(), null, null);
         }
      }
   
  
  
  



More information about the jboss-cvs-commits mailing list