org.springframework.webflow.executor.jsf
Class FlowExecutionHolderUtils

java.lang.Object
  extended by org.springframework.webflow.executor.jsf.FlowExecutionHolderUtils

public class FlowExecutionHolderUtils
extends java.lang.Object

A static utility class for accessing the current flow execution holder.

By default, the current flow execution holder is stored associated with the current thread in the FacesContext's ExternalContext.getRequestMap().

Author:
Keith Donald

Constructor Summary
FlowExecutionHolderUtils()
           
 
Method Summary
static void cleanupCurrentFlowExecution(javax.faces.context.FacesContext context)
          Cleans up the current flow execution in the faces context if necessary.
static FlowExecution getCurrentFlowExecution(javax.faces.context.FacesContext context)
          Returns the current flow execution in the given faces context.
static FlowExecutionHolder getFlowExecutionHolder(javax.faces.context.FacesContext context)
          Returns the current flow execution holder for the given faces context.
static FlowExecution getRequiredCurrentFlowExecution(javax.faces.context.FacesContext context)
          Returns the current required flow execution in the given faces context.
static boolean isFlowExecutionRestored(javax.faces.context.FacesContext context)
          Returns true if the flow execution has been restored in the current thread.
static void setFlowExecutionHolder(FlowExecutionHolder holder, javax.faces.context.FacesContext context)
          Sets the current flow execution holder for the given faces context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowExecutionHolderUtils

public FlowExecutionHolderUtils()
Method Detail

getFlowExecutionHolder

public static FlowExecutionHolder getFlowExecutionHolder(javax.faces.context.FacesContext context)
Returns the current flow execution holder for the given faces context.

Parameters:
context - faces context
Returns:
the flow execution holder, or null if none set.

setFlowExecutionHolder

public static void setFlowExecutionHolder(FlowExecutionHolder holder,
                                          javax.faces.context.FacesContext context)
Sets the current flow execution holder for the given faces context.

Parameters:
holder - the flow execution holder
context - faces context

isFlowExecutionRestored

public static boolean isFlowExecutionRestored(javax.faces.context.FacesContext context)
Returns true if the flow execution has been restored in the current thread.

Parameters:
context - the faces context
Returns:
true if restored, false otherwise

getCurrentFlowExecution

public static FlowExecution getCurrentFlowExecution(javax.faces.context.FacesContext context)
Returns the current flow execution in the given faces context.

Parameters:
context - faces context
Returns:
the flow execution or null if no execution is bound

getRequiredCurrentFlowExecution

public static FlowExecution getRequiredCurrentFlowExecution(javax.faces.context.FacesContext context)
                                                     throws javax.faces.el.EvaluationException
Returns the current required flow execution in the given faces context.

Parameters:
context - faces context
Returns:
the flow execution
Throws:
javax.faces.el.EvaluationException - if no flow execution was bound

cleanupCurrentFlowExecution

public static void cleanupCurrentFlowExecution(javax.faces.context.FacesContext context)
Cleans up the current flow execution in the faces context if necessary. Specifically, handles unlocking the execution if necessary and setting the holder to null.

Parameters:
context - the faces context


Copyright © 2004-2007. All Rights Reserved.