[jboss-cvs] jboss-seam/src/main/org/jboss/seam/contexts ...
Gavin King
gavin.king at jboss.com
Thu Sep 28 19:04:08 EDT 2006
User: gavin
Date: 06/09/28 19:04:08
Modified: src/main/org/jboss/seam/contexts Lifecycle.java
Log:
fix exception recovery cycle
Revision Changes Path
1.51 +17 -8 jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Lifecycle.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- Lifecycle.java 23 Sep 2006 12:29:18 -0000 1.50
+++ Lifecycle.java 28 Sep 2006 23:04:08 -0000 1.51
@@ -27,7 +27,7 @@
/**
* @author Gavin King
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision: 1.50 $
+ * @version $Revision: 1.51 $
*/
public class Lifecycle
{
@@ -107,6 +107,12 @@
Contexts.eventContext.set( new MapContext(ScopeType.EVENT) );
}
+ public static void beginExceptionRecovery(ServletContext servletContext, ServletRequest request)
+ {
+ Contexts.applicationContext.set( new WebApplicationContext(servletContext) );
+ Contexts.eventContext.set( new WebRequestContext( ContextAdaptor.getRequest(request) ) );
+ }
+
public static void endInitialization()
{
//instantiate all application-scoped @Startup components
@@ -335,12 +341,6 @@
private static void flushAndDestroyContexts()
{
- if ( Contexts.isEventContextActive() )
- {
- log.debug("destroying event context");
- Contexts.destroy( Contexts.getEventContext() );
- }
-
if ( Contexts.isConversationContextActive() )
{
if ( !Manager.instance().isLongRunningConversation() )
@@ -355,6 +355,15 @@
}
}
+ //destroy the event context after the
+ //conversation context, since we need
+ //the manager to flush() conversation
+ if ( Contexts.isEventContextActive() )
+ {
+ log.debug("destroying event context");
+ Contexts.destroy( Contexts.getEventContext() );
+ }
+
}
public static void resumePage()
More information about the jboss-cvs-commits
mailing list