Class FacesContextImplBase
- java.lang.Object
-
- jakarta.faces.context.FacesContext
-
- org.apache.myfaces.context.servlet.FacesContextImplBase
-
- All Implemented Interfaces:
Purgeable
- Direct Known Subclasses:
FacesContextImpl,StartupFacesContextImpl
public abstract class FacesContextImplBase extends FacesContext implements Purgeable
Provides a base implementation of the FacesContext for the use in FacesContextImpl and StartupFacesContextImpl.- Version:
- $Revision$ $Date$
- Author:
- Jakob Korherr (latest modification by $Author$)
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_released
-
Constructor Summary
Constructors Constructor Description FacesContextImplBase(ExternalContext externalContext, ExternalContext defaultExternalContext)Base constructor.FacesContextImplBase(ExternalContext externalContext, ExternalContext defaultExternalContext, ApplicationFactory applicationFactory, RenderKitFactory renderKitFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertNotReleased()has to be thrown in many of the methods if the method is called after the instance has been released!ApplicationgetApplication()Map<Object,Object>getAttributes()Returns a mutable map of attributes associated with this faces context whenFacesContext.release()is called the map must be cleared! Note this map is not associated with the request map the request map still is accessible via theExternalContext.getRequestMap()method! Also the scope is different to the request map, this map has the scope of the context, and is cleared once the release method on the context is called! Also the map does not cause any events according to the spec!protected FacesContextgetCurrentFacesContext()jakarta.el.ELContextgetELContext()ExceptionHandlergetExceptionHandler()ExternalContextgetExternalContext()chargetNamingContainerSeparatorChar()RenderKitgetRenderKit()List<String>getResourceLibraryContracts()UIViewRootgetViewRoot()booleanisProcessingEvents()booleanisReleased()voidpurge()voidrelease()Releases the instance fields on FacesContextImplBase.voidsetExceptionHandler(ExceptionHandler exceptionHandler)voidsetProcessingEvents(boolean processingEvents)voidsetResourceLibraryContracts(List<String> contracts)voidsetViewRoot(UIViewRoot viewRoot)-
Methods inherited from class jakarta.faces.context.FacesContext
addMessage, getClientIdsWithMessages, getCurrentInstance, getCurrentPhaseId, getLifecycle, getMaximumSeverity, getMessageList, getMessageList, getMessages, getMessages, getPartialViewContext, getRenderResponse, getResponseComplete, getResponseStream, getResponseWriter, isPostback, isProjectStage, isValidationFailed, renderResponse, responseComplete, setCurrentInstance, setCurrentPhaseId, setResponseStream, setResponseWriter, validationFailed
-
-
-
-
Constructor Detail
-
FacesContextImplBase
public FacesContextImplBase(ExternalContext externalContext, ExternalContext defaultExternalContext)
Base constructor. Calls FacesContext.setCurrentInstance(this);
-
FacesContextImplBase
public FacesContextImplBase(ExternalContext externalContext, ExternalContext defaultExternalContext, ApplicationFactory applicationFactory, RenderKitFactory renderKitFactory)
-
-
Method Detail
-
release
public void release()
Releases the instance fields on FacesContextImplBase. Must be called by sub-classes, when overriding it!- Specified by:
releasein classFacesContext
-
isReleased
public boolean isReleased()
- Overrides:
isReleasedin classFacesContext
-
getExternalContext
public final ExternalContext getExternalContext()
- Specified by:
getExternalContextin classFacesContext
-
getApplication
public final Application getApplication()
- Specified by:
getApplicationin classFacesContext
-
getExceptionHandler
public final ExceptionHandler getExceptionHandler()
- Overrides:
getExceptionHandlerin classFacesContext
-
setExceptionHandler
public final void setExceptionHandler(ExceptionHandler exceptionHandler)
- Overrides:
setExceptionHandlerin classFacesContext
-
isProcessingEvents
public final boolean isProcessingEvents()
- Overrides:
isProcessingEventsin classFacesContext
-
setProcessingEvents
public final void setProcessingEvents(boolean processingEvents)
- Overrides:
setProcessingEventsin classFacesContext
-
getELContext
public final jakarta.el.ELContext getELContext()
- Overrides:
getELContextin classFacesContext
-
getAttributes
public final Map<Object,Object> getAttributes()
Returns a mutable map of attributes associated with this faces context whenFacesContext.release()is called the map must be cleared! Note this map is not associated with the request map the request map still is accessible via theExternalContext.getRequestMap()method! Also the scope is different to the request map, this map has the scope of the context, and is cleared once the release method on the context is called! Also the map does not cause any events according to the spec!- Overrides:
getAttributesin classFacesContext- Throws:
IllegalStateException- if the current context already is released!- Since:
- Faces 2.0
-
getViewRoot
public UIViewRoot getViewRoot()
- Specified by:
getViewRootin classFacesContext
-
setViewRoot
public final void setViewRoot(UIViewRoot viewRoot)
- Specified by:
setViewRootin classFacesContext
-
getRenderKit
public final RenderKit getRenderKit()
- Specified by:
getRenderKitin classFacesContext
-
getResourceLibraryContracts
public List<String> getResourceLibraryContracts()
- Overrides:
getResourceLibraryContractsin classFacesContext
-
setResourceLibraryContracts
public void setResourceLibraryContracts(List<String> contracts)
- Overrides:
setResourceLibraryContractsin classFacesContext
-
getNamingContainerSeparatorChar
public char getNamingContainerSeparatorChar()
- Overrides:
getNamingContainerSeparatorCharin classFacesContext
-
assertNotReleased
protected final void assertNotReleased()
has to be thrown in many of the methods if the method is called after the instance has been released!
-
getCurrentFacesContext
protected FacesContext getCurrentFacesContext()
-
-