[seam-commits] Seam SVN: r11246 - in branches/community/Seam_2_2/src/main/org/jboss/seam: servlet and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Jul 7 05:02:33 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-07-07 05:02:33 -0400 (Tue, 07 Jul 2009)
New Revision: 11246

Modified:
   branches/community/Seam_2_2/src/main/org/jboss/seam/contexts/Lifecycle.java
   branches/community/Seam_2_2/src/main/org/jboss/seam/contexts/ServletLifecycle.java
   branches/community/Seam_2_2/src/main/org/jboss/seam/servlet/SeamListener.java
Log:
JBSEAM-2255

Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/contexts/Lifecycle.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/contexts/Lifecycle.java	2009-07-06 20:16:17 UTC (rev 11245)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/contexts/Lifecycle.java	2009-07-07 09:02:33 UTC (rev 11246)
@@ -49,9 +49,14 @@
    
    public static void endApplication()
    {
+      endApplication(application);
+   }
+   
+   public static void endApplication(Map<String,Object> app)
+   {
       log.debug("Shutting down application and destroying contexts");
       
-      Context tempApplicationContext = new ApplicationContext( getApplication() );
+      Context tempApplicationContext = new ApplicationContext( app );
       Contexts.applicationContext.set(tempApplicationContext);
       Contexts.destroy(tempApplicationContext);
       Contexts.applicationContext.set(null);
@@ -244,9 +249,13 @@
       }
       
    }
-
    public static void endSession(Map<String, Object> session)
    {
+      endSession(session, application);
+   }
+         
+   public static void endSession(Map<String, Object> session, Map<String,Object> app)
+   {
       log.debug("End of session, destroying contexts");
       
       //This code assumes that sessions are only destroyed at the very end of a  
@@ -258,7 +267,7 @@
          throw new IllegalStateException("Please end the HttpSession via org.jboss.seam.web.Session.instance().invalidate()");
       }
       
-      Context tempApplicationContext = new ApplicationContext( getApplication() );
+      Context tempApplicationContext = new ApplicationContext( app );
       Contexts.applicationContext.set(tempApplicationContext);
    
       //this is used just as a place to stick the ConversationManager

Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/contexts/ServletLifecycle.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/contexts/ServletLifecycle.java	2009-07-06 20:16:17 UTC (rev 11245)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/contexts/ServletLifecycle.java	2009-07-07 09:02:33 UTC (rev 11246)
@@ -141,7 +141,12 @@
    
    public static void endApplication()
    {
-      Lifecycle.endApplication();
+      endApplication(servletContext);
+   }
+   
+   public static void endApplication(ServletContext context)
+   {
+      Lifecycle.endApplication(new ServletApplicationMap( context));
       servletContext=null;
    }
    
@@ -152,7 +157,7 @@
    
    public static void endSession(HttpSession session)
    {
-      Lifecycle.endSession( new ServletSessionMap(session) );
+      Lifecycle.endSession( new ServletSessionMap(session) , new ServletApplicationMap(session.getServletContext()));
    }
    
    public static void resumeConversation(HttpServletRequest request)

Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/servlet/SeamListener.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/servlet/SeamListener.java	2009-07-06 20:16:17 UTC (rev 11245)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/servlet/SeamListener.java	2009-07-07 09:02:33 UTC (rev 11246)
@@ -38,7 +38,7 @@
    
    public void contextDestroyed(ServletContextEvent event) 
    {
-      ServletLifecycle.endApplication();
+      ServletLifecycle.endApplication(event.getServletContext());
    }
    
    public void sessionCreated(HttpSessionEvent event) 




More information about the seam-commits mailing list