private boolean isCurrent() { return id==null || id.equals( Manager.instance().getCurrentConversationId() ); }
private ConversationEntry createConversationEntry() { ConversationEntry entry = ConversationEntries.instance() .createConversationEntry( getCurrentConversationId(), getCurrentConversationIdStack() ); if ( !entry.isNested() ) { //if it is a newly created nested //conversation, we already own the //lock entry.lock(); } return entry; }
/** * Get the conversation id. */ public String getId() { return Manager.instance().getCurrentConversationId(); }
log.debug("Storing conversation state: " + getCurrentConversationId()); log.debug("Discarding conversation state: " + getCurrentConversationId());
public String getParameterValue() { return Manager.instance().getCurrentConversationId(); }
private String getId() { return id==null ? Manager.instance().getCurrentConversationId() : id; }
private void removeCurrentConversationAndDestroyNestedContexts(Map<String, Object> session) { ConversationEntries conversationEntries = ConversationEntries.getInstance(); if (conversationEntries!=null) { conversationEntries.removeConversationEntry( getCurrentConversationId() ); destroyNestedConversationContexts( session, getCurrentConversationId() ); } }
/** * Add the conversation id to a URL, if necessary * * @deprecated use encodeConversationId(String url, String viewId) */ public String encodeConversationId(String url) { //DONT BREAK, icefaces uses this return encodeConversationIdParameter( url, getConversationIdParameter(), getCurrentConversationId() ); }
public ConversationEntry getCurrentConversationEntry() { if (currentConversationEntry==null) { currentConversationEntry = ConversationEntries.instance().getConversationEntry( getCurrentConversationId() ); } return currentConversationEntry; }
@Override public void process() throws Exception { // Extract the calls from the request List<Call> calls = unmarshalCalls(env); // Execute each of the calls for (Call call : calls) { call.execute(); } // Store the conversation ID in the outgoing context ctx.setConversationId( Manager.instance().getCurrentConversationId() ); // Package up the response marshalResponse(calls, ctx, response.getOutputStream()); }
private void updateConversationId() { Manager manager = Manager.instance(); conversationId = manager.isLongRunningConversation() ? manager.getCurrentConversationId() : manager.getParentConversationId(); }
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; } }
public String getCurrentOrNewMainConversationId() { // this case can happend if user logged in from a bookmarked URL that // contains conversation ID String existingConversationId = getConversationIdInURL(); if (existingConversationId != null && existingConversationId.startsWith(MAIN_CONVERSATION_PREFIX)) { return existingConversationId; } if (conversationManager.isReallyLongRunningConversation()) { existingConversationId = conversationManager.getCurrentConversationId(); if (existingConversationId.startsWith(MAIN_CONVERSATION_PREFIX)) { return existingConversationId; } else { return getNextMainConversationId(); } } else { return getNextMainConversationId(); } }
.concat(conversationManager.getCurrentConversationId()); g3 = StringUtils.remove(g3, "\"").concat(conversationId).concat("\"");
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; }
private String getConversationPropagationSuffix() { String suffix = ""; if (!conversationManager.getCurrentConversationEntry().isNested()) { String cId = conversationManager.getCurrentConversationId(); // tmp hack to handle the case when the logo is rendered // just after the page existed the conversation cId = getLastOrMainConversationId(cId); suffix += conversationManager.getConversationIdParameter() + '=' + cId; /** * if (conversationManager.isLongRunningConversation()) { suffix += '&' + * conversationManager.getConversationIsLongRunningParameter() + "true"; lastMainConversation = cId; } **/ } else { ConversationEntry conv = conversationManager.getCurrentConversationEntry(); String convId = conv.getConversationIdStack().get(0); convId = getLastOrMainConversationId(convId); suffix += conversationManager.getConversationIdParameter() + '=' + convId; /** * suffix += '&' + conversationManager.getConversationIsLongRunningParameter() + "true"; * lastMainConversation = convId; **/ } return suffix; }
/** * Make a long-running conversation temporary. */ public void endConversation(boolean beforeRedirect) { if ( isLongRunningConversation() ) { log.debug("Ending long-running conversation"); if ( Events.exists() ) Events.instance().raiseEvent(EVENT_CONVERSATION_END); setLongRunningConversation(false); destroyBeforeRedirect = beforeRedirect; endNestedConversations( getCurrentConversationId() ); storeConversationToViewRootIfNecessary(); } unlockConversation(); }
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(); }*/ }
String conversationId = Manager.instance().getCurrentConversationId(); if (conversationId != null)