[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...
Gavin King
gavin.king at jboss.com
Fri Nov 17 01:48:52 EST 2006
User: gavin
Date: 06/11/17 01:48:52
Modified: src/main/org/jboss/seam/core Manager.java
Log:
improve
Revision Changes Path
1.118 +28 -14 jboss-seam/src/main/org/jboss/seam/core/Manager.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Manager.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Manager.java,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -b -r1.117 -r1.118
--- Manager.java 17 Nov 2006 06:16:00 -0000 1.117
+++ Manager.java 17 Nov 2006 06:48:52 -0000 1.118
@@ -40,7 +40,7 @@
*
* @author Gavin King
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision: 1.117 $
+ * @version $Revision: 1.118 $
*/
@Scope(ScopeType.EVENT)
@Name("org.jboss.seam.core.manager")
@@ -411,17 +411,21 @@
String storedParentConversationId = getRequestParameterValue(parameters, parentConversationIdParameter);
Boolean isLongRunningConversation = "true".equals( getRequestParameterValue(parameters, conversationIsLongRunningParameter) );
- if ( isMissing(storedConversationId) && Contexts.isPageContextActive() )
+ if ( isMissing(storedConversationId) )
+ {
+ if ( Contexts.isPageContextActive() )
{
//if it is not passed as a request parameter,
//try to get it from the page context
org.jboss.seam.core.FacesPage page = org.jboss.seam.core.FacesPage.instance();
storedConversationId = page.getConversationId();
+ storedParentConversationId = null;
isLongRunningConversation = page.isConversationLongRunning();
//if (isLongRunningConversation==null) isLongRunningConversation = false;
}
+ }
- else if (storedConversationId!=null)
+ else
{
log.debug("Found conversation id in request parameter: " + storedConversationId);
}
@@ -430,6 +434,7 @@
if ( "new".equals(storedConversationId) )
{
storedConversationId = null;
+ storedParentConversationId = null;
isLongRunningConversation = false;
}
//end code to remove
@@ -438,10 +443,11 @@
if ( "none".equals(propagation) )
{
storedConversationId = null;
+ storedParentConversationId = null;
isLongRunningConversation = false;
}
- return restoreAndLockConversation(storedConversationId, storedParentConversationId, isLongRunningConversation)
+ return restoreConversation(storedConversationId, storedParentConversationId, isLongRunningConversation)
|| "end".equals(propagation);
}
@@ -500,15 +506,23 @@
* Initialize the request conversation context, given the
* conversation id.
*/
- public boolean restoreAndLockConversation(String storedConversationId, String storedParentConversationId, boolean isLongRunningConversation) {
+ public boolean restoreConversation(String storedConversationId, String storedParentConversationId, boolean isLongRunningConversation) {
ConversationEntry ce = null;
if (storedConversationId!=null)
{
ConversationEntries entries = ConversationEntries.instance();
ce = entries.getConversationEntry(storedConversationId);
- if (ce==null) ce = entries.getConversationEntry(storedParentConversationId);
+ if (ce==null)
+ {
+ ce = entries.getConversationEntry(storedParentConversationId);
+ }
+ }
+
+ return restoreAndLockConversation(ce, isLongRunningConversation);
}
+ private boolean restoreAndLockConversation(ConversationEntry ce, boolean isLongRunningConversation)
+ {
if ( ce!=null && ce.lock() )
{
// do this asap, since there is a window where conversationTimeout() might
@@ -516,9 +530,9 @@
touchConversationStack( ce.getConversationIdStack() );
//we found an id and obtained the lock, so restore the long-running conversation
- log.debug("Restoring conversation with id: " + storedConversationId);
+ log.debug("Restoring conversation with id: " + ce.getId());
setLongRunningConversation(true);
- setCurrentConversationId(storedConversationId);
+ setCurrentConversationId( ce.getId() );
setCurrentConversationIdStack( ce.getConversationIdStack() );
boolean removeAfterRedirect = ce.isRemoveAfterRedirect() && !(
More information about the jboss-cvs-commits
mailing list