Author: shane.bryzak(a)jboss.com
Date: 2008-07-11 00:07:59 -0400 (Fri, 11 Jul 2008)
New Revision: 54
Added:
ri/trunk/webbeans-impl/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
Modified:
ri/trunk/
ri/trunk/webbeans-impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java
Log:
initial ServletLifecycle implementation
Property changes on: ri/trunk
___________________________________________________________________
Name: svn:ignore
+ Web Beans 20080605.pdf
Added:
ri/trunk/webbeans-impl/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
===================================================================
--- ri/trunk/webbeans-impl/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
(rev 0)
+++
ri/trunk/webbeans-impl/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2008-07-11
04:07:59 UTC (rev 54)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.servlet;
+
+import javax.servlet.ServletContext;
+
+/**
+ *
+ * @author Shane Bryzak
+ *
+ */
+public class ServletLifecycle
+{
+ private static ServletContext servletContext;
+
+ public static void beginApplication(ServletContext context)
+ {
+ servletContext = context;
+ }
+
+ public static ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+}
Modified:
ri/trunk/webbeans-impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java
===================================================================
---
ri/trunk/webbeans-impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java 2008-07-08
13:27:03 UTC (rev 53)
+++
ri/trunk/webbeans-impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java 2008-07-11
04:07:59 UTC (rev 54)
@@ -5,6 +5,8 @@
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
+import org.jboss.seam.contexts.ServletLifecycle;
+
/**
*
* @author Shane Bryzak
@@ -13,22 +15,25 @@
public class WebBeansListener implements ServletContextListener, HttpSessionListener
{
- public void contextDestroyed(ServletContextEvent arg0) {
- // TODO Auto-generated method stub
-
+
+ public void contextInitialized(ServletContextEvent event)
+ {
+ ServletLifecycle.beginApplication( event.getServletContext() );
}
- public void contextInitialized(ServletContextEvent arg0) {
- // TODO Auto-generated method stub
-
+ public void sessionCreated(HttpSessionEvent event)
+ {
+ ServletLifecycle.beginSession( event.getSession() );
}
- public void sessionCreated(HttpSessionEvent arg0) {
+ public void sessionDestroyed(HttpSessionEvent event)
+ {
// TODO Auto-generated method stub
-
+
}
- public void sessionDestroyed(HttpSessionEvent arg0) {
+ public void contextDestroyed(ServletContextEvent event)
+ {
// TODO Auto-generated method stub
}