|
JSF-Spring | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.context.FacesContext de.mindmatters.faces.context.FacesContextImpl
public final class FacesContextImpl
FacesContext contains all of the per-request state information related to the processing of a single JavaServer 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 FacesContext
instance is associated with a particular request at
the beginning of request processing, by a call to the
getFacesContext()
method of the
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 FacesContext
instance is
active, it must not be referenced from any thread other than the one upon
which the servlet container executing this web application utilizes for the
processing of this request.
Note: copied from FacesContext docs.
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
For logging. |
Constructor Summary | |
---|---|
FacesContextImpl(ExternalContext externalContext)
Constructs a FacesContext with the given ExternalContext externalContext . |
Method Summary | |
---|---|
void |
addMessage(java.lang.String clientId,
FacesMessage message)
Append a |
Application |
getApplication()
Return the |
java.util.Iterator |
getClientIdsWithMessages()
Return an |
ExternalContext |
getExternalContext()
Return the |
FacesMessage.Severity |
getMaximumSeverity()
Return the maximum severity level recorded on any
|
java.util.Iterator |
getMessages()
Return an |
java.util.Iterator |
getMessages(java.lang.String clientId)
Return an |
RenderKit |
getRenderKit()
Return the |
boolean |
getRenderResponse()
Return |
boolean |
getResponseComplete()
Return |
ResponseStream |
getResponseStream()
Return the |
ResponseWriter |
getResponseWriter()
Return the |
UIViewRoot |
getViewRoot()
Return the root component that is associated with the this request. |
void |
release()
Release any resources associated with this
|
void |
renderResponse()
Signal the JavaServer faces implementation that, as soon as the current phase of the request processing lifecycle has been completed, control should be passed to the Render Response phase, bypassing any phases that have not been executed yet. |
void |
responseComplete()
Signal the JavaServer Faces implementation that the HTTP response for this request has already been generated (such as an HTTP redirect), and that the request processing lifecycle should be terminated as soon as the current phase is completed. |
void |
setResponseStream(ResponseStream responseStream)
Set the |
void |
setResponseWriter(ResponseWriter responseWriter)
Set the |
void |
setViewRoot(UIViewRoot viewRoot)
Set the root component that is associated with this request. |
Methods inherited from class javax.faces.context.FacesContext |
---|
getCurrentInstance, setCurrentInstance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
Constructor Detail |
---|
public FacesContextImpl(ExternalContext externalContext)
externalContext
.
externalContext
- usually a fake contextServletExternalContextFake
Method Detail |
---|
public Application getApplication()
Return the Application
instance associated with this
web application.
getApplication
in class FacesContext
public java.util.Iterator getClientIdsWithMessages()
Return an Iterator
over the client identifiers for
which at least one FacesMessage
has been queued. If there are no
such client identifiers, an empty Iterator
is returned.
If any messages have been queued that were not associated with any
specific client identifier, a null
value will be included
in the iterated values.
getClientIdsWithMessages
in class FacesContext
public ExternalContext getExternalContext()
Return the ExternalContext
instance for this
FacesContext
instance.
getExternalContext
in class FacesContext
public FacesMessage.Severity getMaximumSeverity()
Return the maximum severity level recorded on any
FacesMessage
s that has been queued, whether or not they are
associated with any specific UIComponent
. If no such messages
have been queued, return null
.
getMaximumSeverity
in class FacesContext
public java.util.Iterator getMessages()
Return an Iterator
over the FacesMessage
s
that have been queued, whether or not they are associated with any
specific client identifier. If no such messages have been queued,
return an empty Iterator
.
getMessages
in class FacesContext
public java.util.Iterator getMessages(java.lang.String clientId)
Return an Iterator
over the FacesMessage
s that
have been queued that are associated with the specified client identifier
(if clientId
is not null
), or over the
FacesMessage
s that have been queued that are not associated with
any specific client identifier (if clientId
is
null
). If no such messages have been queued, return an
empty Iterator
.
getMessages
in class FacesContext
clientId
- The client identifier for which messages are
requested, or null
for messages not associated with
any client identifierpublic RenderKit getRenderKit()
Return the RenderKit
instance for the render kit identifier
specified on our UIViewRoot
, if there is one. If there is no
current UIViewRoot
, if the UIViewRoot
does not have a
specified renderKitId
, or if there is no RenderKit
for the specified identifier, return null
instead.
getRenderKit
in class FacesContext
public boolean getRenderResponse()
Return true
if the renderResponse()
method has been called for the current request.
getRenderResponse
in class FacesContext
public boolean getResponseComplete()
Return true
if the responseComplete()
method has been called for the current request.
getResponseComplete
in class FacesContext
public void addMessage(java.lang.String clientId, FacesMessage message)
Append a FacesMessage
to the set of messages associated with
the specified client identifier, if clientId
is
not null
. If clientId
is null
,
this FacesMessage
is assumed to not be associated with any
specific component instance.
addMessage
in class FacesContext
clientId
- The client identifier with which this message is
associated (if any)message
- The message to be appendedpublic void release()
Release any resources associated with this
FacesContext
instance. Faces implementations may
choose to pool instances in the associated FacesContextFactory
to avoid repeated object creation and
garbage collection. After release()
is called on a
FacesContext
instance (until the
FacesContext
instance has been recycled by the
implementation for re-use), calling any other methods will cause
an IllegalStateException
to be thrown.
The implementation must call FacesContext.setCurrentInstance(javax.faces.context.FacesContext)
passing null
to remove the association between this
thread and this dead FacesContext
instance.
release
in class FacesContext
public void renderResponse()
Signal the JavaServer faces implementation that, as soon as the current phase of the request processing lifecycle has been completed, control should be passed to the Render Response phase, bypassing any phases that have not been executed yet.
renderResponse
in class FacesContext
public void responseComplete()
Signal the JavaServer Faces implementation that the HTTP response for this request has already been generated (such as an HTTP redirect), and that the request processing lifecycle should be terminated as soon as the current phase is completed.
responseComplete
in class FacesContext
public ResponseStream getResponseStream()
Return the ResponseStream
to which components should
direct their binary output. Within a given response, components
can use either the ResponseStream or the ResponseWriter,
but not both.
getResponseStream
in class FacesContext
public void setResponseStream(ResponseStream responseStream)
Set the ResponseStream
to which components should
direct their binary output.
setResponseStream
in class FacesContext
responseStream
- The new ResponseStream for this responsepublic ResponseWriter getResponseWriter()
Return the ResponseWriter
to which components should
direct their character-based output. Within a given response,
components can use either the ResponseStream or the ResponseWriter,
but not both.
getResponseWriter
in class FacesContext
public void setResponseWriter(ResponseWriter responseWriter)
Set the ResponseWriter
to which components should
direct their character-based output.
setResponseWriter
in class FacesContext
responseWriter
- The new ResponseWriter for this responsepublic UIViewRoot getViewRoot()
Return the root component that is associated with the this request.
getViewRoot
in class FacesContext
public void setViewRoot(UIViewRoot viewRoot)
Set the root component that is associated with this request. This method can only be called by the application handler (or a class that the handler calls), and only during the Invoke Application phase of the request processing lifecycle.
setViewRoot
in class FacesContext
viewRoot
- The new component UIViewRoot
component
|
JSF-Spring | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |