/** * Switch to another long-running conversation and mark the conversation as long-running, * overriding a previous call in the same thread to demote a long-running conversation. * * @param id the id of the conversation to switch to * @return true if the conversation exists */ public boolean switchConversation(String id) { return switchConversation(id, true); }
/** * "Pop" the conversation stack, switching to the parent conversation */ public void pop() { String parentId = getParentId(); if (parentId!=null) { Manager.instance().switchConversation(parentId); } }
/** * Switch to the root conversation */ public void root() { String rootId = getRootId(); if (rootId!=null) { Manager.instance().switchConversation(rootId); } }
private void restorePreviousConversationContextIfNecessary(String oldCid) { if (oldCid != null) { Contexts.getConversationContext().flush(); Manager.instance().switchConversation(oldCid, false); } }
/** * Make the root conversation in the current conversation stack temporary. */ public void endRootConversation(boolean beforeRedirect) { if(isNestedConversation()) { switchConversation(getRootConversationId()); } endConversation(beforeRedirect); }
public void destroy() { boolean success = Manager.instance().switchConversation( getId() ); if (success) Manager.instance().endConversation(false); }
/** * Changes the thread's current conversation context to the one that holds a reference to this * component. This is necessary if a nested conversation is making a call to a component in * a parent conversation. */ private String switchToConversationContextOfComponent(Component component) { Manager manager = Manager.instance(); if (manager.isNestedConversation()) { String currentCid = manager.getCurrentConversationId(); String residentCid = manager.getCurrentConversationEntry().findPositionInConversationStack(component); if (!currentCid.equals(residentCid)) { Contexts.getConversationContext().flush(); Manager.instance().switchConversation(residentCid, false); return currentCid; } } return null; }