[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...
Gavin King
gavin.king at jboss.com
Wed Mar 7 22:47:48 EST 2007
User: gavin
Date: 07/03/07 22:47:48
Modified: src/main/org/jboss/seam/core Manager.java
Log:
support for updating ids of long-running conversations
Revision Changes Path
1.152 +10 -7 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.151
retrieving revision 1.152
diff -u -b -r1.151 -r1.152
--- Manager.java 25 Feb 2007 04:11:45 -0000 1.151
+++ Manager.java 8 Mar 2007 03:47:48 -0000 1.152
@@ -43,7 +43,7 @@
*
* @author Gavin King
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision: 1.151 $
+ * @version $Revision: 1.152 $
*/
@Scope(ScopeType.EVENT)
@Name("org.jboss.seam.core.manager")
@@ -90,7 +90,7 @@
}
/**
- * Must not be called from a long-running conversation!
+ * Change the id of the current conversation.
*
* @param id the new conversation id
*/
@@ -98,11 +98,11 @@
{
if ( ConversationEntries.instance().getConversationIds().contains(id) )
{
- throw new IllegalStateException("Cannot update conversation id of long-running conversation");
+ throw new IllegalStateException("Conversation id is already in use");
}
- //this stuff is not really necessary, because probably
- //nothing has been flushed to the session yet!
+ ConversationEntry ce = ConversationEntries.instance().removeConversationEntry(currentConversationId);
+
String[] names = Contexts.getConversationContext().getNames();
Object[] values = new Object[names.length];
for (int i=0; i<names.length; i++)
@@ -115,8 +115,11 @@
currentConversationIdStack.set(0, id);
setCurrentConversationId(id);
- //this stuff is not really necessary, because probably
- //nothing has been flushed to the session yet!
+ if (ce!=null)
+ {
+ ce = createConversationEntry();
+ }
+
for (int i=0; i<names.length; i++)
{
Contexts.getConversationContext().set(names[i], values[i]);
More information about the jboss-cvs-commits
mailing list