geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r940241 - in /geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache: catalina/core/ContainerBase.java catalina/loader/WebappLoader.java catalina/session/StandardManager.java coyote/http11/Http11AprProcessor.java
Date Sun, 02 May 2010 15:00:02 GMT
Author: xuhaihong
Date: Sun May  2 15:00:01 2010
New Revision: 940241

URL: http://svn.apache.org/viewvc?rev=940241&view=rev
Log:
Merge changes from Tomcat trunk to rev 940240

Modified:
    geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/ContainerBase.java
    geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/loader/WebappLoader.java
    geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/session/StandardManager.java
    geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java

Modified: geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/ContainerBase.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/ContainerBase.java?rev=940241&r1=940240&r2=940241&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/ContainerBase.java
(original)
+++ geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/ContainerBase.java
Sun May  2 15:00:01 2010
@@ -1022,11 +1022,6 @@ public abstract class ContainerBase exte
         for (int i = 0; i < children.length; i++) {
             children[i].stop();
         }
-        // Remove children - so next start can work
-        children = findChildren();
-        for (int i = 0; i < children.length; i++) {
-            removeChild(children[i]);
-        }
 
         // Stop our subordinate components, if any
         if ((resources != null) && (resources instanceof Lifecycle)) {
@@ -1094,6 +1089,11 @@ public abstract class ContainerBase exte
     @Override
     protected void destroyInternal() throws LifecycleException {
 
+        // Remove children now this container is being destroyed
+        for (Container child : findChildren()) {
+            child.destroy();
+        }
+
         // unregister this component
         if ( oname != null ) {
             try {

Modified: geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/loader/WebappLoader.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/loader/WebappLoader.java?rev=940241&r1=940240&r2=940241&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/loader/WebappLoader.java
(original)
+++ geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/loader/WebappLoader.java
Sun May  2 15:00:01 2010
@@ -692,8 +692,6 @@ public class WebappLoader extends Lifecy
         }
 
         classLoader = null;
-
-        setState(LifecycleState.MUST_DESTROY);
     }
 
 

Modified: geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/session/StandardManager.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/session/StandardManager.java?rev=940241&r1=940240&r2=940241&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/session/StandardManager.java
(original)
+++ geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/session/StandardManager.java
Sun May  2 15:00:01 2010
@@ -629,8 +629,6 @@ public class StandardManager extends Man
 
         // Require a new random number generator if we are restarted
         this.random = null;
-
-        setState(LifecycleState.MUST_DESTROY);
     }
 
 

Modified: geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=940241&r1=940240&r2=940241&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java
(original)
+++ geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java
Sun May  2 15:00:01 2010
@@ -924,6 +924,44 @@ public class Http11AprProcessor implemen
         
     }
 
+    /* Copied from the AjpProcessor.java */
+    public SocketState asyncDispatch(SocketStatus status) throws IOException {
+
+        RequestInfo rp = request.getRequestProcessor();
+        try {
+            rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
+            error = !adapter.asyncDispatch(request, response, status);
+        } catch (InterruptedIOException e) {
+            error = true;
+        } catch (Throwable t) {
+            log.error(sm.getString("http11processor.request.process"), t);
+            // 500 - Internal Server Error
+            response.setStatus(500);
+            error = true;
+        }
+
+        rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
+
+        if (async) {
+            if (error) {
+                response.setStatus(500);
+                request.updateCounters();
+                recycle();
+                return SocketState.CLOSED;
+            } else {
+                return SocketState.LONG;
+            }
+        } else {
+            if (error) {
+                response.setStatus(500);
+            }
+            request.updateCounters();
+            recycle();
+            return SocketState.CLOSED;
+        }
+        
+    }
+
     
     public void endRequest() {
         
@@ -1223,12 +1261,16 @@ public class Http11AprProcessor implemen
             //TODO SERVLET3 - async
             async = true;
         } else if (actionCode == ActionCode.ACTION_ASYNC_COMPLETE) {
-          //TODO SERVLET3 - async
+          //TODO SERVLET3 - async - that is bit hacky -
             AtomicBoolean dispatch = (AtomicBoolean)param;
             RequestInfo rp = request.getRequestProcessor();
             if ( rp.getStage() != org.apache.coyote.Constants.STAGE_SERVICE ) { //async handling
                 dispatch.set(true);
-                // endpoint.processSocket(this.socket, SocketStatus.STOP);
+                try {
+                    asyncDispatch(SocketStatus.STOP); // What to do with return code ?
+                } catch (IOException ex) {
+                    error = true;
+                }
             } else {
                 dispatch.set(false);
             }



Mime
View raw message