geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r280321 - /geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
Date Mon, 12 Sep 2005 11:06:53 GMT
Author: jgenender
Date: Mon Sep 12 04:06:48 2005
New Revision: 280321

URL: http://svn.apache.org/viewcvs?rev=280321&view=rev
Log:
Fixed the undeploy of webcontexts - ensured proper destruction of the context.

Modified:
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=280321&r1=280320&r2=280321&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
(original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
Mon Sep 12 04:06:48 2005
@@ -27,6 +27,7 @@
 import org.apache.catalina.Engine;
 import org.apache.catalina.Realm;
 import org.apache.catalina.connector.Connector;
+import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.realm.JAASRealm;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -41,6 +42,8 @@
 import org.apache.geronimo.webservices.SoapHandler;
 import org.apache.geronimo.webservices.WebServiceContainer;
 
+
+
 /**
  * Apache Tomcat GBean
  *
@@ -169,6 +172,7 @@
             embedded.stop();
             embedded = null;
         }
+        
     }
 
     /**
@@ -266,8 +270,19 @@
     public void removeContext(TomcatContext ctx) {
         Context context = ctx.getContext();
 
-        if (context != null)
-            embedded.removeContext(context);
+        if (context != null){
+            if (context instanceof StandardContext){
+                StandardContext stdctx = (StandardContext)context;
+                try{
+                    stdctx.stop();
+                    stdctx.destroy();
+                } catch (Exception e){
+                    throw new RuntimeException(e);
+                }
+
+            }
+            context.getParent().removeChild(context);
+        }
 
     }
 
@@ -305,11 +320,12 @@
     public void removeWebService(String contextPath) {
         TomcatEJBWebServiceContext context = (TomcatEJBWebServiceContext) webServices.get(contextPath);
         try{
+            context.stop();
             context.destroy();
         } catch (Exception e){
             throw new RuntimeException(e);
         }
-        embedded.removeContext(context);
+        context.getParent().removeChild(context);
         webServices.remove(contextPath);
     }
 



Mime
View raw message