org.apache.myfaces.webapp
Class AbstractFacesInitializer

java.lang.Object
  extended by org.apache.myfaces.webapp.AbstractFacesInitializer
All Implemented Interfaces:
FacesInitializer
Direct Known Subclasses:
Jsp20FacesInitializer, Jsp21FacesInitializer

public abstract class AbstractFacesInitializer
extends java.lang.Object
implements FacesInitializer

Performs common initialization tasks.


Field Summary
protected static java.lang.String EXPRESSION_FACTORY
          This parameter specifies the ExpressionFactory implementation to use.
 
Constructor Summary
AbstractFacesInitializer()
           
 
Method Summary
protected  RuntimeConfig buildConfiguration(javax.servlet.ServletContext servletContext, ExternalContext externalContext, javax.el.ExpressionFactory expressionFactory)
          Configures this JSF application.
 void destroyFaces(javax.servlet.ServletContext servletContext)
          Cleans up all remaining resources (well, theoretically).
protected static javax.el.ExpressionFactory getUserDefinedExpressionFactory(ExternalContext externalContext)
          Try to load user-definied ExpressionFactory.
protected abstract  void initContainerIntegration(javax.servlet.ServletContext servletContext, ExternalContext externalContext)
          Performs initialization tasks depending on the current environment.
 void initFaces(javax.servlet.ServletContext servletContext)
          Performs all necessary initialization tasks like configuring this JSF application.
protected static javax.el.ExpressionFactory loadExpressionFactory(java.lang.String expressionFactoryClassName)
          Loads and instantiates the given ExpressionFactory implementation.
protected  void validateFacesConfig(javax.servlet.ServletContext servletContext, ExternalContext externalContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPRESSION_FACTORY

@JSFWebConfigParam(since="1.2.7")
protected static final java.lang.String EXPRESSION_FACTORY
This parameter specifies the ExpressionFactory implementation to use.

See Also:
Constant Field Values
Constructor Detail

AbstractFacesInitializer

public AbstractFacesInitializer()
Method Detail

initFaces

public void initFaces(javax.servlet.ServletContext servletContext)
Performs all necessary initialization tasks like configuring this JSF application.

Specified by:
initFaces in interface FacesInitializer

destroyFaces

public void destroyFaces(javax.servlet.ServletContext servletContext)
Cleans up all remaining resources (well, theoretically).

Specified by:
destroyFaces in interface FacesInitializer

buildConfiguration

protected RuntimeConfig buildConfiguration(javax.servlet.ServletContext servletContext,
                                           ExternalContext externalContext,
                                           javax.el.ExpressionFactory expressionFactory)
Configures this JSF application. It's required that every FacesInitializer (i.e. every subclass) calls this method during initialization.

Parameters:
servletContext - the current ServletContext
externalContext - the current ExternalContext
expressionFactory - the ExpressionFactory to use
Returns:
the current runtime configuration

validateFacesConfig

protected void validateFacesConfig(javax.servlet.ServletContext servletContext,
                                   ExternalContext externalContext)

getUserDefinedExpressionFactory

protected static javax.el.ExpressionFactory getUserDefinedExpressionFactory(ExternalContext externalContext)
Try to load user-definied ExpressionFactory. Returns null, if no custom ExpressionFactory was specified.

Parameters:
externalContext - the current ExternalContext
Returns:
User-specified ExpressionFactory, or null, if no no custom implementation was specified

loadExpressionFactory

protected static javax.el.ExpressionFactory loadExpressionFactory(java.lang.String expressionFactoryClassName)
Loads and instantiates the given ExpressionFactory implementation.

Parameters:
expressionFactoryClassName - the class name of the ExpressionFactory implementation
Returns:
the newly created ExpressionFactory implementation, or null, if an error occurred

initContainerIntegration

protected abstract void initContainerIntegration(javax.servlet.ServletContext servletContext,
                                                 ExternalContext externalContext)
Performs initialization tasks depending on the current environment.

Parameters:
servletContext - the current ServletContext
externalContext - the current ExternalContext


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