[seam-commits] Seam SVN: r14631 - branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Mon Apr 23 08:03:31 EDT 2012
Author: maschmid
Date: 2012-04-23 08:03:30 -0400 (Mon, 23 Apr 2012)
New Revision: 14631
Modified:
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockSeamListener.java
Log:
add begin/end Session to MockSeamListener
Modified: branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockSeamListener.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockSeamListener.java 2012-04-23 09:02:28 UTC (rev 14630)
+++ branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockSeamListener.java 2012-04-23 12:03:30 UTC (rev 14631)
@@ -9,17 +9,20 @@
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
import org.jboss.seam.Seam;
+import org.jboss.seam.contexts.ServletLifecycle;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
/**
- * Used to retrieve real ServletContext for the AbstractSeamTest startSeam
+ * Used to retrieve real ServletContext for the AbstractSeamTest startSeam.
*
* @author Marek Schmidt
*/
-public class MockSeamListener implements ServletContextListener
+public class MockSeamListener implements ServletContextListener, HttpSessionListener
{
private static final LogProvider log = Logging.getLogProvider(ServletContextListener.class);
@@ -32,11 +35,21 @@
servletContext = event.getServletContext();
}
+ public static ServletContext getServletContext() {
+ return servletContext;
+ }
+
public void contextDestroyed(ServletContextEvent event)
{
}
- public static ServletContext getServletContext() {
- return servletContext;
+ public void sessionCreated(HttpSessionEvent event)
+ {
+ ServletLifecycle.beginSession( event.getSession() );
}
+
+ public void sessionDestroyed(HttpSessionEvent event)
+ {
+ ServletLifecycle.endSession( event.getSession() );
+ }
}
More information about the seam-commits
mailing list