/** * Call the JSF navigation handler */ public static void handleOutcome(FacesContext facesContext, String outcome, String fromAction) { facesContext.getApplication().getNavigationHandler() .handleNavigation(facesContext, fromAction, outcome); //after every time that the view may have changed, //we need to flush the page context, since the //attribute map is being discarder Contexts.getPageContext().flush(); }
private void restorePreviousConversationContextIfNecessary(String oldCid) { if (oldCid != null) { Contexts.getConversationContext().flush(); Manager.instance().switchConversation(oldCid, false); } }
public void beforeCompletion() { log.debug( "flushing seam managed jBPM context" ); /*org.jbpm.graph.exe.ProcessInstance processInstance = ProcessInstance.instance(); if (processInstance!=null) { jbpmContext.save(processInstance); }*/ if ( Contexts.isBusinessProcessContextActive() ) { //in requests that come through SeamPhaseListener, //transactions are committed before the contexts are //destroyed, flush here: Contexts.getBusinessProcessContext().flush(); } jbpmContext.getSession().flush(); log.debug( "done flushing seam managed jBPM context" ); }
Contexts.getConversationContext().flush();
private void afterCreateProcess(String processDefinitionName, ProcessInstance process, boolean shouldSignalProcess) { setProcessId( process.getId() ); // need to set process variables before the signal Contexts.getBusinessProcessContext().flush(); if (shouldSignalProcess) { process.signal(); } Events.instance().raiseEvent("org.jboss.seam.createProcess." + processDefinitionName); }
/** * 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; }
Contexts.getConversationContext().remove(names[i]); Contexts.getConversationContext().flush();
@Override public void handle(Exception e) throws Exception { log.debug("redirecting to debug page", e); //no need to be noisy, ExceptionFilter already logs it org.jboss.seam.faces.Redirect redirect = org.jboss.seam.faces.Redirect.instance(); redirect.setViewId("/debug.xhtml"); FacesManager manager = FacesManager.instance(); manager.beforeRedirect("/debug.xhtml"); redirect.setParameter( manager.getConversationIdParameter(), manager.getCurrentConversationId() ); try { redirect.execute(); } catch (RedirectException re) { //do nothing log.debug("could not redirect", re); } Contexts.getConversationContext().flush(); }
pageContext.flush();