Author: peteroyle
Date: 2009-03-01 15:30:48 -0500 (Sun, 01 Mar 2009)
New Revision: 1747
Added:
extensions/trunk/se/src/test/java/org/
extensions/trunk/se/src/test/java/org/jboss/
extensions/trunk/se/src/test/java/org/jboss/webbeans/
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/
Modified:
extensions/trunk/se/pom.xml
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/boot/WebBeansBootstrap.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractDeploymentHandler.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentHandler.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentStrategy.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/StandardDeploymentStrategy.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/lifecycle/ApplicationLifecycle.java
Log:
Added shutdown lifecycle event and moved lifecycle into WebBeansBootstrap. Removed
postProcess method which is unused from DeploymentHandler.
Modified: extensions/trunk/se/pom.xml
===================================================================
--- extensions/trunk/se/pom.xml 2009-03-01 20:30:41 UTC (rev 1746)
+++ extensions/trunk/se/pom.xml 2009-03-01 20:30:48 UTC (rev 1747)
@@ -8,6 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
<artifactId>se-module</artifactId>
+ <packaging>jar</packaging>
<name>Web Beans SE Module</name>
<url>http://maven.apache.org</url>
<build>
@@ -99,14 +100,12 @@
<dependency>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-ri-spi</artifactId>
- <version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- TODO (PR): remove this dependency -->
<dependency>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-ri</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>javax.el</groupId>
@@ -125,7 +124,6 @@
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
- <version>1.0.1B</version>
</dependency>
</dependencies>
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-01
20:30:41 UTC (rev 1746)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-01
20:30:48 UTC (rev 1747)
@@ -16,9 +16,8 @@
*/
package org.jboss.webbeans.environment.se;
-import org.jboss.webbeans.context.beanstore.SimpleBeanStore;
+import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.webbeans.environment.se.boot.WebBeansBootstrap;
-import org.jboss.webbeans.lifecycle.ApplicationLifecycle;
/**
* This is the main class that should always be called from the command
@@ -44,14 +43,9 @@
webBeansBootstrap.initialize();
- ApplicationLifecycle lifecycle = ApplicationLifecycle.instance();
- lifecycle.initialize();
- final SimpleBeanStore appBeanStore = new SimpleBeanStore();
- lifecycle.beginApplication( "TODO: application id?", appBeanStore );
-
webBeansBootstrap.boot();
- lifecycle.endApplication( "TODO: application id?", appBeanStore );
+ webBeansBootstrap.shutdown();
}
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/boot/WebBeansBootstrap.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/boot/WebBeansBootstrap.java 2009-03-01
20:30:41 UTC (rev 1746)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/boot/WebBeansBootstrap.java 2009-03-01
20:30:48 UTC (rev 1747)
@@ -28,9 +28,12 @@
import org.jboss.webbeans.bootstrap.BeanDeployer;
import org.jboss.webbeans.bootstrap.BeansXmlParser;
import org.jboss.webbeans.bootstrap.api.helpers.AbstractBootstrap;
+import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
+import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.environment.se.beans.ParametersFactory;
import org.jboss.webbeans.environment.se.discovery.WebBeanDiscoveryImpl;
import org.jboss.webbeans.environment.se.resources.DefaultResourceLoader;
+import org.jboss.webbeans.lifecycle.ApplicationLifecycle;
import org.jboss.webbeans.literal.DeployedLiteral;
import org.jboss.webbeans.literal.InitializedLiteral;
import org.jboss.webbeans.log.Log;
@@ -47,6 +50,8 @@
Log log = Logging.getLog( WebBeansBootstrap.class );
String[] commandLineArgs;
private ManagerImpl manager;
+ ApplicationLifecycle lifecycle = ApplicationLifecycle.instance();
+ final BeanStore appBeanStore = new ConcurrentHashMapBeanStore();
public WebBeansBootstrap( String[] commandLineArgs )
{
@@ -77,6 +82,7 @@
}
this.manager = new ManagerImpl( getNamingContext(), getEjbResolver(),
getResourceLoader() );
CurrentManager.setRootManager( manager );
+ lifecycle.initialize();
}
@@ -108,6 +114,9 @@
{
throw new IllegalStateException( "ResourceLoader not set" );
}
+
+ lifecycle.beginApplication( "TODO: application id?", appBeanStore
);
+
BeansXmlParser parser = new BeansXmlParser( getResourceLoader(),
getWebBeanDiscovery().discoverWebBeansXml() );
parser.parse();
List<Class<? extends Annotation>> enabledDeploymentTypes =
parser.getEnabledDeploymentTypes();
@@ -145,4 +154,10 @@
beanDeployer.addClass( Transaction.class );
beanDeployer.deploy();
}
+
+ public void shutdown()
+ {
+ lifecycle.endApplication( "TODO: application id?", appBeanStore );
+ }
+
}
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractDeploymentHandler.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractDeploymentHandler.java 2009-03-01
20:30:41 UTC (rev 1746)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractDeploymentHandler.java 2009-03-01
20:30:48 UTC (rev 1747)
@@ -51,7 +51,4 @@
return resources;
}
- public void postProcess( ClassLoader classLoader )
- {
- }
}
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentHandler.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentHandler.java 2009-03-01
20:30:41 UTC (rev 1746)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentHandler.java 2009-03-01
20:30:48 UTC (rev 1747)
@@ -43,8 +43,6 @@
*/
public DeploymentMetadata getMetadata( );
- public void postProcess( ClassLoader classLoader );
-
public Set<FileDescriptor> getResources( );
public void setResources( Set<FileDescriptor> resources );
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentStrategy.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentStrategy.java 2009-03-01
20:30:41 UTC (rev 1746)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentStrategy.java 2009-03-01
20:30:48 UTC (rev 1747)
@@ -232,11 +232,4 @@
return getScanner( ).getTimestamp( );
}
- protected void postScan( )
- {
- for ( Entry<String, DeploymentHandler> entry : getDeploymentHandlers(
).entrySet( ) )
- {
- entry.getValue( ).postProcess( getClassLoader( ) );
- }
- }
}
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/StandardDeploymentStrategy.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/StandardDeploymentStrategy.java 2009-03-01
20:30:41 UTC (rev 1746)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/StandardDeploymentStrategy.java 2009-03-01
20:30:48 UTC (rev 1747)
@@ -102,7 +102,6 @@
{
getScanner( ).scanResources( RESOURCE_NAMES );
getScanner( ).scanDirectories( getFiles( ).toArray( new File[0] ) );
- postScan( );
}
// TODO (PR): what's the equivalent for Web Beans?
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/lifecycle/ApplicationLifecycle.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/lifecycle/ApplicationLifecycle.java 2009-03-01
20:30:41 UTC (rev 1746)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/lifecycle/ApplicationLifecycle.java 2009-03-01
20:30:48 UTC (rev 1747)
@@ -82,4 +82,5 @@
ApplicationContext.INSTANCE.setBeanStore( null );
}
+
}
Show replies by date