geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1041648 - in /geronimo/server/trunk/plugins: jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/ jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/ jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo...
Date Thu, 02 Dec 2010 23:43:01 GMT
Author: dblevins
Date: Thu Dec  2 23:43:01 2010
New Revision: 1041648

URL: http://svn.apache.org/viewvc?rev=1041648&view=rev
Log:
Related	changes	for OWB-503: Reduce static synchronized hashmap usage
For Geronimo this means mostly not passing around a HashMap as context, but instead the new
WebBeansContext object

Modified:
    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
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/IntegrationContext.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoSingletonService.java
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OpenWebBeansWebInitializer.java
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/SharedOwbContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatInstanceManager.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/OWBBeforeAfter.java

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=1041648&r1=1041647&r2=1041648&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
Thu Dec  2 23:43:01 2010
@@ -61,6 +61,7 @@ import org.apache.geronimo.transaction.G
 import org.apache.geronimo.web.WebAttributeName;
 import org.apache.geronimo.web.info.ErrorPageInfo;
 import org.apache.geronimo.web.info.WebAppInfo;
+import org.apache.webbeans.config.WebBeansContext;
 import org.eclipse.jetty.http.MimeTypes;
 import org.eclipse.jetty.security.SecurityHandler;
 import org.eclipse.jetty.server.SessionManager;
@@ -208,8 +209,9 @@ public class WebAppContextWrapper implem
                 }
             }
         }
-        Map<String, Object> owbContext = sharedOwbContext == null? new HashMap<String,
Object>(): sharedOwbContext.getOWBContext();
 
+        final WebBeansContext owbContext = (sharedOwbContext == null) ? new WebBeansContext()
: sharedOwbContext.getOWBContext();
+        
         IntegrationContext integrationContext = new IntegrationContext(componentContext,
unshareableResources, applicationManagedSecurityResources, trackedConnectionAssociator, userTransaction,
bundle, holder, servletContainerInitializerMap, owbContext);
         webAppContext = new GeronimoWebAppContext(securityHandler, sessionHandler, servletHandler,
null, integrationContext, classLoader, modulePath, webAppInfo, policyContextID, applicationPolicyConfigurationManager);
         webAppContext.setContextPath(contextPath);

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=1041648&r1=1041647&r2=1041648&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
Thu Dec  2 23:43:01 2010
@@ -53,6 +53,7 @@ import org.apache.geronimo.web.assembler
 import org.apache.geronimo.web.info.WebAppInfo;
 import org.apache.geronimo.web.security.SpecSecurityBuilder;
 import org.apache.geronimo.web.security.WebSecurityConstraintStore;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.xbean.osgi.bundle.util.BundleUtils;
 import org.eclipse.jetty.security.SecurityHandler;
 import org.eclipse.jetty.server.Request;
@@ -136,7 +137,7 @@ public class GeronimoWebAppContext exten
         boolean txActive = integrationContext.isTxActive();
         SharedConnectorInstanceContext newContext = integrationContext.newConnectorInstanceContext(null);
         ConnectorInstanceContext connectorContext = integrationContext.setConnectorInstance(null,
newContext);
-        Map<String, Object> oldOwbContext = integrationContext.contextEntered();
+        WebBeansContext oldOwbContext = integrationContext.contextEntered();
         try {
             setRestrictListeners(false);
             try {
@@ -212,7 +213,7 @@ public class GeronimoWebAppContext exten
         boolean txActive = integrationContext.isTxActive();
         SharedConnectorInstanceContext newContext = integrationContext.newConnectorInstanceContext(baseRequest);
         ConnectorInstanceContext connectorContext = integrationContext.setConnectorInstance(baseRequest,
newContext);
-        Map<String, Object> owbContext = integrationContext.contextEntered();
+        WebBeansContext owbContext = integrationContext.contextEntered();
         try {
             try {
                 super.doScope(target, baseRequest, request, response);

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/IntegrationContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/IntegrationContext.java?rev=1041648&r1=1041647&r2=1041648&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/IntegrationContext.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/IntegrationContext.java
Thu Dec  2 23:43:01 2010
@@ -39,6 +39,7 @@ import org.apache.geronimo.connector.out
 import org.apache.geronimo.j2ee.annotation.Holder;
 import org.apache.geronimo.naming.java.RootContext;
 import org.apache.geronimo.openwebbeans.GeronimoSingletonService;
+import org.apache.webbeans.config.WebBeansContext;
 import org.eclipse.jetty.server.Request;
 import org.osgi.framework.Bundle;
 
@@ -55,9 +56,9 @@ public class IntegrationContext {
     private final Bundle bundle;
     private final Holder holder;
     private final Map<ServletContainerInitializer, Set<Class<?>>> servletContainerInitializerMap;
-    private final Map<String, Object> owbContext;
+    private final WebBeansContext owbContext;
 
-    public IntegrationContext(Context componentContext, Set<String> unshareableResources,
Set<String> applicationManagedSecurityResources, TrackedConnectionAssociator trackedConnectionAssociator,
UserTransaction userTransaction, Bundle bundle, Holder holder, Map<ServletContainerInitializer,
Set<Class<?>>> servletContainerInitializerMap, Map<String, Object> owbContext)
{
+    public IntegrationContext(Context componentContext, Set<String> unshareableResources,
Set<String> applicationManagedSecurityResources, TrackedConnectionAssociator trackedConnectionAssociator,
UserTransaction userTransaction, Bundle bundle, Holder holder, Map<ServletContainerInitializer,
Set<Class<?>>> servletContainerInitializerMap, WebBeansContext webBeansContext)
{
         this.componentContext = componentContext;
         this.unshareableResources = unshareableResources;
         this.applicationManagedSecurityResources = applicationManagedSecurityResources;
@@ -66,7 +67,7 @@ public class IntegrationContext {
         this.bundle = bundle;
         this.holder = holder;
         this.servletContainerInitializerMap = servletContainerInitializerMap == null? Collections.<ServletContainerInitializer,
Set<Class<?>>>emptyMap(): servletContainerInitializerMap;
-        this.owbContext = owbContext;
+        this.owbContext = webBeansContext;
     }
 
     public Context getComponentContext() {
@@ -177,15 +178,15 @@ public class IntegrationContext {
     }
 
 
-    public Map<String, Object> contextEntered() {
+    public WebBeansContext contextEntered() {
         return GeronimoSingletonService.contextEntered(owbContext);
     }
 
-    public void contextExited(Map<String, Object> oldOWBContext) {
+    public void contextExited(WebBeansContext oldOWBContext) {
         GeronimoSingletonService.contextExited(oldOWBContext);
     }
 
-    public Map<String, Object> getOWBContext() {
+    public WebBeansContext getOWBContext() {
         return owbContext;
     }
 }

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java?rev=1041648&r1=1041647&r2=1041648&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java
Thu Dec  2 23:43:01 2010
@@ -262,6 +262,7 @@ public class AbstractWebModuleTest exten
         connector.setPort(5678);
         connector.setHost("localhost");
         connector.setMaxThreads(2);
+        System.out.println("DMB STARTING JETTY ON PORT 5678");
         connector.doStart();
 
         TransactionManagerImpl transactionManager = new TransactionManagerImpl();

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java?rev=1041648&r1=1041647&r2=1041648&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
Thu Dec  2 23:43:01 2010
@@ -49,6 +49,7 @@ import org.apache.openejb.NoSuchApplicat
 import org.apache.openejb.UndeployException;
 import org.apache.openejb.assembler.classic.AppInfo;
 import org.apache.openejb.cdi.OWBContext;
+import org.apache.webbeans.config.WebBeansContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -171,7 +172,7 @@ public class EjbModuleImpl implements EJ
     }
 
     @Override
-    public Map<String, Object> getOWBContext() {
+    public WebBeansContext getOWBContext() {
         if (appContext == null) {
             throw new IllegalStateException("Not started");
         }

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java?rev=1041648&r1=1041647&r2=1041648&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
Thu Dec  2 23:43:01 2010
@@ -33,6 +33,7 @@ import org.apache.openejb.cdi.OpenEJBLif
 import org.apache.openejb.cdi.StartupObject;
 import org.apache.openejb.cdi.ThreadSingletonService;
 import org.apache.webbeans.config.OpenWebBeansConfiguration;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.corespi.ServiceLoader;
 import org.apache.webbeans.lifecycle.StandaloneLifeCycle;
 import org.apache.webbeans.spi.ContainerLifecycle;
@@ -65,8 +66,7 @@ public class ThreadSingletonServiceAdapt
                 }
                 // an existing OWBConfiguration will have already been initialized
             } else {
-                owbContext = new OWBContext((Map<String, Object>) old);
-                startupObject.getAppContext().set(OWBContext.class, owbContext);
+                startupObject.getAppContext().set(OWBContext.class, (OWBContext) old);
             }
         } finally {
             contextExited(old);
@@ -94,6 +94,6 @@ public class ThreadSingletonServiceAdapt
     @Override
     public void contextExited(Object oldContext) {
         if (oldContext != null && !(oldContext instanceof Map)) throw new IllegalArgumentException("Expecting
a Map<String, Object> not " + oldContext.getClass().getName());
-        GeronimoSingletonService.contextExited((Map<String, Object>) oldContext);
+        GeronimoSingletonService.contextExited((WebBeansContext) oldContext);
     }
 }

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoSingletonService.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoSingletonService.java?rev=1041648&r1=1041647&r2=1041648&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoSingletonService.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoSingletonService.java
Thu Dec  2 23:43:01 2010
@@ -22,6 +22,7 @@ package org.apache.geronimo.openwebbeans
 
 import java.util.Map;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.config.WebBeansFinder;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.spi.SingletonService;
@@ -32,7 +33,7 @@ import org.osgi.framework.Bundle;
  */
 public class GeronimoSingletonService implements SingletonService {
 
-    private static final ThreadLocal<Map<String, Object>> contexts = new ThreadLocal<Map<String,
Object>>();
+    private static final ThreadLocal<WebBeansContext> contexts = new ThreadLocal<WebBeansContext>();
     private static Bundle bundle;
 
     public static void init(Bundle owbBundle) {
@@ -43,40 +44,24 @@ public class GeronimoSingletonService im
     public GeronimoSingletonService() {
     }
 
-    public static Map<String, Object> contextEntered(Map<String, Object> newContext)
{
-        Map<String, Object> oldContext = contexts.get();
+    public static WebBeansContext contextEntered(WebBeansContext newContext) {
+        final WebBeansContext oldContext = contexts.get();
         contexts.set(newContext);
         return oldContext;
     }
 
-    public static void contextExited(Map<String, Object> oldContext) {
+    public static void contextExited(WebBeansContext oldContext) {
         contexts.set(oldContext);
     }
 
     @Override
     public Object get(Object key, String singletonClassName) {
-        Map<String, Object> context = getContext();
-        Object service = context.get(singletonClassName);
-        if (service == null) {
-            try {
-                Class clazz = bundle.loadClass(singletonClassName);
-                service = clazz.newInstance();
-            } catch (ClassNotFoundException e) {
-                throw new WebBeansException("Could not locate requested class " + singletonClassName
+ " in bundle " + bundle, e);
-            } catch (InstantiationException e) {
-                throw new WebBeansException("Could not create instance of class " + singletonClassName,
e);
-            } catch (IllegalAccessException e) {
-                throw new WebBeansException("Could not create instance of class " + singletonClassName,
e);
-            } catch (NoClassDefFoundError e) {
-                throw new WebBeansException("Could not locate requested class " + singletonClassName
+ " in bundle " + bundle, e);
-            }
-            context.put(singletonClassName, service);
-        }
-        return service;
+        WebBeansContext context = getContext();
+        return context.get(singletonClassName);
     }
 
-    private Map<String, Object> getContext() {
-        Map<String, Object> context = contexts.get();
+    private WebBeansContext getContext() {
+        WebBeansContext context = contexts.get();
         if (context == null) {
             throw new IllegalStateException("On a thread without an initialized context");
         }
@@ -90,7 +75,7 @@ public class GeronimoSingletonService im
 
     @Override
     public boolean isExist(Object key, String singletonClassName) {
-        return getContext().containsKey(singletonClassName);
+        throw new UnsupportedOperationException("isExist is never called");
     }
 
     @Override

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OpenWebBeansWebInitializer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OpenWebBeansWebInitializer.java?rev=1041648&r1=1041647&r2=1041648&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OpenWebBeansWebInitializer.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OpenWebBeansWebInitializer.java
Thu Dec  2 23:43:01 2010
@@ -19,11 +19,10 @@
 
 package org.apache.geronimo.openwebbeans;
 
-import java.util.Map;
-
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
 import org.apache.webbeans.config.OpenWebBeansConfiguration;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.el.el22.EL22Adaptor;
 import org.apache.webbeans.lifecycle.LifecycleFactory;
 import org.apache.webbeans.resource.spi.se.StandaloneResourceInjectionService;
@@ -41,7 +40,7 @@ import org.apache.webbeans.web.lifecycle
  */
 public class OpenWebBeansWebInitializer {
     
-    public OpenWebBeansWebInitializer(Map<String, Object> owbContext, ServletContext
servletContext) {
+    public OpenWebBeansWebInitializer(WebBeansContext owbContext, ServletContext servletContext)
{
         GeronimoSingletonService.contextEntered(owbContext);
 
         try {

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/SharedOwbContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/SharedOwbContext.java?rev=1041648&r1=1041647&r2=1041648&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/SharedOwbContext.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/SharedOwbContext.java
Thu Dec  2 23:43:01 2010
@@ -20,11 +20,12 @@
 
 package org.apache.geronimo.openwebbeans;
 
-import java.util.Map;
+import org.apache.webbeans.config.WebBeansContext;
 
 /**
  * @version $Rev:$ $Date:$
  */
-public interface SharedOwbContext {
-    Map<String, Object> getOWBContext();
+public interface SharedOwbContext
+{
+    WebBeansContext getOWBContext();
 }

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=1041648&r1=1041647&r2=1041648&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
Thu Dec  2 23:43:01 2010
@@ -93,6 +93,7 @@ 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.ServiceRegistration;
 
@@ -227,9 +228,9 @@ public class GeronimoStandardContext ext
             interceptor = new ComponentContextBeforeAfter(interceptor, index++, enc);
         }
 
-        Map<String, Object> owbContext = ctx.getOWBContext();
+        WebBeansContext owbContext = ctx.getOWBContext();
         if (owbContext == null) {
-            owbContext = new HashMap<String, Object>();
+            owbContext = new WebBeansContext();
             new OpenWebBeansWebInitializer(owbContext, servletContext);
         }
         if (getInstanceManager() instanceof TomcatInstanceManager) {

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=1041648&r1=1041647&r2=1041648&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
Thu Dec  2 23:43:01 2010
@@ -33,6 +33,7 @@ import org.apache.geronimo.kernel.Kernel
 import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.web.info.WebAppInfo;
 import org.apache.tomcat.InstanceManager;
+import org.apache.webbeans.config.WebBeansContext;
 import org.osgi.framework.Bundle;
 
 /**
@@ -99,5 +100,5 @@ public interface TomcatContext {
 
     Map<String, String> getContextAttributes();
 
-    Map<String, Object> getOWBContext();
+    WebBeansContext getOWBContext();
 }

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=1041648&r1=1041647&r2=1041648&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
Thu Dec  2 23:43:01 2010
@@ -30,6 +30,7 @@ import javax.naming.NamingException;
 import org.apache.tomcat.InstanceManager;
 import org.apache.geronimo.j2ee.annotation.Holder;
 import org.apache.geronimo.openwebbeans.GeronimoSingletonService;
+import org.apache.webbeans.config.WebBeansContext;
 
 /**
  * @version $Rev$ $Date$
@@ -39,7 +40,7 @@ public class TomcatInstanceManager imple
     private final Holder holder;
     private final ClassLoader classLoader;
     private final Context context;
-    private Map<String, Object> owbContext ;
+    private WebBeansContext owbContext ;
 
     public TomcatInstanceManager(Holder holder, ClassLoader classLoader, Context context)
{
         this.holder = holder;
@@ -48,7 +49,7 @@ public class TomcatInstanceManager imple
     }
 
     public Object newInstance(String fqcn, ClassLoader classLoader) throws IllegalAccessException,
InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException
{
-        Map<String, Object> oldContext = null;
+        WebBeansContext oldContext = null;
         try {
             oldContext = GeronimoSingletonService.contextEntered(owbContext);
             return holder.newInstance(fqcn, classLoader, context);
@@ -64,7 +65,7 @@ public class TomcatInstanceManager imple
     }
 
     public Object newInstance(String className) throws IllegalAccessException, InvocationTargetException,
NamingException, InstantiationException, ClassNotFoundException {
-        Map<String, Object> oldContext = null;
+        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,
@@ -83,7 +84,7 @@ public class TomcatInstanceManager imple
     }
 
     public void destroyInstance(Object o) throws IllegalAccessException, InvocationTargetException
{
-        Map<String, Object> oldContext = null;
+        WebBeansContext oldContext = null;
         try {
             oldContext = GeronimoSingletonService.contextEntered(owbContext);
             holder.destroyInstance(o);
@@ -102,7 +103,7 @@ public class TomcatInstanceManager imple
         //Correct me if I miss anything !
     }
 
-    public void setOWBContext(Map<String, Object> owbContext) {
+    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=1041648&r1=1041647&r2=1041648&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
Thu Dec  2 23:43:01 2010
@@ -73,6 +73,7 @@ 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;
@@ -120,7 +121,7 @@ public class TomcatWebAppContext impleme
     private final Map<String, Object> deploymentAttributes;
     private final ApplicationPolicyConfigurationManager applicationPolicyConfigurationManager;
     private final Map<String,String> contextAttributes;
-    private final Map<String, Object> owbContext;
+    private final WebBeansContext owbContext;
     private final InstanceManager instanceManager;
 
     // JSR 77
@@ -555,7 +556,7 @@ public class TomcatWebAppContext impleme
     }
 
     @Override
-    public Map<String, Object> getOWBContext() {
+    public WebBeansContext getOWBContext() {
         return owbContext;
     }
 

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/OWBBeforeAfter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/OWBBeforeAfter.java?rev=1041648&r1=1041647&r2=1041648&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/OWBBeforeAfter.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/OWBBeforeAfter.java
Thu Dec  2 23:43:01 2010
@@ -26,6 +26,7 @@ import javax.servlet.ServletContext;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import org.apache.geronimo.openwebbeans.GeronimoSingletonService;
+import org.apache.webbeans.config.WebBeansContext;
 
 /**
  * @version $Rev$ $Date$
@@ -34,9 +35,9 @@ public class OWBBeforeAfter implements B
 
     private final BeforeAfter next;
     private final int index;
-    private final Map<String, Object> owbContext ;
+    private final WebBeansContext owbContext ;
 
-    public OWBBeforeAfter(BeforeAfter next, int index, ServletContext servletContext, Map<String,
Object> owbContext) {
+    public OWBBeforeAfter(BeforeAfter next, int index, ServletContext servletContext, WebBeansContext
owbContext) {
         this.next = next;
         this.index = index;
         this.owbContext = owbContext;
@@ -55,6 +56,6 @@ public class OWBBeforeAfter implements B
         if (next != null) {
             next.after(context, httpRequest, httpResponse, dispatch);
         }
-        GeronimoSingletonService.contextExited((Map<String, Object>) context[index]);
+        GeronimoSingletonService.contextExited((WebBeansContext) context[index]);
     }
 }



Mime
View raw message