org.apache.myfaces.context.servlet
Class FacesContextImplBase

java.lang.Object
  extended by javax.faces.context.FacesContext
      extended by org.apache.myfaces.context.servlet.FacesContextImplBase
Direct Known Subclasses:
FacesContextImpl, StartupFacesContextImpl

public abstract class FacesContextImplBase
extends FacesContext

Provides a base implementation of the FacesContext for the use in FacesContextImpl and StartupFacesContextImpl.

Version:
$Revision: 1296668 $ $Date: 2012-03-03 11:54:27 -0500 (Sat, 03 Mar 2012) $
Author:
Jakob Korherr (latest modification by $Author: lu4242 $)

Field Summary
protected  boolean _released
           
 
Constructor Summary
FacesContextImplBase(ExternalContext externalContext, ReleaseableExternalContext defaultExternalContext)
          Base constructor.
FacesContextImplBase(ExternalContext externalContext, ReleaseableExternalContext defaultExternalContext, ApplicationFactory applicationFactory, RenderKitFactory renderKitFactory)
           
 
Method Summary
protected  void assertNotReleased()
          has to be thrown in many of the methods if the method is called after the instance has been released!
 Application getApplication()
           
 Map<Object,Object> getAttributes()
          Returns a mutable map of attributes associated with this faces context when FacesContext.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 the FacesContext.getExternalContext.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!
 javax.el.ELContext getELContext()
           
 ExceptionHandler getExceptionHandler()
           
 ExternalContext getExternalContext()
           
 RenderKit getRenderKit()
           
 UIViewRoot getViewRoot()
           
 boolean isProcessingEvents()
           
 boolean isReleased()
           
 void release()
          Releases the instance fields on FacesContextImplBase.
 void setExceptionHandler(ExceptionHandler exceptionHandler)
           
 void setProcessingEvents(boolean processingEvents)
           
 void setViewRoot(UIViewRoot viewRoot)
           
 
Methods inherited from class javax.faces.context.FacesContext
addMessage, getClientIdsWithMessages, getCurrentInstance, getCurrentPhaseId, getMaximumSeverity, getMessageList, getMessageList, getMessages, getMessages, getPartialViewContext, getRenderResponse, getResponseComplete, getResponseStream, getResponseWriter, isPostback, isProjectStage, isValidationFailed, renderResponse, responseComplete, setCurrentInstance, setCurrentPhaseId, setResponseStream, setResponseWriter, validationFailed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_released

protected boolean _released
Constructor Detail

FacesContextImplBase

public FacesContextImplBase(ExternalContext externalContext,
                            ReleaseableExternalContext defaultExternalContext)
Base constructor. Calls FacesContext.setCurrentInstance(this);


FacesContextImplBase

public FacesContextImplBase(ExternalContext externalContext,
                            ReleaseableExternalContext 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:
release in class FacesContext

isReleased

public boolean isReleased()
Overrides:
isReleased in class FacesContext

getExternalContext

public final ExternalContext getExternalContext()
Specified by:
getExternalContext in class FacesContext

getApplication

public final Application getApplication()
Specified by:
getApplication in class FacesContext

getExceptionHandler

public final ExceptionHandler getExceptionHandler()
Overrides:
getExceptionHandler in class FacesContext

setExceptionHandler

public final void setExceptionHandler(ExceptionHandler exceptionHandler)
Overrides:
setExceptionHandler in class FacesContext

isProcessingEvents

public final boolean isProcessingEvents()
Overrides:
isProcessingEvents in class FacesContext

setProcessingEvents

public final void setProcessingEvents(boolean processingEvents)
Overrides:
setProcessingEvents in class FacesContext

getELContext

public final javax.el.ELContext getELContext()
Overrides:
getELContext in class FacesContext

getAttributes

public final Map<Object,Object> getAttributes()
Returns a mutable map of attributes associated with this faces context when FacesContext.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 the FacesContext.getExternalContext.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:
getAttributes in class FacesContext
Throws:
IllegalStateException - if the current context already is released!
Since:
JSF 2.0

getViewRoot

public UIViewRoot getViewRoot()
Specified by:
getViewRoot in class FacesContext

setViewRoot

public final void setViewRoot(UIViewRoot viewRoot)
Specified by:
setViewRoot in class FacesContext

getRenderKit

public final RenderKit getRenderKit()
Specified by:
getRenderKit in class FacesContext

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!



Copyright © 2014 The Apache Software Foundation. All Rights Reserved.