/** * Get the timeout for this conversation instance. * @return the timeout in millis */ public Integer getTimeout() { return timeout==null ? Manager.instance().getCurrentConversationTimeout() : timeout; }
public String getDescription() { return description==null ? Manager.instance().getCurrentConversationDescription() : description; }
/** * Get the conversation id. */ public String getId() { return Manager.instance().getCurrentConversationId(); }
/** * Is this conversation long-running? Note that this method returns * false even when the conversation has been temporarily promoted * to long-running for the course of a redirect, so it does what * the user really expects. */ public boolean isLongRunning() { return Manager.instance().isReallyLongRunningConversation(); }
/** * Is there a long running conversation associated with the current request? */ protected boolean isLongRunningConversation() { return Manager.instance().isLongRunningConversation(); }
public int getTimeout() { return timeout==null ? Manager.instance().getConversationTimeout() : timeout; }
/** * Kills all conversations except the current one */ public void killAllOthers() { Manager.instance().killAllOtherConversations(); }
private void demoteConversation() { if (this.iPromotedTheConversation) { Manager.instance().setLongRunningConversation(false); this.iPromotedTheConversation = false; } }
public String getViewId() { return viewId==null ? Manager.instance().getCurrentConversationViewId() : viewId; }
/** * Leave the scope of the current conversation */ public void leave() { Manager.instance().leaveConversation(); }
/** * Is this conversation a nested conversation? */ public boolean isNested() { return Manager.instance().isNestedConversation(); }
/** * Get the id of root conversation of a nested conversation */ public String getRootId() { return Manager.instance().getRootConversationId(); }
private boolean isMissingJoin(Method method) { return Manager.instance().isLongRunningOrNestedConversation() && ( ( method.isAnnotationPresent(Begin.class) && !method.getAnnotation(Begin.class).join() && !method.getAnnotation(Begin.class).nested() ) || method.isAnnotationPresent(BeginTask.class) || method.isAnnotationPresent(StartTask.class) ); }
protected void afterResponseComplete(FacesContext facesContext) { //responseComplete() was called by one of the other phases, //so we will never get to the RENDER_RESPONSE phase //Note: we can't call Manager.instance().beforeRedirect() here, //since a redirect is not the only reason for a responseComplete ExternalContext externalContext = facesContext.getExternalContext(); Manager.instance().endRequest( externalContext.getSessionMap() ); FacesLifecycle.endRequest( facesContext.getExternalContext() ); }
/** * "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 boolean isNoConversationRedirectRequired(Page page) { return page.isConversationRequired() && !Manager.instance().isLongRunningOrNestedConversation(); }
/** * Switch back to the last defined view-id for the * current conversation. * * @return true if a redirect occurred */ public boolean redirect() { Manager manager = Manager.instance(); return redirect( manager, manager.getCurrentConversationViewId() ); }
private void updateConversationId() { Manager manager = Manager.instance(); conversationId = manager.isLongRunningConversation() ? manager.getCurrentConversationId() : manager.getParentConversationId(); }