Author: pete.muir(a)jboss.org
Date: 2009-03-27 16:19:22 -0400 (Fri, 27 Mar 2009)
New Revision: 2239
Added:
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/ServletListener.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/helpers/
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/helpers/AbstractServletListener.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/helpers/ForwardingServletListener.java
Modified:
ri/trunk/
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/Namespace.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java
ri/trunk/spi/pom.xml
ri/trunk/spi/src/main/java/org/jboss/webbeans/manager/api/WebBeansManager.java
ri/trunk/version-matrix/pom.xml
Log:
move some helper classes to SPI
Property changes on: ri/trunk
___________________________________________________________________
Name: svn:ignore
- target
.classpath
.settings
.project
+
arget
.classpath
.settings
.project
tests
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-03-27 20:15:58
UTC (rev 2238)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-03-27 20:19:22
UTC (rev 2239)
@@ -63,6 +63,7 @@
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bean.proxy.ClientProxyProvider;
import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
+import org.jboss.webbeans.context.ApplicationContext;
import org.jboss.webbeans.context.ContextMap;
import org.jboss.webbeans.context.CreationalContextImpl;
import org.jboss.webbeans.ejb.EjbDescriptorCache;
@@ -73,8 +74,11 @@
import org.jboss.webbeans.injection.resolution.Resolver;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.manager.api.WebBeansManager;
import org.jboss.webbeans.metadata.MetaDataCache;
+import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.util.Beans;
import org.jboss.webbeans.util.Reflections;
@@ -90,6 +94,8 @@
public class ManagerImpl implements WebBeansManager, Serializable
{
+ private static final Log log = Logging.getLog(ManagerImpl.class);
+
private static final long serialVersionUID = 3021562879133838561L;
// The JNDI key to place the manager under
@@ -996,12 +1002,14 @@
return taskExecutor;
}
- /**
- * Cleans up resources held by the manager prior to shutting down a VM.
- */
- public void cleanup()
+ public void shutdown()
{
+ log.trace("Ending application");
shutdownExecutors();
+ ApplicationContext.INSTANCE.destroy();
+ ApplicationContext.INSTANCE.setActive(false);
+ ApplicationContext.INSTANCE.setBeanStore(null);
+ getServices().get(NamingContext.class).unbind(ManagerImpl.JNDI_KEY);
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-03-27
20:15:58 UTC (rev 2238)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-03-27
20:19:22 UTC (rev 2239)
@@ -22,7 +22,6 @@
import java.util.List;
import javax.inject.ExecutionException;
-import javax.inject.manager.Manager;
import org.jboss.webbeans.BeanValidator;
import org.jboss.webbeans.CurrentManager;
@@ -233,20 +232,10 @@
RequestContext.INSTANCE.setBeanStore(null);
RequestContext.INSTANCE.setActive(false);
}
-
- protected void endApplication(BeanStore applicationBeanStore)
- {
- log.trace("Ending application");
- ApplicationContext.INSTANCE.destroy();
- ApplicationContext.INSTANCE.setActive(false);
- ApplicationContext.INSTANCE.setBeanStore(null);
- }
public void shutdown()
{
- endApplication(getApplicationContext());
- manager.cleanup();
- getServices().get(NamingContext.class).unbind(ManagerImpl.JNDI_KEY);
+ manager.shutdown();
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/Namespace.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/Namespace.java 2009-03-27 20:15:58
UTC (rev 2238)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/Namespace.java 2009-03-27 20:19:22
UTC (rev 2239)
@@ -4,7 +4,7 @@
import java.util.Map;
/**
- * A namespace for Seam component names.
+ * A namespace for bean names
*
* @author Gavin King
*
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java 2009-03-27
20:15:58 UTC (rev 2238)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java 2009-03-27
20:19:22 UTC (rev 2239)
@@ -18,11 +18,11 @@
package org.jboss.webbeans.servlet;
import javax.servlet.ServletRequestEvent;
-import javax.servlet.ServletRequestListener;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSessionEvent;
-import javax.servlet.http.HttpSessionListener;
+import org.jboss.webbeans.servlet.api.helpers.AbstractServletListener;
+
/**
* The Web Beans listener
*
@@ -33,7 +33,7 @@
* @author Nicklas Karlsson
*
*/
-public class WebBeansListener implements HttpSessionListener, ServletRequestListener
+public class WebBeansListener extends AbstractServletListener
{
private final ServletLifecycle lifecycle;
@@ -48,6 +48,7 @@
*
* @param event The session event
*/
+ @Override
public void sessionCreated(HttpSessionEvent event)
{
lifecycle.beginSession(event.getSession());
@@ -58,6 +59,7 @@
*
* @param event The session event
*/
+ @Override
public void sessionDestroyed(HttpSessionEvent event)
{
lifecycle.endSession(event.getSession());
@@ -68,6 +70,7 @@
*
* @param event The request event
*/
+ @Override
public void requestDestroyed(ServletRequestEvent event)
{
if (event.getServletRequest() instanceof HttpServletRequest)
@@ -85,6 +88,7 @@
*
* @param event The request event
*/
+ @Override
public void requestInitialized(ServletRequestEvent event)
{
if (event.getServletRequest() instanceof HttpServletRequest)
Modified: ri/trunk/spi/pom.xml
===================================================================
--- ri/trunk/spi/pom.xml 2009-03-27 20:15:58 UTC (rev 2238)
+++ ri/trunk/spi/pom.xml 2009-03-27 20:19:22 UTC (rev 2239)
@@ -40,6 +40,12 @@
<artifactId>jta</artifactId>
<optional>true</optional>
</dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <optional>true</optional>
+ </dependency>
</dependencies>
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/manager/api/WebBeansManager.java
===================================================================
---
ri/trunk/spi/src/main/java/org/jboss/webbeans/manager/api/WebBeansManager.java 2009-03-27
20:15:58 UTC (rev 2238)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/manager/api/WebBeansManager.java 2009-03-27
20:19:22 UTC (rev 2239)
@@ -17,6 +17,8 @@
package org.jboss.webbeans.manager.api;
+import java.io.Serializable;
+
import javax.inject.manager.Manager;
/**
@@ -26,7 +28,7 @@
* @author Pete Muir
*
*/
-public interface WebBeansManager extends Manager
+public interface WebBeansManager extends Manager, Serializable
{
/**
@@ -37,4 +39,6 @@
*/
public void injectNonContextualInstance(Object instance);
+ public void shutdown();
+
}
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/ServletListener.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/ServletListener.java
(rev 0)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/ServletListener.java 2009-03-27
20:19:22 UTC (rev 2239)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.servlet.api;
+
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletRequestListener;
+import javax.servlet.http.HttpSessionListener;
+
+public interface ServletListener extends ServletContextListener, ServletRequestListener,
HttpSessionListener
+{
+
+
+
+}
Property changes on:
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/ServletListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/helpers/AbstractServletListener.java
===================================================================
---
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/helpers/AbstractServletListener.java
(rev 0)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/helpers/AbstractServletListener.java 2009-03-27
20:19:22 UTC (rev 2239)
@@ -0,0 +1,30 @@
+package org.jboss.webbeans.servlet.api.helpers;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.http.HttpSessionEvent;
+
+import org.jboss.webbeans.servlet.api.ServletListener;
+
+/**
+ * No-op implementation of ServletListener
+ *
+ * @author Pete Muir
+ *
+ */
+public class AbstractServletListener implements ServletListener
+{
+
+ public void contextDestroyed(ServletContextEvent sce) {}
+
+ public void contextInitialized(ServletContextEvent sce) {}
+
+ public void requestDestroyed(ServletRequestEvent sre) {}
+
+ public void requestInitialized(ServletRequestEvent sre) {}
+
+ public void sessionCreated(HttpSessionEvent se) {}
+
+ public void sessionDestroyed(HttpSessionEvent se) {}
+
+}
Property changes on:
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/helpers/AbstractServletListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/helpers/ForwardingServletListener.java
===================================================================
---
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/helpers/ForwardingServletListener.java
(rev 0)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/helpers/ForwardingServletListener.java 2009-03-27
20:19:22 UTC (rev 2239)
@@ -0,0 +1,44 @@
+package org.jboss.webbeans.servlet.api.helpers;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.http.HttpSessionEvent;
+
+import org.jboss.webbeans.servlet.api.ServletListener;
+
+public abstract class ForwardingServletListener implements ServletListener
+{
+
+ protected abstract ServletListener delegate();
+
+ public void contextDestroyed(ServletContextEvent sce)
+ {
+ delegate().contextDestroyed(sce);
+ }
+
+ public void contextInitialized(ServletContextEvent sce)
+ {
+ delegate().contextInitialized(sce);
+ }
+
+ public void requestDestroyed(ServletRequestEvent sre)
+ {
+ delegate().requestDestroyed(sre);
+ }
+
+ public void requestInitialized(ServletRequestEvent sre)
+ {
+ delegate().requestInitialized(sre);
+ }
+
+ public void sessionCreated(HttpSessionEvent se)
+ {
+ delegate().sessionCreated(se);
+ }
+
+ public void sessionDestroyed(HttpSessionEvent se)
+ {
+ delegate().sessionDestroyed(se);
+ }
+
+}
Property changes on:
ri/trunk/spi/src/main/java/org/jboss/webbeans/servlet/api/helpers/ForwardingServletListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-03-27 20:15:58 UTC (rev 2238)
+++ ri/trunk/version-matrix/pom.xml 2009-03-27 20:19:22 UTC (rev 2239)
@@ -49,6 +49,7 @@
<properties>
<jsr299.tck.version>1.0.0-SNAPSHOT</jsr299.tck.version>
<webbeans.version>1.0.0-SNAPSHOT</webbeans.version>
+ <webbeans.tomcat.version>1.0.0-SNAPSHOT</webbeans.tomcat.version>
</properties>
<dependencyManagement>
@@ -142,10 +143,16 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_10</version>
+ <version>1.2_12</version>
</dependency>
<dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_12</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-embedded</artifactId>
<version>1.0.0-Alpha1</version>
@@ -248,6 +255,18 @@
<artifactId>webbeans-logging</artifactId>
<version>${webbeans.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans.tomcat</groupId>
+ <artifactId>webbeans-tomcat-int</artifactId>
+ <version>${webbeans.tomcat.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans.tomcat</groupId>
+ <artifactId>webbeans-tomcat</artifactId>
+ <version>${webbeans.tomcat.version}</version>
+ </dependency>
<dependency>
<groupId>org.jboss.jsr299.tck</groupId>
@@ -261,6 +280,8 @@
<version>${jsr299.tck.version}</version>
</dependency>
+
+
<dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness</artifactId>
@@ -455,6 +476,11 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>1.2</version>
+ </plugin>
</plugins>
</pluginManagement>
</build>