[jboss-cvs] jboss-seam/src/main/org/jboss/seam/contexts ...
Gavin King
gavin.king at jboss.com
Fri Oct 27 09:58:54 EDT 2006
User: gavin
Date: 06/10/27 09:58:54
Modified: src/main/org/jboss/seam/contexts
ServerConversationContext.java
Log:
minor optimization
Revision Changes Path
1.15 +14 -13 jboss-seam/src/main/org/jboss/seam/contexts/ServerConversationContext.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServerConversationContext.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/ServerConversationContext.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- ServerConversationContext.java 25 Oct 2006 15:14:35 -0000 1.14
+++ ServerConversationContext.java 27 Oct 2006 13:58:54 -0000 1.15
@@ -25,7 +25,7 @@
*
* @author Gavin King
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision: 1.14 $
+ * @version $Revision: 1.15 $
*/
public class ServerConversationContext implements Context {
@@ -171,7 +171,12 @@
*/
public void flush()
{
-
+ Manager manager = Manager.instance();
+ boolean longRunning = manager.isLongRunningConversation() ||
+ !manager.getCurrentConversationId().equals( getId() );
+ if ( longRunning )
+ {
+ //force update for dirty mutable objects
for ( String name: getNamesFromSession() )
{
String key = getKey(name);
@@ -181,17 +186,13 @@
session.setAttribute(key, attribute);
}
}
-
- Manager manager = Manager.instance();
- boolean longRunning = manager.isLongRunningConversation() ||
- !manager.getCurrentConversationId().equals( getId() );
- if ( longRunning )
- {
+ //remove removed objects
for (String name: removals)
{
session.removeAttribute( getKey(name) );
}
removals.clear();
+ //add new objects
for (Map.Entry<String, Object> entry: additions.entrySet())
{
session.setAttribute( getKey( entry.getKey() ), entry.getValue() );
More information about the jboss-cvs-commits
mailing list