[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...
Gavin King
gavin.king at jboss.com
Thu Mar 8 02:25:07 EST 2007
User: gavin
Date: 07/03/08 02:25:06
Modified: src/main/org/jboss/seam/core Manager.java
ConversationEntry.java ConversationEntries.java
Log:
better impl of conv id update
Revision Changes Path
1.155 +4 -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.154
retrieving revision 1.155
diff -u -b -r1.154 -r1.155
--- Manager.java 8 Mar 2007 04:19:30 -0000 1.154
+++ Manager.java 8 Mar 2007 07:25:06 -0000 1.155
@@ -43,7 +43,7 @@
*
* @author Gavin King
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision: 1.154 $
+ * @version $Revision: 1.155 $
*/
@Scope(ScopeType.EVENT)
@Name("org.jboss.seam.core.manager")
@@ -101,8 +101,6 @@
throw new IllegalStateException("Conversation id is already in use");
}
- 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++)
@@ -112,13 +110,12 @@
}
Contexts.getConversationContext().flush();
- currentConversationIdStack.set(0, id);
- //TODO: what about child conversations?!
+ ConversationEntry ce = ConversationEntries.instance().updateConversationId(currentConversationId, id);
setCurrentConversationId(id);
-
if (ce!=null)
{
- ce = createConversationEntry();
+ setCurrentConversationIdStack( ce.getConversationIdStack() );
+ //TODO: what about child conversations?!
}
for (int i=0; i<names.length; i++)
1.35 +2 -2 jboss-seam/src/main/org/jboss/seam/core/ConversationEntry.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ConversationEntry.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/ConversationEntry.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- ConversationEntry.java 8 Mar 2007 01:33:03 -0000 1.34
+++ ConversationEntry.java 8 Mar 2007 07:25:06 -0000 1.35
@@ -17,6 +17,7 @@
public final class ConversationEntry implements Serializable, Comparable<ConversationEntry>
{
private static final long serialVersionUID = 3624635335271963568L;
+
private long lastRequestTime;
private String description;
private String id;
@@ -37,8 +38,7 @@
{
this.id = id;
if (stack==null || id==null) throw new IllegalArgumentException();
- this.conversationIdStack = /*stack==null ?
- Collections.EMPTY_LIST :*/ Collections.unmodifiableList(stack);
+ this.conversationIdStack = stack;
this.startDatetime = new Date();
this.entries = entries;
1.7 +17 -0 jboss-seam/src/main/org/jboss/seam/core/ConversationEntries.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ConversationEntries.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/ConversationEntries.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- ConversationEntries.java 21 Dec 2006 02:38:26 -0000 1.6
+++ ConversationEntries.java 8 Mar 2007 07:25:06 -0000 1.7
@@ -65,6 +65,23 @@
return entry;
}
+ public synchronized ConversationEntry updateConversationId(String oldId, String newId)
+ {
+ ConversationEntry entry = conversationIdEntryMap.remove(oldId);
+ if (entry==null)
+ {
+ return null;
+ }
+ else
+ {
+ entry.setId(newId);
+ entry.getConversationIdStack().set(0, newId);
+ conversationIdEntryMap.put(newId, entry);
+ setDirty();
+ return entry;
+ }
+ }
+
public static ConversationEntries instance()
{
if ( !Contexts.isSessionContextActive() )
More information about the jboss-cvs-commits
mailing list