Top Inners Fields Constructors Methods
com.sun.faces.flow

public Class FlowHandlerImpl

extends FlowHandler
Class Inheritance
Imports
com.sun.faces.application.NavigationHandlerImpl, com.sun.faces.util.Util, java.io.Serializable, java.text.MessageFormat, java.util.ArrayDeque, .HashMap, .Iterator, .List, .Map, java.util.concurrent.ConcurrentHashMap, .CopyOnWriteArrayList, javax.el.ELContext, .MethodExpression, .ValueExpression, javax.faces.application.ConfigurableNavigationHandler, .NavigationHandler, javax.faces.context.ExternalContext, .FacesContext, javax.faces.flow.FlowCallNode, .Flow, .FlowHandler, .Parameter

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
private boolean
private final Map<String, Map<String, Flow>>
private final Map<String, List<Flow>>
Inherited from javax.faces.flow.FlowHandler:
FLOW_ID_REQUEST_PARAM_NAMENULL_FLOWTO_FLOW_DOCUMENT_ID_REQUEST_PARAM_NAME

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addFlow(FacesContext
the FacesContext for the current request.
context
,
Flow
the Flow to add.
toAdd
)

Implements abstract javax.faces.flow.FlowHandler.addFlow.

Add the argument Flow to the collection of Flows known to the current application.

private void
assignInboundParameters(FacesContext context, Flow calledFlow, Map<String, Object> evaluatedParams)

private void
callFinalizer(FacesContext context, Flow currentFlow, int depth)

public void
clientWindowTransition(FacesContext
the FacesContext for the current request.
context
)

Implements abstract javax.faces.flow.FlowHandler.clientWindowTransition.

Allow for flow transitions in the case of components rendered by the renderers from component-family javax.faces.OutcomeTarget.

private boolean
flowsEqual(Flow flow1, Flow flow2)

private void
public int
public Flow
getCurrentFlow(FacesContext
the FacesContext for the current request.
context
)

Implements abstract javax.faces.flow.FlowHandler.getCurrentFlow.

Return the currently active Flow for the argument FacesContext, or null if no flow is active.

public Map<Object, Object>
getCurrentFlowScope()

Implements abstract javax.faces.flow.FlowHandler.getCurrentFlowScope.

Return the Map that backs the #{flowScope} EL implicit object or null if no flow is currently active.

public Flow
getFlow(FacesContext
the FacesContext for the current request.
context
,
String
An application unique identifier for the document in which the returned flow is defined.
definingDocumentId
,
String
the id of a Flow, unique within the scope of the definingDocument.
id
)

Implements abstract javax.faces.flow.FlowHandler.getFlow.

Return the Flow whose id is equivalent to the argument id, within the scope of the argument definingDocument.

pack-priv static FlowHandlerImpl.FlowDeque<Flow>
public String
getLastDisplayedViewId(FacesContext
the FacesContext for the current request.
context
)

Implements abstract javax.faces.flow.FlowHandler.getLastDisplayedViewId.

Return the last displayed viewId for the current flow, as returned by getCurrentFlow(javax.faces.context.FacesContext), or null if there is no current flow.

public boolean
isActive(FacesContext
the FacesContext for the current request.
context
,
String
An application unique identifier for the document in which the returned flow is defined.
definingDocumentId
,
String
the id of a Flow, unique within the scope of the definingDocument.
id
)

Implements abstract javax.faces.flow.FlowHandler.isActive.

Return true if and only if the flow referenced by the argument definingDocument and id is currently active.

private Flow
private void
performPops(FacesContext context, Flow sourceFlow, Flow targetFlow)

private Flow
public void
popReturnMode(FacesContext
the FacesContext for the current request.
context
)

Implements abstract javax.faces.flow.FlowHandler.popReturnMode.

Enable the correct handling of navigation when processing a return node.

private void
pushFlow(FacesContext context, Flow toPush, String lastDisplayedViewId, Map<String, Object> evaluatedParams)

public void
pushReturnMode(FacesContext
the FacesContext for the current request.
context
)

Implements abstract javax.faces.flow.FlowHandler.pushReturnMode.

Enable the correct handling of navigation when processing a return node.

public void
transition(FacesContext
the FacesContext for the current request.
context
,
Flow
the current Flow, or null if there is no source flow.
sourceFlow
,
Flow
the destination Flow, or null if there is no destination flow.
targetFlow
,
FlowCallNode
the flow call node causing this transition, or null if this transition is not caused by a flow call.
outboundCallNode
,
String
the viewId of the view being displayed as a result of this transition. This parameter makes it possible to implement getLastDisplayedViewId.
toViewId
)

Implements abstract javax.faces.flow.FlowHandler.transition.

Perform a transition in the flow graph for the current user's javax.faces.lifecycle.ClientWindow.

Inherited from javax.faces.flow.FlowHandler:
getCurrentFlow

Field Detail

ABANDONED_FLOWback to summary
public static final String ABANDONED_FLOW
FLOW_RETURN_DEPTH_PARAM_NAMEback to summary
public static final String FLOW_RETURN_DEPTH_PARAM_NAME
flowFeatureIsEnabledback to summary
private boolean flowFeatureIsEnabled
flowsback to summary
private final Map<String, Map<String, Flow>> flows
flowsByFlowIdback to summary
private final Map<String, List<Flow>> flowsByFlowId

Constructor Detail

FlowHandlerImplback to summary
public FlowHandlerImpl()

Method Detail

addFlowback to summary
public void addFlow(FacesContext context, Flow toAdd)

Implements abstract javax.faces.flow.FlowHandler.addFlow.

Doc from javax.faces.flow.FlowHandler.addFlow.

Add the argument Flow to the collection of Flows known to the current application. The implementation must be thread safe.

Parameters
context:FacesContext

the FacesContext for the current request.

toAdd:Flow

the Flow to add.

Annotations
@Override
assignInboundParametersback to summary
private void assignInboundParameters(FacesContext context, Flow calledFlow, Map<String, Object> evaluatedParams)
callFinalizerback to summary
private void callFinalizer(FacesContext context, Flow currentFlow, int depth)
clientWindowTransitionback to summary
public void clientWindowTransition(FacesContext context)

Implements abstract javax.faces.flow.FlowHandler.clientWindowTransition.

Doc from javax.faces.flow.FlowHandler.clientWindowTransition.

Allow for flow transitions in the case of components rendered by the renderers from component-family javax.faces.OutcomeTarget. These transitions must happen at the front of the request processing lifecycle due to the HTTP GET based nature of such components. Therefore, this method is called from the restore view phase of the lifecycle.

Let flowId be the value in the request parameter map for the parameter whose name is given by the value of FLOW_ID_REQUEST_PARAM_NAME. Let toFlowDocumentId be the value in the request parameter map for the paramater whose name is given by the value of TO_FLOW_DOCUMENT_ID_REQUEST_PARAM_NAME. If toFlowDocumentId is null, take no action and return. Otherwise, let sourceFlow be the return from getCurrentFlow(javax.faces.context.FacesContext). A null value indicates there is no current flow, which will be the case if this navigation is trying to enter a flow. If flowId is not null and toFlowDocumentId is not equal to the value of NULL_FLOW, let targetFlow be the result of calling getFlow(javax.faces.context.FacesContext, java.lang.String, java.lang.String), passing toFlowDocumentId and flowId as the last two arguments, respectively. If the result is non-null, let flowCallNode be the return from calling Flow#getFlowCall on the sourceFlow, passing targetFlow as the argument. Otherwise, targetFlow and flowCallNode must remain null, indicating that this is a flow return. Call FacesContext#getViewRoot() and let toViewId be the the return from calling javax.faces.component.UIViewRoot#getViewId on it.

Call, transition, passing the arguments gathered in the preceding algorithm.

Parameters
context:FacesContext

the FacesContext for the current request.

Annotations
@Override
flowsEqualback to summary
private boolean flowsEqual(Flow flow1, Flow flow2)
forceSessionUpdateForFlowStackback to summary
private void forceSessionUpdateForFlowStack(FacesContext context, FlowHandlerImpl.FlowDeque<Flow> stack)
getAndClearReturnModeDepthback to summary
public int getAndClearReturnModeDepth(FacesContext context)
getCurrentFlowback to summary
public Flow getCurrentFlow(FacesContext context)

Implements abstract javax.faces.flow.FlowHandler.getCurrentFlow.

Doc from javax.faces.flow.FlowHandler.getCurrentFlow.

Return the currently active Flow for the argument FacesContext, or null if no flow is active. A Flow must always be associated with exactly one javax.faces.lifecycle.ClientWindow, but a ClientWindow may have multiple Flows.

If pushReturnMode had been called with true as the argument before invoking this method, return the preceding flow on the stack instead of the actual current flow, or null if there is no preceding flow. Otherwise, return the current flow.

Parameters
context:FacesContext

the FacesContext for the current request.

Returns:Flow

the current Flow or null if no flow is active

Annotations
@Override
getCurrentFlowScopeback to summary
public Map<Object, Object> getCurrentFlowScope()

Implements abstract javax.faces.flow.FlowHandler.getCurrentFlowScope.

Doc from javax.faces.flow.FlowHandler.getCurrentFlowScope.

Return the Map that backs the #{flowScope} EL implicit object or null if no flow is currently active.

Returns:Map<Object, Object>

the Map for this flow scope.

Annotations
@Override
getFlowback to summary
public Flow getFlow(FacesContext context, String definingDocumentId, String id)

Implements abstract javax.faces.flow.FlowHandler.getFlow.

Doc from javax.faces.flow.FlowHandler.getFlow.

Return the Flow whose id is equivalent to the argument id, within the scope of the argument definingDocument.

Parameters
context:FacesContext

the FacesContext for the current request.

definingDocumentId:String

An application unique identifier for the document in which the returned flow is defined.

id:String

the id of a Flow, unique within the scope of the definingDocument.

Returns:Flow

the Flow for the argument identifiers.

Annotations
@Override
getFlowStackback to summary
pack-priv static FlowHandlerImpl.FlowDeque<Flow> getFlowStack(FacesContext context)
getLastDisplayedViewIdback to summary
public String getLastDisplayedViewId(FacesContext context)

Implements abstract javax.faces.flow.FlowHandler.getLastDisplayedViewId.

Doc from javax.faces.flow.FlowHandler.getLastDisplayedViewId.

Return the last displayed viewId for the current flow, as returned by getCurrentFlow(javax.faces.context.FacesContext), or null if there is no current flow.

Parameters
context:FacesContext

the FacesContext for the current request.

Returns:String

the last displayed viewId.

Annotations
@Override
isActiveback to summary
public boolean isActive(FacesContext context, String definingDocumentId, String id)

Implements abstract javax.faces.flow.FlowHandler.isActive.

Doc from javax.faces.flow.FlowHandler.isActive.

Return true if and only if the flow referenced by the argument definingDocument and id is currently active.

Parameters
context:FacesContext

the FacesContext for the current request.

definingDocumentId:String

An application unique identifier for the document in which the returned flow is defined.

id:String

the id of a Flow, unique within the scope of the definingDocument.

Returns:boolean

true if and only if the referenced flow is active

Annotations
@Override
peekFlowback to summary
private Flow peekFlow(FacesContext context)
performPopsback to summary
private void performPops(FacesContext context, Flow sourceFlow, Flow targetFlow)
popFlowback to summary
private Flow popFlow(FacesContext context)
popReturnModeback to summary
public void popReturnMode(FacesContext context)

Implements abstract javax.faces.flow.FlowHandler.popReturnMode.

Doc from javax.faces.flow.FlowHandler.popReturnMode.

Enable the correct handling of navigation when processing a return node. The default javax.faces.application.NavigationHandler specification requires calling this method from a finally block, immediately attempting to process the navigation rules in the context of a flow return.

Parameters
context:FacesContext

the FacesContext for the current request.

Annotations
@Override
pushFlowback to summary
private void pushFlow(FacesContext context, Flow toPush, String lastDisplayedViewId, Map<String, Object> evaluatedParams)
pushReturnModeback to summary
public void pushReturnMode(FacesContext context)

Implements abstract javax.faces.flow.FlowHandler.pushReturnMode.

Doc from javax.faces.flow.FlowHandler.pushReturnMode.

Enable the correct handling of navigation when processing a return node. The default javax.faces.application.NavigationHandler specification requires calling this method before processing the navigation rules for the flow return, and calling popReturnMode, from a finally block, immediately afterward.

Parameters
context:FacesContext

the FacesContext for the current request.

Annotations
@Override
transitionback to summary
public void transition(FacesContext context, Flow sourceFlow, Flow targetFlow, FlowCallNode outboundCallNode, String toViewId)

Implements abstract javax.faces.flow.FlowHandler.transition.

Doc from javax.faces.flow.FlowHandler.transition.

Perform a transition in the flow graph for the current user's javax.faces.lifecycle.ClientWindow. Obtain references to the Flow instances corresponding to the origin and destination arguments. If the origin Flow is equal to the destination Flow, take no action and return null. Otherwise, if the outboundCallNode argument is non-null save aside the outbound parameters. For discussion evaluatedParams is a data structure that stores the evaluated values of any outbound parameters. It is necessary to evaluate these values before popping any flow scopes because the values may refer to scoped instances that need to be passed to the target flow, but will not be available once the new scope is activated. Save aside the outbound parameters using the following algorithm.

If the outboundParameters property of outboundCallNode is non-null and not empty, and the inboundParameters property of the target flow is non-null and not empty, for each entry in the outbound parameters whose name matches an entry in the inbound parameters, evaluate the value of the parameter, and put the evaluated value into evaluatedParams under the corresponding name. Otherwise, consider evaluatedParams to be empty.

If the destination Flow is a sub-flow of the origin Flow push the destination Flow onto the flow data structure and return the destination Flow. Otherwise, pop the current Flow from the flow data structure. If the destination Flow is non-null, make the destination Flow the current flow, pushing it onto the data structure. If evaluatedParams is not empty, for each entry, find the corresponding parameter in the target flow's inbound parameters and call its setValue method, passing the value from evaluatedParams.

Parameters
context:FacesContext

the FacesContext for the current request.

sourceFlow:Flow

the current Flow, or null if there is no source flow.

targetFlow:Flow

the destination Flow, or null if there is no destination flow.

outboundCallNode:FlowCallNode

the flow call node causing this transition, or null if this transition is not caused by a flow call.

toViewId:String

the viewId of the view being displayed as a result of this transition. This parameter makes it possible to implement getLastDisplayedViewId.

Annotations
@Override
@SuppressWarnings
com.sun.faces.flow back to summary

pack-priv Class FlowHandlerImpl.FlowDeque<E>

extends Object
implements Iterable<E>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Iterable

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private ArrayDeque<E>
private int
private ArrayDeque<FlowHandlerImpl.FlowDeque.RideAlong>
private static final long
private final String

Constructor Summary

AccessConstructor and Description
public
FlowDeque(final String sessionKey)

Method Summary

Modifier and TypeMethod and Description
public void
addFirst(E e, String lastDisplayedViewId)

private void
private int
public int
public int
public String
private void
public Iterator<E>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public E
public String
public E
public void
public void
private void
setMaxReturnDepth(FacesContext context, int value)

public int
size()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
private ArrayDeque<E> data
returnDepthback to summary
private int returnDepth
rideAlongback to summary
private ArrayDeque<FlowHandlerImpl.FlowDeque.RideAlong> rideAlong
serialVersionUIDback to summary
private static final long serialVersionUID
sessionKeyback to summary
private final String sessionKey

Constructor Detail

FlowDequeback to summary
public FlowDeque(final String sessionKey)

Method Detail

addFirstback to summary
public void addFirst(E e, String lastDisplayedViewId)
decrementMaxReturnDepthback to summary
private void decrementMaxReturnDepth()
getAndClearMaxReturnDepthback to summary
private int getAndClearMaxReturnDepth(FacesContext context)
getCurrentFlowDepthback to summary
public int getCurrentFlowDepth()
getReturnDepthback to summary
public int getReturnDepth()
getSessionKeyback to summary
public String getSessionKey()
incrementMaxReturnDepthback to summary
private void incrementMaxReturnDepth()
iteratorback to summary
public Iterator<E> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<E>

an Iterator.

Annotations
@Override
peekFirstback to summary
public E peekFirst()
peekLastDisplayedViewIdback to summary
public String peekLastDisplayedViewId()
pollFirstback to summary
public E pollFirst()
popReturnModeback to summary
public void popReturnMode()
pushReturnModeback to summary
public void pushReturnMode()
setMaxReturnDepthback to summary
private void setMaxReturnDepth(FacesContext context, int value)
sizeback to summary
public int size()
com.sun.faces.flow back to summary

private Class FlowHandlerImpl.FlowDeque.RideAlong

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

Field Summary

Modifier and TypeField and Description
pack-priv String
private static final long

Constructor Summary

AccessConstructor and Description
public
RideAlong(String lastDisplayedViewId)

Field Detail

lastDisplayedViewIdback to summary
pack-priv String lastDisplayedViewId
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

RideAlongback to summary
public RideAlong(String lastDisplayedViewId)