Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://glassfish.java.net/public/CDDL+GPL_1_1.html
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package javax.faces.flow;
import java.util.Map;
import javax.faces.context.FacesContext;
/**
*
FlowHandler is the main entry
* point that enables the runtime to interact with the faces flows
* feature. {@link javax.faces.application.NavigationHandler} uses this
* class when it needs to make navigational decisions related to flows.
* The faces flow feature entirely depends on the {@link
* javax.faces.lifecycle.ClientWindow} feature and also on CDI.
*
*
Defining Flows
*
The implementation must support defining faces flows using the
* <flow-definition> element as specified in
* the Application
* Configuration Resources XML Schema Definition, or by using the
* {@link javax.faces.flow.builder.FlowBuilder} API. Additional means
* of defining flows may be provided by decorating the {@link
* FlowHandlerFactory}.
*
Managing Flows
*
*
The singleton instance of this class must be thread safe, and
* therefore must not store any per-user state. Flows are, however,
* traversed in a per-user manner, and must be associated with the
* current {@link javax.faces.lifecycle.ClientWindow}. Furthermore,
* Flows may be nested. These requirements strongly suggest managing
* the flows with a stack-like runtime data structure, stored in a
* per-user fashion and associated with the {@code ClientWindow}. Because Flow instances are immutable,
* yet the flow stack is per-user, implementations must make allowance
* for flow scoped data (managed beans declared to be {@link FlowScoped}
* and data stored in the Map returned by {@link
* #getCurrentFlowScope}) to be fully re-entrant. For example, consider
* an application with two flows, A and B, each with a single
* FlowScoped bean MyBeanA and
* MyBeanB, respectively. Entry into flow A causes
* MyBeanA to become active. Calling from A into B causes
* MyBeanB to become active. Calling back into A causes a
* new instance of MyBeanA to become active, rather than
* reactivating the earlier instance of MyBeanA.
*
*
The Flow Graph
*
Prior versions of the specification defined a flow graph but the
* only kind of node in the graph was a VDL view. The Faces Flow
* feature currently defines the following node types.
*
*
View
*
This is the regular JSF VDL View that has been in the
* specification since the beginning.
*
*
Switch
*
This is a list of EL expressions. When control is passed to a
* switch node, each expression in the list is evaluated and the first
* one that returns {@code true} is used to define the id of the next
* node to which control must be passed. If none of the expressions
* evaluates to {@code true}, control passes to the specified default
* id.
*
*
Return
*
This node type specifies an outcome that is returned to the
* calling flow.
*
*
Method Call
*
This node type allows invocation of arbitrary application logic at
* any point in the executiong of the flow. An outcome can be specified
* that will cause a navigation case to be navigated to after the method
* has been invoked.
*
*
Faces Flow Call
*
This node type allows one flow to call another flow. The calling
* flow remains active and is not exited until control returns from the
* called flow.
*
*
*
*
Edges in the graph are defined by the existing JSF navigation rule system.
*
Flows and Model Objects
*
*
Managed beans annotated with the CDI annotation
* {@link FlowScoped} must be instantiated upon a user agent's entry
* into the named scope, and must be made available for garbage
* collection when the user agent leaves the flow.
*
The flowScope EL implicit object is also
* available to store values in the "current" slope. Values stored in
* this scope must be made available for garbage collection when the
* user agent leaves the flow.
*
*
*
*
* @since 2.2
*/
public abstract class FlowHandler {
/**
*
Components that are rendered by Renderers
* of component-family javax.faces.OutcomeTarget must use this
* constant as the parameter name for a parameter representing the flow id
* of the flow that this component will cause to be entered.
*
*
*
* @since 2.2
*/
public static final String FLOW_ID_REQUEST_PARAM_NAME = "jffi";
/**
*
Components that are rendered by Renderers
* of component-family javax.faces.OutcomeTarget must use this
* constant as the parameter name for a parameter representing the defining document id
* of the flow that this component will cause to be entered.
*
* @since 2.2
*/
public static final String TO_FLOW_DOCUMENT_ID_REQUEST_PARAM_NAME = "jftfdi";
/**
*
Components that are rendered by Renderers
* of component-family javax.faces.OutcomeTarget must use this
* constant as the value of the parameter named by {@link #TO_FLOW_DOCUMENT_ID_REQUEST_PARAM_NAME}
* when returning from a flow (without entering another flow) using such a component.
* @since 2.2
*/
public static final String NULL_FLOW = "javax.faces.flow.NullFlow";
/**
*
Return the {@code Map} that backs
* the {@code #{flowScope}} EL implicit object or {@code null}
* if no flow is currently active.