geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r918179 - in /geronimo/server/trunk/plugins/jetty8: geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/ geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/ geronimo-jetty8/src/main/java/org/apache/geronimo/jet...
Date Tue, 02 Mar 2010 21:04:46 GMT
Author: gawor
Date: Tue Mar  2 21:04:45 2010
New Revision: 918179

URL: http://svn.apache.org/viewvc?rev=918179&view=rev
Log:
revert most of 918095. it's causing some other problems with filters.

Removed:
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextManager.java
Modified:
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java?rev=918179&r1=918178&r2=918179&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
Tue Mar  2 21:04:45 2010
@@ -449,13 +449,6 @@
                 webModuleData.setAttribute("displayName", webApp.getDisplayNameArray()[0].getStringValue());
             }
 
-            // setup context manager
-            AbstractName contextManagerName = 
-                moduleContext.getNaming().createChildName(moduleName, "WebAppContextManager",
NameFactory.SERVICE_MODULE);
-            GBeanData contextManager = new GBeanData(contextManagerName, WebAppContextManager.class);
-            contextManager.setReferencePattern("webApp", moduleName);
-            moduleContext.addGBean(contextManager);
-            
             // configure context parameters.
             configureContextParams(webApp, webModuleData);
 
@@ -497,7 +490,7 @@
             Map<String, Set<String>> servletMappings = new HashMap<String,
Set<String>>();
             if (jspServlet != null) {
                 configureTagLibs(module, webApp, webModuleData, servletMappings, knownJspMappings,
jspServlet.getServletName());
-                GBeanData jspServletData = configureDefaultServlet(jspServlet, earContext,
moduleName, knownJspMappings, contextManager);
+                GBeanData jspServletData = configureDefaultServlet(jspServlet, earContext,
moduleName, knownJspMappings);
                 knownServletMappings.addAll(knownJspMappings);
                 module.getSharedContext().put(DEFAULT_JSP_SERVLET_KEY, jspServletData);
             }
@@ -511,6 +504,7 @@
 
             //be careful that the jsp servlet defaults don't override anything configured
in the app.
             if (jspServlet != null) {
+                //TODO rfc 66 make sure this has classSource set
                 GBeanData jspServletData = (GBeanData) module.getSharedContext().get(DEFAULT_JSP_SERVLET_KEY);
                 Set<String> jspMappings = (Set<String>) jspServletData.getAttribute("servletMappings");
                 jspMappings.removeAll(knownServletMappings);
@@ -559,12 +553,12 @@
 
             //add default servlets
             if (defaultServlets != null) {
-                addDefaultServletsGBeans(earContext, moduleContext, moduleName, knownServletMappings,
contextManager);
+                addDefaultServletsGBeans(earContext, moduleContext, moduleName, knownServletMappings);
             }
 
             //set up servlet gbeans.
             ServletType[] servletTypes = webApp.getServletArray();
-            addServlets(moduleName, webModule, servletTypes, servletMappings, moduleContext,
contextManager);
+            addServlets(moduleName, webModule, servletTypes, servletMappings, moduleContext);
 
             if (jettyWebApp.isSetSecurityRealmName()) {
                 configureSecurityRealm(earContext, webApp, jettyWebApp, webModuleData);
@@ -627,14 +621,14 @@
         earContext.addSecurityContext(policyContextID, componentPermissions);
     }
 
-    private void addDefaultServletsGBeans(EARContext earContext, EARContext moduleContext,
AbstractName moduleName, Set knownServletMappings, GBeanData contextManager) throws GBeanNotFoundException,
GBeanAlreadyExistsException {
+    private void addDefaultServletsGBeans(EARContext earContext, EARContext moduleContext,
AbstractName moduleName, Set knownServletMappings) throws GBeanNotFoundException, GBeanAlreadyExistsException
{
         for (Object defaultServlet : defaultServlets) {
-            GBeanData servletGBeanData = configureDefaultServlet(defaultServlet, earContext,
moduleName, knownServletMappings, contextManager);
+            GBeanData servletGBeanData = configureDefaultServlet(defaultServlet, earContext,
moduleName, knownServletMappings);
             moduleContext.addGBean(servletGBeanData);
         }
     }
 
-    private GBeanData configureDefaultServlet(Object defaultServlet, EARContext earContext,
AbstractName moduleName, Set knownServletMappings, GBeanData contextManager) throws GBeanNotFoundException,
GBeanAlreadyExistsException {
+    private GBeanData configureDefaultServlet(Object defaultServlet, EARContext earContext,
AbstractName moduleName, Set knownServletMappings) throws GBeanNotFoundException, GBeanAlreadyExistsException
{
         GBeanData servletGBeanData = getGBeanData(kernel, defaultServlet);
         AbstractName defaultServletObjectName = earContext.getNaming().createChildName(moduleName,
(String) servletGBeanData.getAttribute("servletName"), NameFactory.SERVLET);
         servletGBeanData.setAbstractName(defaultServletObjectName);
@@ -642,7 +636,6 @@
         Set<String> defaultServletMappings = new HashSet<String>((Collection<String>)
servletGBeanData.getAttribute("servletMappings"));
         defaultServletMappings.removeAll(knownServletMappings);
         servletGBeanData.setAttribute("servletMappings", defaultServletMappings);
-        contextManager.addDependency(defaultServletObjectName);
         return servletGBeanData;
     }
 
@@ -1036,8 +1029,7 @@
                              Module module,
                              ServletType[] servletTypes,
                              Map<String, Set<String>> servletMappings,
-                             EARContext moduleContext,
-                             GBeanData contextManager) throws DeploymentException {
+                             EARContext moduleContext) throws DeploymentException {
 
         // this TreeSet will order the ServletTypes based on whether
         // they have a load-on-startup element and what its value is
@@ -1059,7 +1051,6 @@
         for (Object aLoadOrder : loadOrder) {
             ServletType servletType = (ServletType) aLoadOrder;
             previousServlet = addServlet(webModuleName, module, previousServlet, servletType,
servletMappings, moduleContext);
-            contextManager.addDependency(previousServlet);
         }
     }
 
@@ -1103,6 +1094,7 @@
                 servletData.setAttribute("servletClass", servletClassName);
             } else {
                 servletData = new GBeanData(pojoWebServiceTemplate);
+                //TODO rfc 66 set classSource!
                 servletData.setAbstractName(servletAbstractName);
                 //let the web service builder deal with configuring the gbean with the web
service stack
 //                Object portInfo = portMap.get(servletName);
@@ -1136,7 +1128,7 @@
         if (null != previousServlet) {
             servletData.addDependency(previousServlet);
         }
-        
+
         //TODO in init param setter, add classpath if jspFile is not null.
         servletData.setReferencePattern("JettyServletRegistration", webModuleName);
         servletData.setAttribute("servletName", servletName);

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java?rev=918179&r1=918178&r2=918179&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java
Tue Mar  2 21:04:45 2010
@@ -70,7 +70,7 @@
 
 @GBean(name="Jetty WebApplication Context",
 j2eeType=NameFactory.WEB_MODULE)
-public class WebAppContextWrapper implements JettyServletRegistration, WebModule {
+public class WebAppContextWrapper implements GBeanLifecycle, JettyServletRegistration, WebModule
{
     private static final Logger log = LoggerFactory.getLogger(WebAppContextWrapper.class);
     public static final String GBEAN_ATTR_SESSION_TIMEOUT = "sessionTimeoutSeconds";
     public static final String GBEAN_REF_SESSION_HANDLER_FACTORY = "SessionHandlerFactory";
@@ -302,17 +302,15 @@
             }
         }
     }
-        
+
     public void doStart() throws Exception {
         // reset the classsloader... jetty likes to set it to null when stopping
-        webAppContext.setClassLoader(webClassLoader);
+        this.webAppContext.setClassLoader(webClassLoader);
         jettyContainer.addContext(webAppContext);
         webAppContext.start();
-        webAppContext.registerServletContext();
     }
 
     public void doStop() throws Exception {
-        webAppContext.unregisterServletContext();
         webAppContext.stop();
         jettyContainer.removeContext(webAppContext);
         log.debug("WebAppContextWrapper stopped");

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java?rev=918179&r1=918178&r2=918179&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
Tue Mar  2 21:04:45 2010
@@ -79,24 +79,18 @@
             integrationContext.restoreContext(context);
             integrationContext.completeTx(txActive, null);
         }
-    }
-
-    public void registerServletContext() {
         // for OSGi Web Applications support register ServletContext in service registry
         Bundle bundle = integrationContext.getBundle();
         if (WebApplicationUtils.isWebApplicationBundle(bundle)) {
             serviceRegistration = WebApplicationUtils.registerServletContext(bundle, getServletContext());
         }
     }
-    
-    public void unregisterServletContext() {
+
+    @Override
+    protected void doStop() throws Exception {
         if (serviceRegistration != null) {
             serviceRegistration.unregister();
         }
-    }
-    
-    @Override
-    protected void doStop() throws Exception {
         javax.naming.Context context = integrationContext.setContext();
         boolean txActive = integrationContext.isTxActive();
         SharedConnectorInstanceContext newContext = integrationContext.newConnectorInstanceContext(null);



Mime
View raw message