public abstract class Configurator extends Object
Constructor and Description |
---|
Configurator() |
Modifier and Type | Method and Description |
---|---|
void |
beginRequest(javax.faces.context.ExternalContext externalContext)
This is called at the beginning of each "physical" request, sometime
before
getExternalContext(ExternalContext) or
endRequest(ExternalContext) . |
void |
destroy()
Cleans up the Configurator.
|
static void |
disableConfiguratorServices(javax.servlet.ServletRequest srq)
Disables Configurator services for the current request.
|
void |
endRequest(javax.faces.context.ExternalContext externalContext)
Executed at the end of each "physical" request.
|
javax.faces.context.ExternalContext |
getExternalContext(javax.faces.context.ExternalContext externalContext)
Returns an ExternalContext wrapper based on the provided ExternalContext.
|
void |
init(javax.faces.context.ExternalContext externalContext)
Initializes the Configurator.
|
protected static boolean |
isConfiguratorServiceDisabled(javax.faces.context.ExternalContext ec)
Returns
true if the disableConfiguratorServices(ServletRequest)
has been executed on the current request and false if it has not. |
void |
reloadSkins(javax.faces.context.ExternalContext externalContext,
SkinFactory factory)
Deprecated.
use SkinProvider SPI. The reloading of 'dirty' skins has to be taken care inside SkinProvider
implementations.
|
public void init(javax.faces.context.ExternalContext externalContext)
FacesContextFactory.getFacesContext(java.lang.Object, java.lang.Object, java.lang.Object, javax.faces.lifecycle.Lifecycle)
is completed.
Note:the ExternalContext provided to this method may not
contain any of the Request/Response functionality within the external
context and will NOT contain any ExternalContext wrapping provided by
the getExternalContext(ExternalContext)
method. This object
is intended only to be used as a container abstraction to the native
Context object.externalContext
- a mocked up external context providing access
to the native context object.public void destroy()
public void beginRequest(javax.faces.context.ExternalContext externalContext)
getExternalContext(ExternalContext)
or
endRequest(ExternalContext)
. When using the
TrinidadFilter, this will be called during filter execution, but
is not guaranteed to happen until just before the creation of the
Trinidad FacesContext wrapper.
All Configurator services will have thier beginRequest() methods
called before any calls to getExternalContext(). So any context
wrapping done by this method will not happen until after the
beginRequest() is called.
It is also important to note that the ExternalContext provided
may or may not be the same as the ExternalContext provided to
getExternalContext(). But it will have a valid request and response
object.
By contract, the RequestContext
object will be initialized and available when this method is run.externalContext
- a mocked up or life externalContext providing
access to the native request, response, and context
objects.public javax.faces.context.ExternalContext getExternalContext(javax.faces.context.ExternalContext externalContext)
beginRequest(ExternalContext)
.
Please note that it is important that this method returns a wrapper of
the original context, or the behavior provided by other services and by
Trinidad may not function
By contract, the RequestContext
object will be initialized and available when this method is run.externalContext
- the ExternalContext to wrappublic void endRequest(javax.faces.context.ExternalContext externalContext)
beginRequest(ExternalContext)
.
It is also important to note that the ExternalContext provided
may or may not be the same as the ExternalContext provided to
getExternalContext(). But it will have a valid request and response
object.
By contract, the RequestContext
object will be initialized and available when this method is run.externalContext
- the external context@Deprecated public void reloadSkins(javax.faces.context.ExternalContext externalContext, SkinFactory factory)
externalContext
- the external contextfactory
- the SkinFactory instance to which the skins can be reloadedSkinProvider
public static final void disableConfiguratorServices(javax.servlet.ServletRequest srq)
beginRequest(ExternalContext)
,
endRequest(ExternalContext)
, and
getExternalContext(ExternalContext)
methods will not be called durring
a request.
Note: is this method is called after the beginRequest() method,
an error will be logged in the trinidad logger and the services will continue to
execute.srq
- the servlet requestprotected static final boolean isConfiguratorServiceDisabled(javax.faces.context.ExternalContext ec)
true
if the disableConfiguratorServices(ServletRequest)
has been executed on the current request and false
if it has not.
Note:it is important to understand that this method will not
properly reflect if the services have actually been disabled or not. It simply
returns whether they "should" have been disabled. If the disableConfiguratorServices
was executed after the beginRequest methods have been executed, then the services
will continue to function so that {getExternalContext(ExternalContext)
and endRequest(ExternalContext)
will still be called.ec
- the ExternalContext objectboolean
containing true
if the
disableConfiguratorServices()
method has been
called and false
if it has not.Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.