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 Object
implements FacesInitializer

Performs common initialization tasks.


Field Summary
protected static 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).
 void destroyShutdownFacesContext(FacesContext facesContext)
           
 void destroyStartupFacesContext(FacesContext facesContext)
           
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.
 FacesContext initShutdownFacesContext(javax.servlet.ServletContext servletContext)
           
 FacesContext initStartupFacesContext(javax.servlet.ServletContext servletContext)
           
protected static javax.el.ExpressionFactory loadExpressionFactory(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 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(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

initStartupFacesContext

public FacesContext initStartupFacesContext(javax.servlet.ServletContext servletContext)
Specified by:
initStartupFacesContext in interface FacesInitializer

destroyStartupFacesContext

public void destroyStartupFacesContext(FacesContext facesContext)
Specified by:
destroyStartupFacesContext in interface FacesInitializer

initShutdownFacesContext

public FacesContext initShutdownFacesContext(javax.servlet.ServletContext servletContext)
Specified by:
initShutdownFacesContext in interface FacesInitializer

destroyShutdownFacesContext

public void destroyShutdownFacesContext(FacesContext facesContext)
Specified by:
destroyShutdownFacesContext in interface FacesInitializer

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 © 2012 The Apache Software Foundation. All Rights Reserved.