You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2009/10/18 20:21:46 UTC

svn commit: r826479 - in /incubator/openwebbeans/trunk/webbeans-impl/src/main: java/org/apache/webbeans/config/ java/org/apache/webbeans/intercept/ java/org/apache/webbeans/lifecycle/ java/org/apache/webbeans/servlet/ java/org/apache/webbeans/spi/ reso...

Author: gerdogdu
Date: Sun Oct 18 18:21:46 2009
New Revision: 826479

URL: http://svn.apache.org/viewvc?rev=826479&view=rev
Log:
Adding standalone support. Some name changes.

Added:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
      - copied, changed from r826305, incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java
      - copied, changed from r826305, incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/WebBeansLifeCycle.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/LifecycleFactory.java   (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java   (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/Lifecycle.java   (with props)
Removed:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/WebBeansLifeCycle.java
Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/servlet/WebBeansConfigurationListener.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans-default.properties

Copied: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java (from r826305, incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java)
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?p2=incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java&p1=incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java&r1=826305&r2=826479&rev=826479&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java Sun Oct 18 18:21:46 2009
@@ -78,10 +78,10 @@
  * the scanner phase.
  */
 @SuppressWarnings("unchecked")
-public class WebBeansContainerDeployer
+public class BeansDeployer
 {
     //Logger instance
-    private static final WebBeansLogger logger = WebBeansLogger.getLogger(WebBeansContainerDeployer.class);
+    private static final WebBeansLogger logger = WebBeansLogger.getLogger(BeansDeployer.class);
 
     /**Deployment is started or not*/
     protected boolean deployed = false;
@@ -97,7 +97,7 @@
      * 
      * @param xmlConfigurator xml configurator
      */
-    public WebBeansContainerDeployer(WebBeansXMLConfigurator xmlConfigurator)
+    public BeansDeployer(WebBeansXMLConfigurator xmlConfigurator)
     {
         this.xmlConfigurator = xmlConfigurator;
         String usage = OpenWebBeansConfiguration.getInstance().getProperty(OpenWebBeansConfiguration.USE_EJB_DISCOVERY);

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java?rev=826479&r1=826478&r2=826479&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java Sun Oct 18 18:21:46 2009
@@ -57,6 +57,8 @@
     /**Use EJB Discovery or not*/
     public static final String USE_EJB_DISCOVERY = "org.apache.webbeans.spi.deployer.UseEjbMetaDataDiscoveryService";
     
+    public static final String CONTAINER_LIFECYCLE = "org.apache.webbeans.spi.lifecycle";
+    
     public static OpenWebBeansConfiguration getInstance() {
         return (OpenWebBeansConfiguration) WebBeansFinder.getSingletonInstance(OpenWebBeansConfiguration.class.getName());
     }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java?rev=826479&r1=826478&r2=826479&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java Sun Oct 18 18:21:46 2009
@@ -30,7 +30,7 @@
 
 import org.apache.webbeans.component.AbstractBean;
 import org.apache.webbeans.config.DefinitionUtil;
-import org.apache.webbeans.config.WebBeansContainerDeployer;
+import org.apache.webbeans.config.BeansDeployer;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.decorator.WebBeansDecorator;
 import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
@@ -48,7 +48,7 @@
  * <ul>
  * <li><b>1- Configuration of decorators and interceptors</b>
  * <p>
- * Decorators and Interceptors are configured from {@link WebBeansContainerDeployer}
+ * Decorators and Interceptors are configured from {@link BeansDeployer}
  * class via methods <code>configureInterceptors(scanner)</code> and
  * <code>configureDecorators(scanner)</code>. Those methods further call
  * <code>defineInterceptor(interceptor class)</code> and <code>defineDecorator(decorator class)</code>

Copied: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java (from r826305, incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/WebBeansLifeCycle.java)
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java?p2=incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java&p1=incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/WebBeansLifeCycle.java&r1=826305&r2=826479&rev=826479&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/WebBeansLifeCycle.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java Sun Oct 18 18:21:46 2009
@@ -20,6 +20,7 @@
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
+import javax.enterprise.inject.spi.BeanManager;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletRequestEvent;
@@ -30,7 +31,7 @@
 
 import org.apache.webbeans.WebBeansConstants;
 import org.apache.webbeans.config.OpenWebBeansConfiguration;
-import org.apache.webbeans.config.WebBeansContainerDeployer;
+import org.apache.webbeans.config.BeansDeployer;
 import org.apache.webbeans.config.WebBeansFinder;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.container.activity.ActivityManager;
@@ -45,6 +46,7 @@
 import org.apache.webbeans.portable.events.discovery.BeforeShutDownImpl;
 import org.apache.webbeans.servlet.WebBeansConfigurationListener;
 import org.apache.webbeans.spi.JNDIService;
+import org.apache.webbeans.spi.Lifecycle;
 import org.apache.webbeans.spi.ServiceLoader;
 import org.apache.webbeans.spi.deployer.MetaDataDiscoveryService;
 import org.apache.webbeans.xml.WebBeansXMLConfigurator;
@@ -60,10 +62,10 @@
  * @version $Rev$ $Date$
  * @see WebBeansConfigurationListener
  */
-public final class WebBeansLifeCycle
+public final class EnterpriseLifeCycle implements Lifecycle
 {
 	//Logger instance
-    private static final WebBeansLogger logger = WebBeansLogger.getLogger(WebBeansLifeCycle.class);
+    private static final WebBeansLogger logger = WebBeansLogger.getLogger(EnterpriseLifeCycle.class);
 
     /**Manages unused conversations*/
     private ScheduledExecutorService service = null;
@@ -72,7 +74,7 @@
     private MetaDataDiscoveryService discovery = null;
 
     /**Deploy discovered beans*/
-    private final WebBeansContainerDeployer deployer;
+    private final BeansDeployer deployer;
 
     /**XML discovery. */
     //XML discovery is removed from the specification. It is here for next revisions of spec.
@@ -89,18 +91,21 @@
      * Creates a new lifecycle instance and initializes
      * the instance variables.
      */
-    public WebBeansLifeCycle()
+    public EnterpriseLifeCycle()
     {
         this.rootManager = new BeanManagerImpl();
         this.xmlDeployer = new WebBeansXMLConfigurator();
-        this.deployer = new WebBeansContainerDeployer(xmlDeployer);
+        this.deployer = new BeansDeployer(xmlDeployer);
         this.jndiService = ServiceLoader.getService(JNDIService.class);
         
-        rootManager.setXMLConfigurator(this.xmlDeployer);
-        
-        ActivityManager.getInstance().setRootActivity(this.rootManager);
+        init();
     }
 
+    public void init()
+    {
+        rootManager.setXMLConfigurator(this.xmlDeployer);        
+        ActivityManager.getInstance().setRootActivity(this.rootManager);        
+    }
     
     public void requestStarted(ServletRequestEvent event)
     {
@@ -129,11 +134,20 @@
         conversationManager.destroyConversationContextWithSessionId(event.getSession().getId());
     }
 
-    public void applicationStarted(ServletContextEvent event)
+    public void applicationStarted(Object startupObject)
     {
+        if(startupObject != null && !(ServletContextEvent.class.isAssignableFrom(startupObject.getClass())))
+        {
+            throw new WebBeansException("Wrong initialization object");
+        }
+        
+        ServletContextEvent event = (ServletContextEvent)startupObject; 
+        
         // Initalize Application Context
-        logger.info("Initializing of the application context");
+        logger.info("OpenWebBeans Container is starting");
         
+        long begin = System.currentTimeMillis();
+
         //Application Context initialization
         ContextFactory.initApplicationContext(event.getServletContext());
         
@@ -152,21 +166,14 @@
         service = Executors.newScheduledThreadPool(1);
         service.scheduleWithFixedDelay(new ConversationCleaner(), delay, delay, TimeUnit.MILLISECONDS);
 
-        logger.info("Starting the dependency injection container configuration");
-        long begin = System.currentTimeMillis();
-
-        logger.info("Scanning classpaths for beans artifacts is started");
+        logger.info("Scanning classpaths for beans artifacts");
 
         this.discovery.scan();
 
-        logger.info("Scanning is ended");
-
-        logger.info("Deploying the scanned beans artifacts");
+        logger.info("Deploying scanned beans");
 
         deployer.deploy(this.discovery);
 
-        logger.info("Deploying is ended");
-
         ServletContext context = event.getServletContext();
 
         try
@@ -189,11 +196,21 @@
         }
         
         long end = System.currentTimeMillis();
-        logger.info("Dependency injection container configuration is ended, takes " + Long.toString(end - begin) + " ms.");
+        
+        logger.info("OpenWebBeans Container is started, it takes " + Long.toString(end - begin) + " ms.");
     }
 
-    public void applicationEnded(ServletContextEvent event)
+    public void applicationEnded(Object endObject)
     {
+        logger.info("OpenWebBeans Container is stopping");
+        
+        if(endObject != null && !(ServletContextEvent.class.isAssignableFrom(endObject.getClass())))
+        {
+            throw new WebBeansException("Wrong ended object");
+        }
+        
+        ServletContextEvent event = (ServletContextEvent)endObject;
+        
         //Fire shut down
         this.rootManager.fireEvent(new BeforeShutDownImpl(), new Annotation[0]);
                 
@@ -217,7 +234,7 @@
         //Clear singleton list
         WebBeansFinder.clearInstances();
                 
-        logger.info("Dependency injection container is stopped for context path : " + event.getServletContext().getContextPath());        
+        logger.info("OpenWebBeans Container is stopped for context path, " + event.getServletContext().getContextPath());        
     }
     
     public void sessionPassivated(HttpSessionEvent event)
@@ -244,4 +261,10 @@
         }    	
     }
 
+    @Override
+    public BeanManager getBeanManager()
+    {
+        return this.rootManager;
+    }
+
 }
\ No newline at end of file

Added: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/LifecycleFactory.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/LifecycleFactory.java?rev=826479&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/LifecycleFactory.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/LifecycleFactory.java Sun Oct 18 18:21:46 2009
@@ -0,0 +1,40 @@
+/*
+ * 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.webbeans.lifecycle;
+
+import org.apache.webbeans.config.WebBeansFinder;
+import org.apache.webbeans.spi.Lifecycle;
+import org.apache.webbeans.spi.ServiceLoader;
+
+public final class LifecycleFactory
+{
+    public LifecycleFactory()
+    {
+        
+    }
+    
+    public static LifecycleFactory getInstance()
+    {
+        LifecycleFactory currentLifecycle = (LifecycleFactory)WebBeansFinder.getSingletonInstance(LifecycleFactory.class.getName());
+        
+        return currentLifecycle;
+    }
+    
+    public Lifecycle getLifecycle()
+    {
+        Lifecycle lifecycle = ServiceLoader.getService(Lifecycle.class);
+        
+        return lifecycle;
+    }
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/LifecycleFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java?rev=826479&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java Sun Oct 18 18:21:46 2009
@@ -0,0 +1,169 @@
+/*
+ * 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.webbeans.lifecycle;
+
+import java.lang.annotation.Annotation;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.apache.webbeans.WebBeansConstants;
+import org.apache.webbeans.config.BeansDeployer;
+import org.apache.webbeans.config.WebBeansFinder;
+import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.container.activity.ActivityManager;
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.context.creational.CreationalContextFactory;
+import org.apache.webbeans.exception.WebBeansException;
+import org.apache.webbeans.logger.WebBeansLogger;
+import org.apache.webbeans.plugins.PluginLoader;
+import org.apache.webbeans.portable.events.ExtensionLoader;
+import org.apache.webbeans.portable.events.discovery.BeforeShutDownImpl;
+import org.apache.webbeans.spi.JNDIService;
+import org.apache.webbeans.spi.Lifecycle;
+import org.apache.webbeans.spi.ServiceLoader;
+import org.apache.webbeans.spi.deployer.MetaDataDiscoveryService;
+import org.apache.webbeans.spi.se.deployer.MetaDataDiscoveryStandard;
+import org.apache.webbeans.xml.WebBeansXMLConfigurator;
+
+public class StandaloneLifeCycle implements Lifecycle
+{
+    private static final WebBeansLogger logger = WebBeansLogger.getLogger(StandaloneLifeCycle.class);
+    
+    /**Deploy discovered beans*/
+    private final BeansDeployer beansDeployer;
+        
+    /**Root container.*/
+    private final BeanManagerImpl beanManager;
+    
+    private AtomicBoolean inited = new AtomicBoolean(false);
+    
+    private AtomicBoolean started = new AtomicBoolean(false);
+    
+    private AtomicBoolean stopped = new AtomicBoolean(false);
+    
+    private MetaDataDiscoveryService discoveryService = null;
+    
+    private final WebBeansXMLConfigurator xmlConfig;
+    
+    public StandaloneLifeCycle()
+    {
+        this.beanManager = new BeanManagerImpl();
+        this.xmlConfig = new WebBeansXMLConfigurator();
+        this.beansDeployer = new BeansDeployer(this.xmlConfig);
+        
+        init();
+    }
+    
+    @Override
+    public void init()
+    {
+        if(inited.compareAndSet(false, true))
+        {
+            discoveryService = ServiceLoader.getService(MetaDataDiscoveryService.class);
+            
+            if(!(discoveryService instanceof MetaDataDiscoveryStandard))
+            {
+                String message = "Wrong discovery service implementation class. Continue with using MetaDataDiscoveryStandard as a default"; 
+                logger.warn(message);
+                
+                this.discoveryService = new MetaDataDiscoveryStandard();
+            }      
+            
+            beanManager.setXMLConfigurator(this.xmlConfig);        
+            ActivityManager.getInstance().setRootActivity(this.beanManager);        
+
+        }
+    }
+
+    @Override
+    public void applicationStarted(Object startupObject) throws WebBeansException
+    {
+        if(this.started.compareAndSet(false, true))
+        {            
+            logger.info("OpenWebBeans Container is starting");
+            long begin = System.currentTimeMillis();
+            
+            //Singleton context
+            ContextFactory.initSingletonContext();
+
+            // load all optional plugins
+            PluginLoader.getInstance().startUp();
+
+            logger.info("Scanning classpaths for beans artifacts");
+
+            this.discoveryService.scan();
+
+            logger.info("Deploying scanned beans");
+
+            this.beansDeployer.deploy(this.discoveryService);
+                        
+            long end = System.currentTimeMillis();
+            
+            logger.info("OpenWebBeans Container is started, it takes " + Long.toString(end - begin) + " ms.");            
+            
+        }
+        else
+        {
+            logger.warn("OpenWebBeans Container is already started");
+        }
+        
+    }
+    
+    @Override
+    public void applicationEnded(Object endObject)
+    {
+        if(this.stopped.compareAndSet(false, true))
+        {
+            logger.info("OpenWebBeans Container is stopping");
+            
+
+            //Fire shut down
+            this.beanManager.fireEvent(new BeforeShutDownImpl(), new Annotation[0]);
+            
+            JNDIService jndiService = ServiceLoader.getService(JNDIService.class);
+            
+            jndiService.unbind(WebBeansConstants.WEB_BEANS_MANAGER_JNDI_NAME);
+                    
+            ContextFactory.destroySingletonContext();
+
+            // finally free all plugin resources
+            PluginLoader.getInstance().shutDown();
+            
+            //Clear extensions
+            ExtensionLoader.getInstance().clear();
+            
+            //Clear CreationalContext
+            CreationalContextFactory.getInstance().clear();
+
+            //Clear singleton list
+            WebBeansFinder.clearInstances();
+                    
+            logger.info("OpenWebBeans Container is stopped");        
+            
+        }
+        else
+        {
+            logger.warn("OpenWebBeans Container is already stopped");
+        }        
+        
+    }
+
+    @Override
+    public BeanManager getBeanManager()
+    {
+        return this.beanManager;
+    }
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/servlet/WebBeansConfigurationListener.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/servlet/WebBeansConfigurationListener.java?rev=826479&r1=826478&r2=826479&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/servlet/WebBeansConfigurationListener.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/servlet/WebBeansConfigurationListener.java Sun Oct 18 18:21:46 2009
@@ -21,7 +21,7 @@
 import javax.servlet.http.HttpSessionEvent;
 import javax.servlet.http.HttpSessionListener;
 
-import org.apache.webbeans.lifecycle.WebBeansLifeCycle;
+import org.apache.webbeans.lifecycle.EnterpriseLifeCycle;
 
 /**
  * Initializing the beans container for using in an web application
@@ -32,7 +32,7 @@
 public class WebBeansConfigurationListener implements ServletContextListener, ServletRequestListener, HttpSessionListener,HttpSessionActivationListener
 {
 	/**Manages the container lifecycle*/
-    private WebBeansLifeCycle lifeCycle = null;
+    private EnterpriseLifeCycle lifeCycle = null;
 
     /**
      * Default constructor
@@ -56,7 +56,7 @@
 	 */
     public void contextInitialized(ServletContextEvent event)
     {
-        this.lifeCycle = new WebBeansLifeCycle();
+        this.lifeCycle = new EnterpriseLifeCycle();
         this.lifeCycle.applicationStarted(event);
     }
 

Added: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/Lifecycle.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/Lifecycle.java?rev=826479&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/Lifecycle.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/Lifecycle.java Sun Oct 18 18:21:46 2009
@@ -0,0 +1,30 @@
+/*
+ * 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.webbeans.spi;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.apache.webbeans.exception.WebBeansException;
+
+public interface Lifecycle
+{
+    public void init();
+    
+    public void applicationStarted(Object startupObject) throws WebBeansException;
+    
+    public void applicationEnded(Object endObject);
+    
+    public BeanManager getBeanManager();
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/Lifecycle.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans-default.properties
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans-default.properties?rev=826479&r1=826478&r2=826479&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans-default.properties (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans-default.properties Sun Oct 18 18:21:46 2009
@@ -61,6 +61,9 @@
 #use OWB Specific injection. If false, uses spec. defined injection with @Inject
 org.apache.webbeans.fieldInjection.useOwbSpecificInjection=false
 
+#Lifecycle to start container
+org.apache.webbeans.spi.lifecycle.Lifecycle=org.apache.webbeans.lifecycle.EnterpriseLifeCycle
+
 #use @Alternative or @DeploymentType
 org.apache.webbeans.resolver.useAlternative=true