[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...
Gavin King
gavin.king at jboss.com
Sun Oct 8 17:32:27 EDT 2006
User: gavin
Date: 06/10/08 17:32:27
Modified: src/main/org/jboss/seam/core Conversation.java
Manager.java
Log:
fixed JBSEAM-372, s:link with nested conversations
Revision Changes Path
1.21 +10 -5 jboss-seam/src/main/org/jboss/seam/core/Conversation.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Conversation.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Conversation.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- Conversation.java 13 Jul 2006 00:59:43 -0000 1.20
+++ Conversation.java 8 Oct 2006 21:32:27 -0000 1.21
@@ -3,7 +3,6 @@
import static org.jboss.seam.InterceptionType.NEVER;
import java.io.Serializable;
-import java.util.LinkedList;
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
@@ -218,12 +217,19 @@
}
/**
+ * Is this conversation a nested conversation?
+ */
+ public boolean isNested()
+ {
+ return Manager.instance().isNestedConversation();
+ }
+
+ /**
* Get the id of the immediate parent of a nested conversation
*/
public String getParentId()
{
- LinkedList<String> conversationIdStack = Manager.instance().getCurrentConversationIdStack();
- return conversationIdStack.size()>1 ? conversationIdStack.get(1) : null;
+ return Manager.instance().getParentConversationId();
}
/**
@@ -231,8 +237,7 @@
*/
public String getRootId()
{
- LinkedList<String> conversationIdStack = Manager.instance().getCurrentConversationIdStack();
- return conversationIdStack.get( conversationIdStack.size()-1 );
+ return Manager.instance().getRootConversationId();
}
/**
1.88 +14 -9 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.87
retrieving revision 1.88
diff -u -b -r1.87 -r1.88
--- Manager.java 30 Sep 2006 16:36:32 -0000 1.87
+++ Manager.java 8 Oct 2006 21:32:27 -0000 1.88
@@ -44,7 +44,7 @@
*
* @author Gavin King
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision: 1.87 $
+ * @version $Revision: 1.88 $
*/
@Scope(ScopeType.EVENT)
@Name("org.jboss.seam.core.manager")
@@ -274,14 +274,14 @@
public String getParentConversationId()
{
- if ( currentConversationIdStack==null || currentConversationIdStack.size()<2 )
- {
- return null;
+ return currentConversationIdStack==null || currentConversationIdStack.size()<2 ?
+ null : currentConversationIdStack.get(1);
}
- else
+
+ public String getRootConversationId()
{
- return currentConversationIdStack.get(1);
- }
+ return currentConversationIdStack==null || currentConversationIdStack.size()<1 ?
+ null : currentConversationIdStack.get( currentConversationIdStack.size()-1 );
}
@Destroy
@@ -308,6 +308,11 @@
!Seam.isSessionInvalid();
}
+ public boolean isNestedConversation()
+ {
+ return currentConversationIdStack.size()>1;
+ }
+
public void setLongRunningConversation(boolean isLongRunningConversation)
{
this.isLongRunningConversation = isLongRunningConversation;
More information about the jboss-cvs-commits
mailing list