/** * Temporarily promote a temporary conversation to * a long running conversation for the duration of * a browser redirect. After the redirect, the * conversation will be demoted back to a temporary * conversation. */ public void beforeRedirect() { //DONT BREAK, icefaces uses this if (!destroyBeforeRedirect) { ConversationEntry ce = getCurrentConversationEntry(); if (ce==null) { ce = createConversationEntry(); } //ups, we don't really want to destroy it on this request after all! ce.setRemoveAfterRedirect( !isLongRunningConversation() ); setLongRunningConversation(true); } }
/** * Begin a new nested conversation. */ public void beginNestedConversation() { log.debug("Beginning nested conversation"); List<String> oldStack = getCurrentConversationIdStack(); if (oldStack==null) { throw new IllegalStateException("No long-running conversation active"); } String id = Id.nextId(); setCurrentConversationId(id); createCurrentConversationIdStack(id).addAll(oldStack); createConversationEntry(); storeConversationToViewRootIfNecessary(); if ( Events.exists() ) Events.instance().raiseEvent(EVENT_CONVERSATION_BEGIN); }
/** * Promote a temporary conversation and make it long-running */ public void beginConversation() { if ( !isLongRunningConversation() ) { log.debug("Beginning long-running conversation"); setLongRunningConversation(true); createConversationEntry(); Conversation.instance(); //force instantiation of the Conversation in the outer (non-nested) conversation storeConversationToViewRootIfNecessary(); if ( Events.exists() ) Events.instance().raiseEvent(EVENT_CONVERSATION_BEGIN); } }