/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package javax.faces.context;
import java.util.Iterator;
import java.util.Map;
/**
*
FacesContext contains all of the
* per-request state information related to the processing of a single
* Jakarta Server Faces request, and the rendering of the corresponding
* response. It is passed to, and potentially modified by, each phase
* of the request processing lifecycle.
*
*
A {@link FacesContext} instance is associated with a particular
* request at the beginning of request processing, by a call to the
* getFacesContext() method of the {@link FacesContextFactory}
* instance associated with the current web application. The instance
* remains active until its release() method is called, after
* which no further references to this instance are allowed. While a
* {@link FacesContext} instance is active, it must not be referenced
* from any thread other than the one upon which the Jakarta Servlet container
* executing this web application utilizes for the processing of this request.
*
*
*
A FacesContext can be injected into a request
* scoped bean using @Inject FacesContext facesContext;
*
*/
public abstract class FacesContext {
public FacesContext() {
}
/**
*
Return a mutable Map
* representing the attributes associated wth this
* FacesContext instance. This Map is
* useful to store attributes that you want to go out of scope when the
* Faces lifecycle for the current request ends, which is not always the same
* as the request ending, especially in the case of Jakarta Servlet filters
* that are invoked after the Faces lifecycle for this
* request completes. Accessing this Map does not cause any
* events to fire, as is the case with the other maps: for request, session, and
* application scope. When {@link #release()} is invoked, the attributes
* must be cleared.
*
*
*
*
The Map returned by this method is not associated with
* the request. If you would like to get or set request attributes,
* see {@link ExternalContext#getRequestMap}.
*
*
The default implementation throws
* UnsupportedOperationException and is provided
* for the sole purpose of not breaking existing applications that extend
* this class.
*
*
*
* @return mutable Map representing the attributes associated wth this
* FacesContext instance.
*
* @throws IllegalStateException if this method is called after
* this instance has been released
*
* @since 2.0
*/
public Map