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

Ron Sigal ron_sigal at yahoo.com
Mon Oct 30 12:48:44 EST 2006


  User: rsigal  
  Date: 06/10/30 12:48:44

  Modified:    src/main/org/jboss/remoting/transport/coyote 
                        CoyoteInvoker.java
  Log:
  JBREM-621:  Turned the boolean receivedInvocationRequest to a ThreadLocal.
  
  Revision  Changes    Path
  1.23      +9 -7      JBossRemoting/src/main/org/jboss/remoting/transport/coyote/CoyoteInvoker.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CoyoteInvoker.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/coyote/CoyoteInvoker.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -b -r1.22 -r1.23
  --- CoyoteInvoker.java	29 Oct 2006 20:29:48 -0000	1.22
  +++ CoyoteInvoker.java	30 Oct 2006 17:48:44 -0000	1.23
  @@ -26,7 +26,6 @@
   import org.apache.tomcat.util.buf.CharChunk;
   import org.apache.tomcat.util.buf.MessageBytes;
   import org.apache.tomcat.util.http.MimeHeaders;
  -import org.jboss.remoting.Client;
   import org.jboss.remoting.InvocationRequest;
   import org.jboss.remoting.InvocationResponse;
   import org.jboss.remoting.InvokerLocator;
  @@ -65,6 +64,11 @@
    */
   public class CoyoteInvoker extends WebServerInvoker implements Adapter
   {
  +   /** Indicates if input was raw or an InvocationRequest */
  +   protected static ThreadLocal receivedInvocationRequest = new ThreadLocal();
  +   protected static final Boolean FALSE = new Boolean(false);
  +   protected static final Boolean TRUE = new Boolean(true);
  +   
      private boolean running = false;
   
      protected ProtocolHandler protocolHandler = null;
  @@ -74,8 +78,6 @@
      /** Indicates if client is HTTPClientInvoker */
      protected boolean isRemotingUserAgent;
      
  -   /** Indicates if input was raw or an InvocationRequest */
  -   protected boolean receivedInvocationRequest;
   
      public CoyoteInvoker(InvokerLocator locator)
      {
  @@ -358,7 +360,7 @@
               res.setStatus(status);
               res.setMessage(message);
   
  -            if (isRemotingUserAgent && receivedInvocationRequest)
  +            if (isRemotingUserAgent && ((Boolean)receivedInvocationRequest.get()).booleanValue())
               {
                  responseMap = ((ResponseMap) responseMap).getMap();
                  responseObject = new InvocationResponse(invocationRequest.getSessionId(),
  @@ -436,7 +438,7 @@
            case Version.VERSION_2:
            {
               
  -            receivedInvocationRequest = false;
  +            receivedInvocationRequest.set(FALSE);
               InvocationRequest invocationRequest = null;
               if (req.method().equals("GET") || req.method().equals("HEAD"))
               {
  @@ -448,7 +450,7 @@
                  Object obj = unmarshaller.read(request.getInputStream(), request);
                  if (obj instanceof InvocationRequest)
                  {
  -                  receivedInvocationRequest = true;
  +                  receivedInvocationRequest.set(TRUE);
                     invocationRequest = (InvocationRequest) obj;
                     if (invocationRequest.getReturnPayload() == null)
                     {
  
  
  



More information about the jboss-cvs-commits mailing list