[seam-commits] Seam SVN: r9177 - in trunk: src/main/org/jboss/seam/contexts and 1 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Oct 2 13:32:59 EDT 2008
Author: pete.muir at jboss.org
Date: 2008-10-02 13:32:59 -0400 (Thu, 02 Oct 2008)
New Revision: 9177
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Events.xml
trunk/src/main/org/jboss/seam/contexts/ServletLifecycle.java
trunk/src/main/org/jboss/seam/init/Initialization.java
Log:
JBSEAM-3489
Modified: trunk/doc/Seam_Reference_Guide/en-US/Events.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Events.xml 2008-10-02 17:20:56 UTC (rev 9176)
+++ trunk/doc/Seam_Reference_Guide/en-US/Events.xml 2008-10-02 17:32:59 UTC (rev 9177)
@@ -682,6 +682,7 @@
<listitem><para><literal>org.jboss.seam.beforePhase </literal>— called before the start of a JSF phase</para></listitem>
<listitem><para><literal>org.jboss.seam.afterPhase </literal>— called after the end of a JSF phase</para></listitem>
<listitem><para><literal>org.jboss.seam.postInitialization </literal>— called when Seam has initialized and started up all components</para></listitem>
+ <listitem><para><literal>org.jboss.seam.postReInitialization </literal>— called when Seam has re-initialized and started up all components after a redeploy</para></listitem>
<listitem><para><literal>org.jboss.seam.postAuthenticate.<name> </literal>— called after a user is authenticated</para></listitem>
<listitem><para><literal>org.jboss.seam.preAuthenticate.<name> </literal>— called before attempting to authenticate a user</para></listitem>
<listitem><para><literal>org.jboss.seam.notLoggedIn</literal> — called there is no authenticated user and authentication is required</para></listitem>
Modified: trunk/src/main/org/jboss/seam/contexts/ServletLifecycle.java
===================================================================
--- trunk/src/main/org/jboss/seam/contexts/ServletLifecycle.java 2008-10-02 17:20:56 UTC (rev 9176)
+++ trunk/src/main/org/jboss/seam/contexts/ServletLifecycle.java 2008-10-02 17:32:59 UTC (rev 9177)
@@ -73,20 +73,37 @@
}
}
- public static void beginInitialization()
+ public static void beginReinitialization(HttpServletRequest request)
{
- log.debug(">>> Begin initialization");
+ log.debug(">>> Begin re-initialization");
Contexts.applicationContext.set( new ApplicationContext( Lifecycle.getApplication() ) );
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
+ Contexts.sessionContext.set( new SessionContext( new ServletRequestSessionMap(request) ) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
}
-
- public static void beginReinitialization(HttpServletRequest request)
+
+ public static void endReinitialization()
{
- log.debug(">>> Begin re-initialization");
+ Contexts.startup(ScopeType.APPLICATION);
+
+ Events.instance().raiseEvent("org.jboss.seam.postReInitialization");
+
+ // Clean up contexts used during reinitialization
+ Contexts.destroy( Contexts.getConversationContext() );
+ Contexts.conversationContext.set(null);
+ Contexts.destroy( Contexts.getEventContext() );
+ Contexts.eventContext.set(null);
+ Contexts.sessionContext.set(null);
+ Contexts.applicationContext.set(null);
+
+ log.debug("<<< End re-initialization");
+ }
+
+ public static void beginInitialization()
+ {
+ log.debug(">>> Begin initialization");
Contexts.applicationContext.set( new ApplicationContext( Lifecycle.getApplication() ) );
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
- Contexts.sessionContext.set( new SessionContext( new ServletRequestSessionMap(request) ) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
}
Modified: trunk/src/main/org/jboss/seam/init/Initialization.java
===================================================================
--- trunk/src/main/org/jboss/seam/init/Initialization.java 2008-10-02 17:20:56 UTC (rev 9176)
+++ trunk/src/main/org/jboss/seam/init/Initialization.java 2008-10-02 17:32:59 UTC (rev 9177)
@@ -719,7 +719,7 @@
Contexts.getApplicationContext().remove(Seam.getComponentName(Exceptions.class));
}
- ServletLifecycle.endInitialization();
+ ServletLifecycle.endReinitialization();
return this;
}
More information about the seam-commits
mailing list