geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r449059 - /geronimo/sandbox/javaee5/modules-jee5/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java
Date Fri, 22 Sep 2006 19:23:09 GMT
Author: djencks
Date: Fri Sep 22 12:23:09 2006
New Revision: 449059

URL: http://svn.apache.org/viewvc?view=rev&rev=449059
Log:
context listeners need jndi etc as well

Modified:
    geronimo/sandbox/javaee5/modules-jee5/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java

Modified: geronimo/sandbox/javaee5/modules-jee5/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/javaee5/modules-jee5/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java?view=diff&rev=449059&r1=449058&r2=449059
==============================================================================
--- geronimo/sandbox/javaee5/modules-jee5/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java
(original)
+++ geronimo/sandbox/javaee5/modules-jee5/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java
Fri Sep 22 12:23:09 2006
@@ -42,12 +42,12 @@
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
+import org.apache.geronimo.jetty6.handler.AbstractImmutableHandler;
 import org.apache.geronimo.jetty6.handler.ComponentContextHandler;
 import org.apache.geronimo.jetty6.handler.InstanceContextHandler;
 import org.apache.geronimo.jetty6.handler.JettySecurityHandler;
-import org.apache.geronimo.jetty6.handler.ThreadClassloaderHandler;
 import org.apache.geronimo.jetty6.handler.LifecycleCommand;
-import org.apache.geronimo.jetty6.handler.AbstractImmutableHandler;
+import org.apache.geronimo.jetty6.handler.ThreadClassloaderHandler;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.management.J2EEApplication;
@@ -297,12 +297,11 @@
         this.webAppContext.setClassLoader(webClassLoader);
         this.webAppContext.setWar(webAppRoot);
 
-        jettyContainer.addContext(this.webAppContext);
-        this.webAppContext.start();
+        getLifecycleChain().lifecycleCommand(new StartCommand());
     }
 
     public void doStop() throws Exception {
-        this.webAppContext.stop();
+        getLifecycleChain().lifecycleCommand(new StopCommand());
 
         // No more logging will occur for this ClassLoader. Inform the LogFactory to avoid
a memory leak.
         LogFactory.release(webClassLoader);
@@ -320,6 +319,22 @@
         log.warn("JettyWebAppContext failed");
     }
 
+    public class StartCommand implements LifecycleCommand {
+
+        public void lifecycleMethod() throws Exception {
+            //order seems backwards... .maybe container is calling start itself???
+            jettyContainer.addContext(webAppContext);
+            webAppContext.start();
+        }
+    }
+
+    public class StopCommand implements LifecycleCommand {
+
+        public void lifecycleMethod() throws Exception {
+            webAppContext.stop();
+            jettyContainer.removeContext(webAppContext);
+        }
+    }
     //pass through attributes.  They should be constructor params
 
     public void setLocaleEncodingMapping(Map localeEncodingMap) {



Mime
View raw message