geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1056148 - in /geronimo/server/trunk/plugins: openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ openejb/openejb/src/main/history/ openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/
Date Fri, 07 Jan 2011 01:03:09 GMT
Author: djencks
Date: Fri Jan  7 01:03:09 2011
New Revision: 1056148

URL: http://svn.apache.org/viewvc?rev=1056148&view=rev
Log:
OWB-503 related changes

Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
    geronimo/server/trunk/plugins/openejb/openejb/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.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/OsgiMetaDataScannerService.java
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebBeansConfigurationListener.java

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=1056148&r1=1056147&r2=1056148&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
Fri Jan  7 01:03:09 2011
@@ -31,7 +31,6 @@ import org.apache.openejb.cdi.StartupObj
 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.spi.ContainerLifecycle;
 import org.apache.webbeans.spi.ResourceInjectionService;
 
@@ -53,9 +52,10 @@ public class ThreadSingletonServiceAdapt
                 //not embedded. Are we the first ejb module to try this?
                 if (startupObject.getAppContext().get(OWBContext.class) == null) {
                     startupObject.getAppContext().set(OWBContext.class, owbContext);
-                    setConfiguration(WebBeansContext.getInstance().getOpenWebBeansConfiguration());
+                    WebBeansContext webBeansContext = owbContext.getSingletons();
+                    setConfiguration(webBeansContext.getOpenWebBeansConfiguration());
                     try {
-                        ServiceLoader.getService(ContainerLifecycle.class).startApplication(startupObject);
+                        webBeansContext.getService(ContainerLifecycle.class).startApplication(startupObject);
                     } catch (Exception e) {
                         throw new RuntimeException("couldn't start owb context", e);
                     }

Modified: geronimo/server/trunk/plugins/openejb/openejb/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb/src/main/history/dependencies.xml?rev=1056148&r1=1056147&r2=1056148&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/openejb/openejb/src/main/history/dependencies.xml Fri Jan
 7 01:03:09 2011
@@ -143,11 +143,6 @@
     </dependency>
     <dependency>
         <groupId>org.apache.openwebbeans</groupId>
-        <artifactId>openwebbeans-ee-common</artifactId>
-        <type>jar</type>
-    </dependency>
-    <dependency>
-        <groupId>org.apache.openwebbeans</groupId>
         <artifactId>openwebbeans-ejb</artifactId>
         <type>jar</type>
     </dependency>
@@ -192,6 +187,16 @@
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-bundleutils</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-finder</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.apache.yoko</groupId>
         <artifactId>yoko-spec-corba</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.java?rev=1056148&r1=1056147&r2=1056148&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.java
Fri Jan  7 01:03:09 2011
@@ -29,9 +29,11 @@ import java.lang.reflect.Modifier;
 
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.Bean;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import org.apache.webbeans.component.ResourceBean;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.spi.ResourceInjectionService;
 import org.apache.webbeans.spi.api.ResourceReference;
@@ -114,17 +116,20 @@ public class GeronimoResourceInjectionSe
     public void clear() {
     }
 
-    /**                                                                                 
                                                                                 
-     * delegation of serialization behavior                                             
                                                                                 
+    /**
+     * delegation of serialization behavior
      */
-    public <T> void writeExternal(Bean<T> bean, T actualResource, ObjectOutput
out) throws IOException{}
+    public <T> void writeExternal(Bean<T> bean, T actualResource, ObjectOutput
out) throws IOException {
+        //do nothing
+    }
 
-    /**                                                                                 
                                                                                 
-     * delegation of serialization behavior                                             
                                                                                 
+    /**
+     * delegation of serialization behavior
      */
     public <T> T readExternal(Bean<T> bean, ObjectInput out) throws IOException,
-                                                                    ClassNotFoundException
{
-        return null;
+            ClassNotFoundException {
+        return (T) ((ResourceBean)bean).getActualInstance();
     }
+        
 
 }

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=1056148&r1=1056147&r2=1056148&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
Fri Jan  7 01:03:09 2011
@@ -24,7 +24,6 @@ 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.spi.ContainerLifecycle;
 import org.apache.webbeans.spi.JNDIService;
 import org.apache.webbeans.spi.ResourceInjectionService;
@@ -43,10 +42,10 @@ public class OpenWebBeansWebInitializer 
         GeronimoSingletonService.contextEntered(owbContext);
 
         try {
-            setConfiguration(WebBeansContext.getInstance().getOpenWebBeansConfiguration());
+            setConfiguration(owbContext.getOpenWebBeansConfiguration());
             //from OWB's WebBeansConfigurationListener
             if (servletContext != null) {
-                ContainerLifecycle lifeCycle = LifecycleFactory.getInstance().getLifecycle();
+                ContainerLifecycle lifeCycle = WebBeansContext.getInstance().getService(ContainerLifecycle.class);
 
                 try
                 {

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OsgiMetaDataScannerService.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OsgiMetaDataScannerService.java?rev=1056148&r1=1056147&r2=1056148&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OsgiMetaDataScannerService.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OsgiMetaDataScannerService.java
Fri Jan  7 01:03:09 2011
@@ -18,6 +18,13 @@
  */
 package org.apache.geronimo.openwebbeans;
 
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.zip.ZipEntry;
+
 import org.apache.webbeans.config.OpenWebBeansConfiguration;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.corespi.se.DefaultBDABeansXmlScanner;
@@ -25,7 +32,6 @@ import org.apache.webbeans.exception.Web
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.spi.BDABeansXmlScanner;
 import org.apache.webbeans.spi.ScannerService;
-
 import org.apache.xbean.finder.BundleAssignableClassFinder;
 import org.apache.xbean.osgi.bundle.util.BundleClassFinder;
 import org.apache.xbean.osgi.bundle.util.BundleResourceFinder;
@@ -36,13 +42,6 @@ import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.packageadmin.PackageAdmin;
 
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-
 /**
  * In an OSGi environment, resources will not be delivered in
  * jars or file URLs, but as 'bundle://'.
@@ -53,6 +52,7 @@ public class OsgiMetaDataScannerService 
 {
     private WebBeansLogger logger = WebBeansLogger.getLogger(OsgiMetaDataScannerService.class);
 
+    private final WebBeansContext webBeansContext;
     private boolean configured = false;
 
     private static final String META_INF_BEANS_XML = "META-INF/beans.xml";
@@ -70,13 +70,17 @@ public class OsgiMetaDataScannerService 
     /**contains all the JARs we found with valid beans.xml in it */
     private Set<String> beanArchiveJarNames = new HashSet<String>();
 
+    public OsgiMetaDataScannerService(WebBeansContext webBeansContext) {
+        this.webBeansContext = webBeansContext;
+    }
+
     @Override
     public void init(Object object)
     {
         // set per BDA beans.xml flag here because setting it in constructor
         // occurs before
         // properties are loaded.
-        String usage = WebBeansContext.getInstance().getOpenWebBeansConfiguration().getProperty(OpenWebBeansConfiguration.USE_BDA_BEANSXML_SCANNER);
+        String usage = webBeansContext.getOpenWebBeansConfiguration().getProperty(OpenWebBeansConfiguration.USE_BDA_BEANSXML_SCANNER);
         this.isBDAScannerEnabled = Boolean.parseBoolean(usage);
         if (isBDAScannerEnabled)
         {

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebBeansConfigurationListener.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebBeansConfigurationListener.java?rev=1056148&r1=1056147&r2=1056148&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebBeansConfigurationListener.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/WebBeansConfigurationListener.java
Fri Jan  7 01:03:09 2011
@@ -36,11 +36,10 @@ import org.apache.webbeans.config.OWBLog
 import org.apache.webbeans.config.OpenWebBeansConfiguration;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.conversation.ConversationManager;
-import org.apache.webbeans.corespi.ServiceLoader;
 import org.apache.webbeans.el.ELContextStore;
-import org.apache.webbeans.lifecycle.LifecycleFactory;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.spi.ContainerLifecycle;
+import org.apache.webbeans.spi.ContextsService;
 import org.apache.webbeans.spi.FailOverService;
 import org.apache.webbeans.util.WebBeansUtil;
 import org.apache.webbeans.web.context.WebContextsService;
@@ -59,16 +58,15 @@ public class WebBeansConfigurationListen
     /**Logger instance*/
     private static final WebBeansLogger logger = WebBeansLogger.getLogger(WebBeansConfigurationListener.class);
 
-    protected FailOverService failoverService = null;
+    protected FailOverService failoverService;
 
     /**Manages the container lifecycle*/
-    protected ContainerLifecycle lifeCycle = null;
+    protected WebBeansContext webBeansContext;
     /**
      * Default constructor
      */
     public WebBeansConfigurationListener()
     {
-        failoverService = ServiceLoader.getService(FailOverService.class);
     }
 
 
@@ -77,8 +75,8 @@ public class WebBeansConfigurationListen
      */
     public void contextInitialized(ServletContextEvent event)
     {
-        this.lifeCycle = LifecycleFactory.getInstance().getLifecycle();
-
+        this.webBeansContext = WebBeansContext.getInstance();
+        this.failoverService = webBeansContext.getService(FailOverService.class);
         try
         {
 //                this.lifeCycle.startApplication(event);
@@ -97,8 +95,8 @@ public class WebBeansConfigurationListen
      */
     public void contextDestroyed(ServletContextEvent event)
     {
-        this.lifeCycle.stopApplication(event);
-        this.lifeCycle = null;
+        this.webBeansContext.getService(ContainerLifecycle.class).stopApplication(event);
+        this.webBeansContext = null;
         event.getServletContext().setAttribute(OpenWebBeansConfiguration.PROPERTY_OWB_APPLICATION,
"false");
     }
 
@@ -134,7 +132,7 @@ public class WebBeansConfigurationListen
             elStore.destroyELContextStore();
         }
 
-        this.lifeCycle.getContextService().endContext(RequestScoped.class, event);
+        this.webBeansContext.getContextsService().endContext(RequestScoped.class, event);
 
         this.cleanupRequestThreadLocals();
     }
@@ -163,7 +161,7 @@ public class WebBeansConfigurationListen
                 logger.debug("Starting a new request : [{0}]", event.getServletRequest().getRemoteAddr());
             }
 
-            this.lifeCycle.getContextService().startContext(RequestScoped.class, event);
+            this.webBeansContext.getContextsService().startContext(RequestScoped.class, event);
 
             // we don't initialise the Session here but do it lazily if it gets requested
             // the first time. See OWB-457
@@ -187,7 +185,7 @@ public class WebBeansConfigurationListen
             {
                 logger.debug("Starting a session with session id : [{0}]", event.getSession().getId());
             }
-            this.lifeCycle.getContextService().startContext(SessionScoped.class, event.getSession());
+            this.webBeansContext.getContextsService().startContext(SessionScoped.class, event.getSession());
         }
         catch (Exception e)
         {
@@ -205,9 +203,9 @@ public class WebBeansConfigurationListen
         {
             logger.debug("Destroying a session with session id : [{0}]", event.getSession().getId());
         }
-        this.lifeCycle.getContextService().endContext(SessionScoped.class, event.getSession());
+        this.webBeansContext.getContextsService().endContext(SessionScoped.class, event.getSession());
 
-        ConversationManager conversationManager = WebBeansContext.getInstance().getConversationManager();
+        ConversationManager conversationManager = webBeansContext.getConversationManager();
         conversationManager.destroyConversationContextWithSessionId(event.getSession().getId());
     }
 



Mime
View raw message