public boolean isLongRunningOrNestedConversation() { return isLongRunningConversation() || isNestedConversation(); }
/** * Is this conversation a nested conversation? */ public boolean isNested() { return Manager.instance().isNestedConversation(); }
public boolean isCurrent() { Manager manager = Manager.instance(); if ( manager.isLongRunningConversation() ) { return id.equals( manager.getCurrentConversationId() ); } else if ( manager.isNestedConversation() ) { return id.equals( manager.getParentConversationId() ); } else { return false; } }
if ( isNestedConversation() ) .append('=') .append( encode(paramValue) ); if ( isNestedConversation() && !isReallyLongRunningConversation() )
/** * Make the root conversation in the current conversation stack temporary. */ public void endRootConversation(boolean beforeRedirect) { if(isNestedConversation()) { switchConversation(getRootConversationId()); } endConversation(beforeRedirect); }
private String getLongRunningConversationId() { Manager manager = Manager.instance(); if ( manager.isLongRunningConversation() ) { return manager.getCurrentConversationId(); } else if ( manager.isNestedConversation() ) { return manager.getParentConversationId(); } else { //TODO: is there any way to set it to the current outcome, instead of null? return null; } }
/** * 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; }
public void unlockConversation() { ConversationEntry ce = getCurrentConversationEntry(); if (ce!=null) { if ( ce.isLockedByCurrentThread() ) { ce.unlock(); } } else if ( isNestedConversation() ) { ConversationEntries.instance().getConversationEntry( getParentConversationId() ).unlock(); } }
public void storeConversation() { Manager manager = Manager.instance(); //we only need to execute this code when we are in the //RENDER_RESPONSE phase, ie. not before redirects Session session = Session.getInstance(); boolean sessionInvalid = session!=null && session.isInvalid(); if ( !sessionInvalid && manager.isLongRunningConversation() ) { storeConversation( manager.getCurrentConversationId() ); } else if ( !sessionInvalid && manager.isNestedConversation() ) { discardNestedConversation( manager.getParentConversationId() ); } else { discardTemporaryConversation(); } /*if ( !sessionInvalid && Init.instance().isClientSideConversations() ) { // if we are using client-side conversations, put the // map containing the conversation context variables // into the view root (or remove it for a temp // conversation context) Contexts.getConversationContext().flush(); }*/ }