tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r802032 - in /tomcat/trunk/java/org/apache/catalina: connector/Request.java core/AsyncContextImpl.java
Date Fri, 07 Aug 2009 14:58:41 GMT
Author: fhanik
Date: Fri Aug  7 14:58:41 2009
New Revision: 802032

URL: http://svn.apache.org/viewvc?rev=802032&view=rev
Log:
minor refactoring, simplify initialization

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=802032&r1=802031&r2=802032&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Fri Aug  7 14:58:41 2009
@@ -390,7 +390,7 @@
     /**
      * AsyncContext 
      */
-    protected AsyncContextImpl asyncContext = null;
+    protected volatile AsyncContextImpl asyncContext = null;
     
     /**
      * async timeout
@@ -1475,9 +1475,7 @@
         if (asyncContext==null) asyncContext = new AsyncContextImpl(this);
         else if (asyncContext.isStarted()) throw new IllegalStateException("Already started.");
         asyncContext.setStarted(getContext());
-        asyncContext.setServletRequest(request);
-        asyncContext.setServletResponse(response);
-        asyncContext.initEvent();
+        asyncContext.init(request,response);
         //TODO SERVLET3 - async - need to retrieve the ServletContext here
         //or just the webapp classloader associated with to do 
         //run with start(Runnable)

Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=802032&r1=802031&r2=802032&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Fri Aug  7 14:58:41 2009
@@ -232,18 +232,10 @@
         return servletRequest;
     }
 
-    public void setServletRequest(ServletRequest servletRequest) {
-        this.servletRequest = servletRequest;
-    }
-
     public ServletResponse getServletResponse() {
         return servletResponse;
     }
 
-    public void setServletResponse(ServletResponse servletResponse) {
-        this.servletResponse = servletResponse;
-    }
-
     @Override
     public boolean hasOriginalRequestAndResponse() {
         return hasOriginalRequestAndResponse;
@@ -343,8 +335,10 @@
         state.set(AsyncState.TIMING_OUT);
     }
     
-    public void initEvent() {
-        event = new AsyncEvent(getRequest(),getResponse()); 
+    public void init(ServletRequest request, ServletResponse response) {
+        this.servletRequest = request;
+        this.servletResponse = response;
+        event = new AsyncEvent(request,response); 
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message