[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...
Gavin King
gavin.king at jboss.com
Thu Feb 22 14:21:01 EST 2007
User: gavin
Date: 07/02/22 14:21:01
Modified: src/main/org/jboss/seam/core Conversation.java
Log:
JBSEAM-901
Revision Changes Path
1.34 +32 -8 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.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- Conversation.java 21 Dec 2006 02:38:26 -0000 1.33
+++ Conversation.java 22 Feb 2007 19:21:01 -0000 1.34
@@ -28,7 +28,8 @@
@Name("org.jboss.seam.core.conversation")
@Install(precedence=BUILT_IN)
@Intercept(NEVER)
-public class Conversation implements Serializable {
+public class Conversation implements Serializable
+{
private static final long serialVersionUID = -6131304128727444876L;
private Integer timeout;
String description;
@@ -38,7 +39,8 @@
* Get the timeout for this conversation instance.
* @return the timeout in millis
*/
- public Integer getTimeout() {
+ public Integer getTimeout()
+ {
return timeout==null ?
Manager.instance().getCurrentConversationTimeout() :
timeout;
@@ -48,7 +50,8 @@
* Set the timeout for this converstaion instance.
* @param timeout the timeout in millis
*/
- public void setTimeout(Integer timeout) {
+ public void setTimeout(Integer timeout)
+ {
this.timeout = timeout;
}
@@ -141,8 +144,7 @@
public boolean redirect()
{
Manager manager = Manager.instance();
- String viewId = manager.getCurrentConversationViewId();
- return redirect(manager, viewId);
+ return redirect( manager, manager.getCurrentConversationViewId() );
}
private boolean redirect(Manager manager, String viewId)
@@ -166,7 +168,19 @@
*/
public boolean endAndRedirect()
{
- end();
+ return endAndRedirect(false);
+ }
+
+ /**
+ * End a child conversation and redirect to the last defined
+ * view-id for the parent conversation.
+ *
+ * @param endBeforeRedirect should the conversation be destroyed before the redirect?
+ * @return true if a redirect occurred
+ */
+ public boolean endAndRedirect(boolean endBeforeRedirect)
+ {
+ end(endBeforeRedirect);
Manager manager = Manager.instance();
String viewId = manager.getParentConversationViewId();
return redirect(manager, viewId);
@@ -265,7 +279,7 @@
*/
public void end()
{
- Manager.instance().endConversation(false);
+ end(false);
}
/**
@@ -274,7 +288,17 @@
*/
public void endBeforeRedirect()
{
- Manager.instance().endConversation(true);
+ end(true);
+ }
+
+ /**
+ * End a long-runnning conversation.
+ *
+ * @param beforeRedirect should the conversation be destroyed before any redirect?
+ */
+ public void end(boolean beforeRedirect)
+ {
+ Manager.instance().endConversation(beforeRedirect);
}
/**
More information about the jboss-cvs-commits
mailing list