geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1196032 [2/2] - in /geronimo/server/trunk: ./ framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/ plugins/j2ee/geronimo-j2ee/ plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/ plugin...
Date Tue, 01 Nov 2011 14:49:31 GMT
Added: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OpenWebBeansWebModuleListener.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OpenWebBeansWebModuleListener.java?rev=1196032&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OpenWebBeansWebModuleListener.java (added)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OpenWebBeansWebModuleListener.java Tue Nov  1 14:49:29 2011
@@ -0,0 +1,89 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.openwebbeans;
+
+import java.util.concurrent.ScheduledExecutorService;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+
+import org.apache.geronimo.openejb.cdi.OpenWebBeansWebInitializer;
+import org.apache.geronimo.web.WebApplicationConstants;
+import org.apache.geronimo.web.WebModuleListener;
+import org.apache.webbeans.config.OWBLogConst;
+import org.apache.webbeans.config.WebBeansContext;
+import org.apache.webbeans.logger.WebBeansLogger;
+import org.apache.webbeans.spi.ContainerLifecycle;
+import org.apache.webbeans.spi.FailOverService;
+import org.apache.webbeans.util.WebBeansUtil;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class OpenWebBeansWebModuleListener implements WebModuleListener {
+
+    private static final WebBeansLogger logger = WebBeansLogger.getLogger(WebBeansConfigurationListener.class);
+
+    protected FailOverService failoverService;
+
+    /**Manages the container lifecycle*/
+    protected ContainerLifecycle lifeCycle = null;
+
+    protected WebBeansContext webBeansContext;
+
+    private ScheduledExecutorService service;
+
+    @Override
+    public void moduleInitialized(ServletContext servletContext) {
+        String webModuleName = (String) servletContext.getAttribute(WebApplicationConstants.WEB_APP_NAME);
+        OpenWebBeansWebAppContext webAppContext = OpenWebBeansWebAppContext.getOpenWebBeansWebAppContext(webModuleName);
+        // Initialize WebBeansContext in current servlet context
+        this.webBeansContext = webAppContext.getWebBeansContext();
+        //TODO Seems that only one cleanUp thread is required for the shareable WebBeansContext
+        service = OpenWebBeansWebInitializer.initializeServletContext(webBeansContext, servletContext);
+        //Register the interceptor to Holder instance
+        webAppContext.getHolder().addInterceptor(new OpenWebBeansHolderInterceptor(this.webBeansContext));
+        this.failoverService = webBeansContext.getService(FailOverService.class);
+        try {
+            this.lifeCycle = webBeansContext.getService(ContainerLifecycle.class);
+            //OpenWebBeansWebModuleListener will only manage the lifecycle if the WebBeansContext is standalone for the current web application
+            //Or the AppInfoGBean will maintain the sharelable WebBeansContext
+            if (lifeCycle instanceof org.apache.webbeans.web.lifecycle.WebContainerLifecycle || !webAppContext.isShareableWebBeansContext()) {
+                this.lifeCycle.startApplication(new ServletContextEvent(servletContext));
+            } else {
+                this.lifeCycle = null;
+            }
+        } catch (Exception e) {
+            logger.error(OWBLogConst.ERROR_0018, servletContext.getContextPath());
+            WebBeansUtil.throwRuntimeExceptions(e);
+        }
+    }
+
+    @Override
+    public void moduleDestoryed(ServletContext servletContext) {
+        if (this.lifeCycle != null) {
+            this.lifeCycle.stopApplication(new ServletContextEvent(servletContext));
+            this.lifeCycle = null;
+        }
+        if (service != null) {
+            service.shutdownNow();
+        }
+        this.webBeansContext = null;
+    }
+
+}

Copied: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebApplicationNameBasedSingletonService.java (from r1195653, geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/WebApplicationIdentity.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebApplicationNameBasedSingletonService.java?p2=geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebApplicationNameBasedSingletonService.java&p1=geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/WebApplicationIdentity.java&r1=1195653&r2=1196032&rev=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/WebApplicationIdentity.java (original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebApplicationNameBasedSingletonService.java Tue Nov  1 14:49:29 2011
@@ -15,20 +15,27 @@
  *  limitations under the License.
  */
 
-package org.apache.geronimo.web;
+package org.apache.geronimo.openwebbeans;
+
+import org.apache.geronimo.web.WebApplicationName;
+import org.apache.webbeans.config.WebBeansContext;
+import org.apache.webbeans.spi.SingletonService;
 
 /**
  * @version $Rev$ $Date$
  */
-public class WebApplicationIdentity {
-
-    private static ThreadLocal<String> IDENTITY = new ThreadLocal<String>();
+public class WebApplicationNameBasedSingletonService implements SingletonService<WebBeansContext> {
 
-    public static void setIdentity(String identity) {
-        IDENTITY.set(identity);
+    @Override
+    public WebBeansContext get(Object key) {
+        String webApplicationName = WebApplicationName.getName();
+        if (webApplicationName == null) {
+            return null;
+        }
+        return OpenWebBeansWebAppContext.getOpenWebBeansWebAppContext(webApplicationName).getWebBeansContext();
     }
 
-    public static String getIdentity() {
-        return IDENTITY.get();
+    @Override
+    public void clear(Object key) {
     }
 }

Copied: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebBeansConfigurationListener.java (from r1195653, geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/cdi/WebBeansConfigurationListener.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebBeansConfigurationListener.java?p2=geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebBeansConfigurationListener.java&p1=geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/cdi/WebBeansConfigurationListener.java&r1=1195653&r2=1196032&rev=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/cdi/WebBeansConfigurationListener.java (original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebBeansConfigurationListener.java Tue Nov  1 14:49:29 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.geronimo.openejb.cdi;
+package org.apache.geronimo.openwebbeans;
 
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.context.SessionScoped;
@@ -32,6 +32,7 @@ import javax.servlet.http.HttpSessionAct
 import javax.servlet.http.HttpSessionEvent;
 import javax.servlet.http.HttpSessionListener;
 
+import org.apache.geronimo.web.WebApplicationConstants;
 import org.apache.webbeans.component.InjectionPointBean;
 import org.apache.webbeans.config.OWBLogConst;
 import org.apache.webbeans.config.WebBeansContext;
@@ -64,33 +65,18 @@ public class WebBeansConfigurationListen
     protected WebBeansContext webBeansContext;
 
     /**
-     * Default constructor
-     */
-    public WebBeansConfigurationListener()
-    {
-        this.webBeansContext = WebBeansContext.getInstance();
-        this.failoverService = webBeansContext.getService(FailOverService.class);     
-    }
-
-
-    /**
      * {@inheritDoc}
      */
-    public void contextInitialized(ServletContextEvent event)
-    {
-        try
-        {
-            this.lifeCycle = webBeansContext.getService(ContainerLifecycle.class);
-            if (lifeCycle instanceof org.apache.webbeans.web.lifecycle.WebContainerLifecycle) {
-            	this.lifeCycle.startApplication(event);
-            } else {
-            	this.lifeCycle = null;
-            }
-        }
-        catch (Exception e)
-        {
-             logger.error(OWBLogConst.ERROR_0018, event.getServletContext().getContextPath());
-             WebBeansUtil.throwRuntimeExceptions(e);
+    public void contextInitialized(ServletContextEvent event) {
+        String webModuleName = (String) event.getServletContext().getAttribute(WebApplicationConstants.WEB_APP_NAME);
+        OpenWebBeansWebAppContext webAppContext = OpenWebBeansWebAppContext.getOpenWebBeansWebAppContext(webModuleName);
+        this.webBeansContext = webAppContext.getWebBeansContext();
+        this.failoverService = webBeansContext.getService(FailOverService.class);
+        this.lifeCycle = webBeansContext.getService(ContainerLifecycle.class);
+        if (lifeCycle instanceof org.apache.webbeans.web.lifecycle.WebContainerLifecycle) {
+            this.lifeCycle.startApplication(event);
+        } else {
+            this.lifeCycle = null;
         }
     }
 
@@ -98,12 +84,8 @@ public class WebBeansConfigurationListen
     /**
      * {@inheritDoc}
      */
-    public void contextDestroyed(ServletContextEvent event)
-    {
-        if (this.lifeCycle != null) {
-            this.lifeCycle.stopApplication(event);
-            this.lifeCycle = null;
-        }
+    public void contextDestroyed(ServletContextEvent event) {
+        this.lifeCycle = null;
         this.webBeansContext = null;
     }
 
@@ -217,7 +199,7 @@ public class WebBeansConfigurationListen
         ConversationManager conversationManager = webBeansContext.getConversationManager();
         conversationManager.destroyConversationContextWithSessionId(event.getSession().getId());
     }
-    
+
 
     @Override
     public void sessionWillPassivate(HttpSessionEvent event)

Modified: geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/pom.xml?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/pom.xml (original)
+++ geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/pom.xml Tue Nov  1 14:49:29 2011
@@ -45,12 +45,6 @@
             <type>car</type>
         </dependency>
 
-
-        <dependency>
-            <groupId>org.apache.openwebbeans</groupId>
-            <artifactId>openwebbeans-jsf</artifactId>
-        </dependency>
-
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>openejb</artifactId>
@@ -59,68 +53,15 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-openwebbeans-builder</artifactId>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>openwebbeans</artifactId>
             <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-annotation_1.1_spec</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-atinject_1.0_spec</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-el_2.2_spec</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-interceptor_1.1_spec</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jaxws_2.2_spec</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jaxrs_1.1_spec</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jcdi_1.0_spec</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jpa_2.0_spec</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jsp_2.2_spec</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jta_1.1_spec</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-servlet_3.0_spec</artifactId>
+            <type>car</type>
         </dependency>
 
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-validation_1.0_spec</artifactId>
+            <groupId>org.apache.openwebbeans</groupId>
+            <artifactId>openwebbeans-jsf</artifactId>
         </dependency>
 
         <dependency>
@@ -129,20 +70,10 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.geronimo.bundles</groupId>
-            <artifactId>jstl</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.commons-codec</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geronimo.bundles</groupId>
-            <artifactId>commons-digester</artifactId>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-openwebbeans-builder</artifactId>
+            <version>${project.version}</version>
         </dependency>
-
-
     </dependencies>
 
     <build>

Modified: geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/src/main/plan/plan.xml?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/src/main/plan/plan.xml Tue Nov  1 14:49:29 2011
@@ -29,7 +29,7 @@
                 <dependencies>
                     <dependency>
                         <groupId>org.apache.geronimo.configs</groupId>
-                        <artifactId>openejb</artifactId>
+                        <artifactId>openwebbeans</artifactId>
                         <type>car</type>
                     </dependency>
                     <!-- The dependencies below is to help deployer to find configuration resources while the deployed application is of WAB type GERONIMO-5916 -->

Modified: geronimo/server/trunk/plugins/openwebbeans/openwebbeans/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/openwebbeans/pom.xml?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/openwebbeans/pom.xml (original)
+++ geronimo/server/trunk/plugins/openwebbeans/openwebbeans/pom.xml Tue Nov  1 14:49:29 2011
@@ -33,19 +33,7 @@
     <name>Geronimo Plugins, OpenWebBeans :: OpenWebBeans</name>
     <packaging>car</packaging>
 
-    <description>Geronimo OpenWebBeans 299 integration</description>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.apache.geronimo.plugins</groupId>
-                <artifactId>myfaces</artifactId>
-                <version>${project.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
+    <description>Geronimo OpenWebBeans 299 integration</description>    
 
     <dependencies>
         <dependency>
@@ -63,16 +51,164 @@
             <version>${project.version}</version>
             <type>car</type>
         </dependency>
-        
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>openejb</artifactId>
+            <type>car</type>
+            <version>${project.version}</version>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-openwebbeans</artifactId>
             <version>${project.version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-j2ee</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-naming</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-security</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-annotation_1.1_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-atinject_1.0_spec</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-el_2.2_spec</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-interceptor_1.1_spec</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jaxws_2.2_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jcdi_1.0_spec</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jsp_2.2_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jta_1.1_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_3.0_spec</artifactId>
+        </dependency>        
+        
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-validation_1.0_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.bundles</groupId>
+            <artifactId>jstl</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.commons-codec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.bundles</groupId>
+            <artifactId>commons-digester</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.bundles</groupId>
+            <artifactId>commons-discovery</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.dom4j</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.javassist</artifactId>
+        </dependency>
+        
         <dependency>
             <groupId>org.apache.geronimo.bundles</groupId>
-            <artifactId>myfaces-bundle</artifactId>
+            <artifactId>scannotation</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.openwebbeans</groupId>
+            <artifactId>openwebbeans-spi</artifactId>           
+        </dependency>         
+    
+        <dependency>
+            <groupId>org.apache.openwebbeans</groupId>
+            <artifactId>openwebbeans-web</artifactId>         
+        </dependency>              
+
+        <dependency>
+            <groupId>org.apache.openwebbeans</groupId>
+            <artifactId>openwebbeans-resource</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.openwebbeans</groupId>
+            <artifactId>openwebbeans-impl</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.openwebbeans</groupId>
+            <artifactId>openwebbeans-ee</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-openejb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
         <dependency>
             <groupId>commons-collections</groupId>
             <artifactId>commons-collections</artifactId>

Modified: geronimo/server/trunk/plugins/openwebbeans/openwebbeans/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/openwebbeans/src/main/plan/plan.xml?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/openwebbeans/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/openwebbeans/openwebbeans/src/main/plan/plan.xml Tue Nov  1 14:49:29 2011
@@ -20,6 +20,6 @@
 
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
 
-    <gbean name="OWBSingletonServiceInitializer" class="org.apache.geronimo.openejb.cdi.SingletonServiceInitializerGBean"/>
+    <gbean name="OWBSingletonServiceInitializer" class="org.apache.geronimo.openwebbeans.OpenWebBeansSystemInitializer"/>
 
 </module>

Modified: geronimo/server/trunk/plugins/openwebbeans/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/pom.xml?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/pom.xml (original)
+++ geronimo/server/trunk/plugins/openwebbeans/pom.xml Tue Nov  1 14:49:29 2011
@@ -91,9 +91,9 @@
     </dependencyManagement>
 
     <modules>
-        <!--<module>geronimo-openwebbeans</module>-->
+        <module>geronimo-openwebbeans</module>
         <module>geronimo-openwebbeans-builder</module>
-        <!--<module>openwebbeans</module>-->
+        <module>openwebbeans</module>
         <module>openwebbeans-deployer</module>
     </modules>
 

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Tue Nov  1 14:49:29 2011
@@ -708,11 +708,6 @@ public class TomcatModuleBuilder extends
 //                    webModuleData.setReferencePattern("SharedOwbContext", name);
 //                }
 //            }
-            //This shares a single OWB context for the whole ear
-            AbstractName name = EARContext.APPINFO_GBEAN_NAME_KEY.get(earContext.getGeneralData());
-            if (name != null) {
-                webModuleData.setReferencePattern("SharedOwbContext", name);
-            }
 
             if(tomcatWebApp.isSetSecurityRealmName()) {
                 webModuleData.setReferencePattern("applicationPolicyConfigurationManager", EARContext.JACC_MANAGER_NAME_KEY.get(earContext.getGeneralData()));

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/pom.xml?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/pom.xml (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/pom.xml Tue Nov  1 14:49:29 2011
@@ -60,35 +60,6 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-openejb</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.openejb</groupId>
-            <artifactId>openejb-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <!-- dependency>
-            <groupId>org.apache.openwebbeans</groupId>
-            <artifactId>openwebbeans-jsf</artifactId>
-            <version>${openwebbeansVersion}</version>
-            <scope>test</scope>
-        </dependency-->
-        <dependency>
-            <groupId>org.apache.openwebbeans</groupId>
-            <artifactId>openwebbeans-web</artifactId>
-            <version>${openwebbeansVersion}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.openwebbeans</groupId>
-            <artifactId>openwebbeans-ejb</artifactId>
-            <version>${openwebbeansVersion}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
             <groupId>org.apache.xbean</groupId>
             <artifactId>xbean-bundleutils</artifactId>
         </dependency>

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java Tue Nov  1 14:49:29 2011
@@ -73,9 +73,9 @@ import org.apache.catalina.ha.CatalinaCl
 import org.apache.catalina.valves.ValveBase;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.common.GeronimoSecurityException;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.util.FileUtils;
 import org.apache.geronimo.kernel.util.IOUtils;
-import org.apache.geronimo.openejb.cdi.OpenWebBeansWebInitializer;
 import org.apache.geronimo.osgi.web.WebApplicationUtils;
 import org.apache.geronimo.security.ContextManager;
 import org.apache.geronimo.security.jaas.ConfigurationFactory;
@@ -86,7 +86,6 @@ import org.apache.geronimo.tomcat.interc
 import org.apache.geronimo.tomcat.interceptor.BeforeAfterContext;
 import org.apache.geronimo.tomcat.interceptor.ComponentContextBeforeAfter;
 import org.apache.geronimo.tomcat.interceptor.InstanceContextBeforeAfter;
-import org.apache.geronimo.tomcat.interceptor.OWBBeforeAfter;
 import org.apache.geronimo.tomcat.interceptor.PolicyContextBeforeAfter;
 import org.apache.geronimo.tomcat.interceptor.UserTransactionBeforeAfter;
 import org.apache.geronimo.tomcat.interceptor.WebApplicationIdentityBeforeAfter;
@@ -96,6 +95,7 @@ import org.apache.geronimo.tomcat.util.S
 import org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve;
 import org.apache.geronimo.tomcat.valve.ProtectedTargetValve;
 import org.apache.geronimo.web.WebApplicationConstants;
+import org.apache.geronimo.web.WebModuleListener;
 import org.apache.geronimo.web.info.WebAppInfo;
 import org.apache.geronimo.web.security.SpecSecurityBuilder;
 import org.apache.geronimo.web.security.WebSecurityConstraintStore;
@@ -105,11 +105,12 @@ import org.apache.geronimo.webservices.W
 import org.apache.naming.resources.FileDirContext;
 import org.apache.tomcat.InstanceManager;
 import org.apache.tomcat.util.IntrospectionUtils;
-import org.apache.webbeans.config.WebBeansContext;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -121,6 +122,8 @@ public class GeronimoStandardContext ext
 
     private static final boolean allowLinking = Boolean.getBoolean("org.apache.geronimo.tomcat.GeronimoStandardContext.allowLinking");
 
+    private static final Logger logger = LoggerFactory.getLogger(GeronimoStandardContext.class);
+
     private Subject defaultSubject = null;
     private RunAsSource runAsSource = RunAsSource.NULL;
 
@@ -140,6 +143,8 @@ public class GeronimoStandardContext ext
     private Bundle bundle;
     private ServiceRegistration serviceRegistration;
 
+    private List webModuleListeners;
+
     private ThreadLocal<Stack<BeforeAfterContext>> beforeAfterContexts = new ThreadLocal<Stack<BeforeAfterContext>>() {
 
         @Override
@@ -256,6 +261,25 @@ public class GeronimoStandardContext ext
                     }
                 }
             }
+
+            //Get WebModuleListener List
+            List<String> webModuleListenerClassNames = (List<String>) tomcatWebAppContext.getDeploymentAttribute(WebApplicationConstants.WEB_MODULE_LISTENERS);
+            if (webModuleListenerClassNames != null && webModuleListenerClassNames.size() > 0) {
+                webModuleListeners = new ArrayList(webModuleListenerClassNames.size());
+                for (String webModuleListenerClassName : webModuleListenerClassNames) {
+                    try {
+                        Class<?> cls = bundle.loadClass(webModuleListenerClassName);
+                        Object webModuleListener = cls.newInstance();
+                        webModuleListeners.add(webModuleListener);
+                    } catch (ClassNotFoundException e) {
+                        logger.warn("Unable to load the listener class" + webModuleListenerClassName, e);
+                    } catch (InstantiationException e) {
+                        logger.warn("Unable to create the listener instance " + webModuleListenerClassName, e);
+                    } catch (IllegalAccessException e) {
+                        logger.warn("Unable to create the listener instance " + webModuleListenerClassName, e);
+                    }
+                }
+            }
         }
 
         int index = 0;
@@ -270,17 +294,6 @@ public class GeronimoStandardContext ext
             interceptor = new ComponentContextBeforeAfter(interceptor, index++, enc);
         }
 
-        WebBeansContext owbContext = ctx.getOWBContext();
-        if (owbContext == null) {
-            //hopefully for tests only
-            owbContext = OpenWebBeansWebInitializer.newWebBeansContext(null);
-        }
-        OpenWebBeansWebInitializer.initializeServletContext(owbContext, servletContext);
-        if (getInstanceManager() instanceof TomcatInstanceManager) {
-            ((TomcatInstanceManager) getInstanceManager()).setOWBContext(owbContext);
-        }
-        interceptor = new OWBBeforeAfter(interceptor, index++, servletContext, owbContext);
-
         //Set a PolicyContext BeforeAfter
         SecurityHolder securityHolder = ctx.getSecurityHolder();
         if (securityHolder != null) {
@@ -309,7 +322,7 @@ public class GeronimoStandardContext ext
         //Set a UserTransactionBeforeAfter
         interceptor = new UserTransactionBeforeAfter(interceptor, index++, ctx.getUserTransaction());
 
-        interceptor = new WebApplicationIdentityBeforeAfter(interceptor, index++, ctx.getAbstractName().toString());
+        interceptor = new WebApplicationIdentityBeforeAfter(interceptor, index++, ctx.getAbstractName().getNameProperty(NameFactory.J2EE_NAME));
 
         addValve(new ProtectedTargetValve());
 
@@ -838,6 +851,22 @@ public class GeronimoStandardContext ext
         @Override
         public void invoke(Request request, Response response) throws IOException, ServletException {
             if (request == null && response == null) {
+                //Execute WebModuleListeners
+                ClassLoader oldClassLoader = null;
+                try {
+                    oldClassLoader = bindThread();
+                    if (webModuleListeners != null) {
+                        for (Object webModuleListener : webModuleListeners) {
+                            if (webModuleListener instanceof WebModuleListener) {
+                                ((WebModuleListener) webModuleListener).moduleInitialized(getServletContext());
+                            } else {
+                                logger.warn("Invalid WebModuleListener " + webModuleListener.getClass().getName());
+                            }
+                        }
+                    }
+                } finally {
+                    unbindThread(oldClassLoader);
+                }
                 try {
                     GeronimoStandardContext.super.startInternal();
                 } catch (LifecycleException e) {
@@ -853,6 +882,25 @@ public class GeronimoStandardContext ext
         }
     }
 
+    @Override
+    protected synchronized void stopInternal() throws LifecycleException {
+        super.stopInternal();
+        ClassLoader oldClassLoader = null;
+        try {
+            oldClassLoader = bindThread();
+            if (webModuleListeners != null) {
+                for (Object webModuleListener : webModuleListeners) {
+                    if (webModuleListener instanceof WebModuleListener) {
+                        ((WebModuleListener) webModuleListener).moduleDestoryed(getServletContext());
+                    } else {
+                        logger.warn("Invalid WebModuleListener " + webModuleListener.getClass().getName());
+                    }
+                }
+            }
+        } finally {
+            unbindThread(oldClassLoader);
+        }
+    }
 
     public BeforeAfter getBeforeAfter() {
         return beforeAfter;

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java Tue Nov  1 14:49:29 2011
@@ -16,13 +16,11 @@
  */
 package org.apache.geronimo.tomcat;
 
-import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
 import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
 import javax.naming.NamingException;
 import javax.security.auth.Subject;
 
@@ -41,8 +39,6 @@ import org.apache.geronimo.gbean.annotat
 import org.apache.geronimo.gbean.annotation.ParamReference;
 import org.apache.geronimo.gbean.annotation.ParamSpecial;
 import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
-import org.apache.geronimo.j2ee.annotation.Holder;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.geronimo.NetworkConnector;
 import org.apache.geronimo.management.geronimo.WebManager;
 import org.apache.geronimo.osgi.web.WABApplicationConstants;
@@ -53,7 +49,6 @@ import org.apache.geronimo.web.WebApplic
 import org.apache.geronimo.web.info.WebAppInfo;
 import org.apache.geronimo.webservices.SoapHandler;
 import org.apache.geronimo.webservices.WebServiceContainer;
-import org.apache.tomcat.InstanceManager;
 import org.apache.xbean.osgi.bundle.util.BundleUtils;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -266,7 +261,7 @@ public class TomcatContainer implements 
      * @see org.apache.catalina.Host
      */
     public void addContext(TomcatContext contextInfo) throws Exception {
-        //Tomcat internally use empty string to represent the root context        
+        //Tomcat internally use empty string to represent the root context
         Context context = createContext(contextInfo.getContextPath().equals("/") ? "" : contextInfo.getContextPath(), contextInfo.getClassLoader(), contextInfo.getWebAppInfo());
         //Was a virtual server defined?
         String virtualServer = contextInfo.getVirtualServer();

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContext.java?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContext.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContext.java Tue Nov  1 14:49:29 2011
@@ -36,7 +36,6 @@ import org.apache.geronimo.tomcat.util.S
 import org.apache.geronimo.web.info.WebAppInfo;
 import org.apache.geronimo.webservices.WebServiceContainer;
 import org.apache.tomcat.InstanceManager;
-import org.apache.webbeans.config.WebBeansContext;
 import org.osgi.framework.Bundle;
 
 /**
@@ -103,7 +102,5 @@ public interface TomcatContext {
 
     Map<String, String> getContextAttributes();
 
-    WebBeansContext getOWBContext();
-
     AbstractName getAbstractName();
 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java Tue Nov  1 14:49:29 2011
@@ -56,7 +56,7 @@ public class TomcatEJBWebServiceContext 
 
         //Create a dummy wrapper
         Wrapper wrapper = this.createWrapper();
-        String name = System.currentTimeMillis() + "";
+        String name = String.valueOf(System.currentTimeMillis());
         wrapper.setName(name);
         this.addChild(wrapper);
         this.addServletMapping("/*", name);

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatInstanceManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatInstanceManager.java?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatInstanceManager.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatInstanceManager.java Tue Nov  1 14:49:29 2011
@@ -22,15 +22,12 @@ package org.apache.geronimo.tomcat;
 
 
 import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
 
 import javax.naming.Context;
 import javax.naming.NamingException;
 
-import org.apache.tomcat.InstanceManager;
 import org.apache.geronimo.j2ee.annotation.Holder;
-import org.apache.geronimo.openejb.cdi.GeronimoSingletonService;
-import org.apache.webbeans.config.WebBeansContext;
+import org.apache.tomcat.InstanceManager;
 
 /**
  * @version $Rev$ $Date$
@@ -40,7 +37,6 @@ public class TomcatInstanceManager imple
     private final Holder holder;
     private final ClassLoader classLoader;
     private final Context context;
-    private WebBeansContext owbContext ;
 
     public TomcatInstanceManager(Holder holder, ClassLoader classLoader, Context context) {
         this.holder = holder;
@@ -49,9 +45,7 @@ public class TomcatInstanceManager imple
     }
 
     public Object newInstance(String fqcn, ClassLoader classLoader) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException {
-        WebBeansContext oldContext = null;
         try {
-            oldContext = GeronimoSingletonService.contextEntered(owbContext);
             return holder.newInstance(fqcn, classLoader, context);
         } catch (IllegalAccessException e) {
             throw e;
@@ -59,18 +53,14 @@ public class TomcatInstanceManager imple
             throw e;
         } catch (Exception e) {
             throw (InstantiationException) new InstantiationException().initCause(e);
-        } finally {
-            GeronimoSingletonService.contextExited(oldContext);
         }
     }
 
     public Object newInstance(String className) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException {
-        WebBeansContext oldContext = null;
         try {
             //TODO Specification 13.4.1 p125
             //The @ServletSecurity annotation is not applied to the url-patterns of a ServletRegistration created using the addServlet(String, Servlet)  method of the ServletContext interface,
             //unless the Servlet was constructed by the createServlet method of the ServletContext interface.
-            oldContext = GeronimoSingletonService.contextEntered(owbContext);
             return holder.newInstance(className, classLoader, context);
         } catch (IllegalAccessException e) {
             throw e;
@@ -78,20 +68,14 @@ public class TomcatInstanceManager imple
             throw e;
         } catch (Exception e) {
             throw (InstantiationException) new InstantiationException().initCause(e);
-        }finally {
-            GeronimoSingletonService.contextExited(oldContext);
         }
     }
 
     public void destroyInstance(Object o) throws IllegalAccessException, InvocationTargetException {
-        WebBeansContext oldContext = null;
         try {
-            oldContext = GeronimoSingletonService.contextEntered(owbContext);
             holder.destroyInstance(o);
         } catch (Exception e) {
             throw new InvocationTargetException(e, "Attempted to destroy instance");
-        }finally {
-            GeronimoSingletonService.contextExited(oldContext);
         }
     }
 
@@ -102,8 +86,4 @@ public class TomcatInstanceManager imple
         //For a, we should have done the resource injections, for b, we are not need to do the resource injections
         //Correct me if I miss anything !
     }
-
-    public void setOWBContext(WebBeansContext owbContext) {
-        this.owbContext = owbContext;
-    }
 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java Tue Nov  1 14:49:29 2011
@@ -55,12 +55,10 @@ import org.apache.geronimo.j2ee.jndi.Con
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.ObjectNameUtil;
-import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
 import org.apache.geronimo.management.StatisticsProvider;
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebModule;
-import org.apache.geronimo.openejb.cdi.SharedOwbContext;
 import org.apache.geronimo.security.jaas.ConfigurationFactory;
 import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
 import org.apache.geronimo.security.jacc.RunAsSource;
@@ -73,7 +71,6 @@ import org.apache.geronimo.webservices.W
 import org.apache.geronimo.webservices.WebServiceContainerFactory;
 import org.apache.naming.resources.DirContextURLStreamHandler;
 import org.apache.tomcat.InstanceManager;
-import org.apache.webbeans.config.WebBeansContext;
 import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -121,7 +118,7 @@ public class TomcatWebAppContext impleme
     private final Map<String, Object> deploymentAttributes;
     private final ApplicationPolicyConfigurationManager applicationPolicyConfigurationManager;
     private final Map<String,String> contextAttributes;
-    private final WebBeansContext owbContext;
+    //private final WebBeansContext owbContext;
     private final InstanceManager instanceManager;
     private final AbstractName abName;
 
@@ -169,7 +166,6 @@ public class TomcatWebAppContext impleme
             @ParamAttribute(name = "deploymentAttributes") Map<String, Object> deploymentAttributes,
             @ParamAttribute(name = "webAppInfo") WebAppInfo webAppInfo,
             @ParamAttribute(name = "contextAttributes") Map<String, String> contextAttributes,
-            @ParamReference(name = "SharedOwbContext")SharedOwbContext sharedOwbContext,
             @ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel,
             @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abName)
             throws Exception {
@@ -284,7 +280,6 @@ public class TomcatWebAppContext impleme
             j2EEServer = null;
             j2EEApplication = null;
         }
-        owbContext = sharedOwbContext == null? null: sharedOwbContext.getOWBContext();
         instanceManager = new TomcatInstanceManager(this.holder, classLoader, componentContext);
     }
 
@@ -355,10 +350,6 @@ public class TomcatWebAppContext impleme
         return docBase;
     }
 
-//    public void setDocBase(String docBase) {
-//        this.docBase = docBase;
-//    }
-
     public UserTransaction getUserTransaction() {
         return userTransaction;
     }
@@ -565,11 +556,6 @@ public class TomcatWebAppContext impleme
         return contextAttributes;
     }
 
-    @Override
-    public WebBeansContext getOWBContext() {
-        return owbContext;
-    }
-
     public void doStart() throws Exception {
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         try {
@@ -584,9 +570,12 @@ public class TomcatWebAppContext impleme
                 throw new IllegalStateException("JNDI environment was not set up correctly due to previous error");
             }
             DirContextURLStreamHandler.bind(classLoader, resources);
-            if (context instanceof StandardContext)
+            if (context instanceof StandardContext) {
                 statsProvider = new ModuleStats((StandardContext) context);
-            log.debug("TomcatWebAppContext started for " + contextPath);
+            }
+            if (log.isDebugEnabled()) {
+                log.debug("TomcatWebAppContext started for " + contextPath);
+            }
         } finally {
             Thread.currentThread().setContextClassLoader(cl);
         }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/WebApplicationIdentityBeforeAfter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/WebApplicationIdentityBeforeAfter.java?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/WebApplicationIdentityBeforeAfter.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/WebApplicationIdentityBeforeAfter.java Tue Nov  1 14:49:29 2011
@@ -20,7 +20,7 @@ package org.apache.geronimo.tomcat.inter
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
-import org.apache.geronimo.web.WebApplicationIdentity;
+import org.apache.geronimo.web.WebApplicationName;
 
 /**
  * @version $Rev$ $Date$
@@ -42,15 +42,15 @@ public class WebApplicationIdentityBefor
     @Override
     public void before(BeforeAfterContext beforeAfterContext, ServletRequest httpRequest, ServletResponse httpResponse, int dispatch) {
         try {
-            beforeAfterContext.contexts[index] = WebApplicationIdentity.getIdentity();
-            WebApplicationIdentity.setIdentity(identity);
+            beforeAfterContext.contexts[index] = WebApplicationName.getName();
+            WebApplicationName.setName(identity);
             beforeAfterContext.clearRequiredFlags[index] = true;
             if (next != null) {
                 next.before(beforeAfterContext, httpRequest, httpResponse, dispatch);
             }
         } catch (RuntimeException e) {
             if (beforeAfterContext.clearRequiredFlags[index]) {
-                WebApplicationIdentity.setIdentity((String) beforeAfterContext.contexts[index]);
+                WebApplicationName.setName((String) beforeAfterContext.contexts[index]);
                 beforeAfterContext.clearRequiredFlags[index] = false;
             }
             throw e;
@@ -65,7 +65,7 @@ public class WebApplicationIdentityBefor
             }
         } finally {
             if (beforeAfterContext.clearRequiredFlags[index]) {
-                WebApplicationIdentity.setIdentity((String) beforeAfterContext.contexts[index]);
+                WebApplicationName.setName((String) beforeAfterContext.contexts[index]);
                 beforeAfterContext.clearRequiredFlags[index] = false;
             }
         }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java Tue Nov  1 14:49:29 2011
@@ -63,7 +63,6 @@ import org.apache.geronimo.web.WebApplic
 import org.apache.geronimo.web.info.ServletInfo;
 import org.apache.geronimo.web.info.WebAppInfo;
 import org.apache.karaf.jaas.boot.ProxyLoginModule;
-import org.apache.webbeans.config.WebBeansFinder;
 import org.osgi.framework.Bundle;
 
 
@@ -94,7 +93,7 @@ public abstract class AbstractWebModuleT
     }
 
     protected TomcatWebAppContext setUpInsecureAppContext(String relativeWebAppRoot, URL configurationBaseURL, SecurityHolder securityHolder, RunAsSource runAsSource, ObjectRetriever tomcatRealm, ValveGBean valveChain, WebAppInfo webAppInfo) throws Exception {
-        WebBeansFinder.clearInstances(getClass().getClassLoader());
+        //WebBeansFinder.clearInstances(getClass().getClassLoader());
         configurationBaseURL = cl.getResource("deployables/");
         //Setup default JSP Factory
         Class.forName("org.apache.jasper.compiler.JspRuntimeContext");
@@ -144,7 +143,6 @@ public abstract class AbstractWebModuleT
                 webAppInfo, //webAppinfo
                 new HashMap<String, String>(), // Map<String,String> contextAttributes;
                 null,
-                null,
                 new AbstractName(new URI("default/test/1.0/war?J2EEApplication=null,j2eeType=WebModule,name=default/test/1.0/war")));  //kernel
         app.doStart();
         return app;

Modified: geronimo/server/trunk/plugins/tomcat/tomcat7/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/tomcat7/pom.xml?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/tomcat7/pom.xml (original)
+++ geronimo/server/trunk/plugins/tomcat/tomcat7/pom.xml Tue Nov  1 14:49:29 2011
@@ -71,12 +71,12 @@
             <version>${project.version}</version>
         </dependency>
         
-        <dependency>
+        <!--dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>openejb</artifactId>
             <version>${project.version}</version>
             <type>car</type>
-        </dependency>
+        </dependency-->
 
         <!-- Required because tomcat STARTS its default web.xml which has a jasper servlet in it -->
         <dependency>

Modified: geronimo/server/trunk/plugins/wink/geronimo-wink-builder/src/main/java/org/apache/geronimo/wink/deployment/WinkModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/wink/geronimo-wink-builder/src/main/java/org/apache/geronimo/wink/deployment/WinkModuleBuilderExtension.java?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/wink/geronimo-wink-builder/src/main/java/org/apache/geronimo/wink/deployment/WinkModuleBuilderExtension.java (original)
+++ geronimo/server/trunk/plugins/wink/geronimo-wink-builder/src/main/java/org/apache/geronimo/wink/deployment/WinkModuleBuilderExtension.java Tue Nov  1 14:49:29 2011
@@ -58,7 +58,6 @@ import org.apache.wink.server.internal.s
 import org.apache.xbean.finder.BundleAssignableClassFinder;
 import org.apache.xbean.finder.ClassFinder;
 import org.apache.xbean.osgi.bundle.util.BundleClassFinder;
-import org.apache.xbean.osgi.bundle.util.BundleClassLoader;
 import org.apache.xbean.osgi.bundle.util.ClassDiscoveryFilter;
 import org.apache.xbean.osgi.bundle.util.DiscoveryRange;
 import org.osgi.framework.Bundle;
@@ -195,7 +194,6 @@ public class WinkModuleBuilderExtension 
          * ...
          */
         Class<? extends Application> applicationClass;
-        BundleClassLoader bundleClassLoader = new BundleClassLoader(bundle);
         for (Servlet servlet : webApp.getServlet()) {
             List<ParamValue> params = servlet.getInitParam();
             for (ParamValue parm : params) {
@@ -207,7 +205,7 @@ public class WinkModuleBuilderExtension 
                         applicationClass = clazz;
                         Class<?> servletClass = null;
                         try {
-                            servletClass = bundleClassLoader.loadClass(servlet.getServletClass());
+                            servletClass = bundle.loadClass(servlet.getServletClass());
                         } catch (ClassNotFoundException e) {
                             log.warn("failed to load servlet class:" + servlet.getServletClass());
                         }

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?rev=1196032&r1=1196031&r2=1196032&view=diff
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Tue Nov  1 14:49:29 2011
@@ -1845,10 +1845,6 @@ only found in cxf
                         <groupId>org.apache.aries.testsupport</groupId>
                         <artifactId>org.apache.aries.testsupport.unit</artifactId>
                     </exclusion>
-                    <exclusion>
-                        <groupId>commons-logging</groupId>
-                        <artifactId>commons-logging</artifactId>
-                    </exclusion>
                 </exclusions>
             </dependency>
             



Mime
View raw message