You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2006/09/22 21:23:09 UTC
svn commit: r449059 -
/geronimo/sandbox/javaee5/modules-jee5/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java
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) {