Class FacesInitializerImpl

java.lang.Object
org.apache.myfaces.webapp.FacesInitializerImpl
All Implemented Interfaces:
FacesInitializer

public class FacesInitializerImpl extends Object implements FacesInitializer
Performs common initialization tasks.
  • Field Details

  • Constructor Details

    • FacesInitializerImpl

      public FacesInitializerImpl()
  • Method Details

    • initFaces

      public void initFaces(jakarta.servlet.ServletContext servletContext)
      Performs all necessary initialization tasks like configuring this Faces application.
      Specified by:
      initFaces in interface FacesInitializer
      Parameters:
      servletContext - The current ServletContext
    • cleanupAfterStartup

      protected void cleanupAfterStartup(FacesContext facesContext)
    • destroyFaces

      public void destroyFaces(jakarta.servlet.ServletContext servletContext)
      Cleans up all remaining resources (well, theoretically).
      Specified by:
      destroyFaces in interface FacesInitializer
      Parameters:
      servletContext - The current ServletContext
    • buildConfiguration

      protected RuntimeConfig buildConfiguration(jakarta.servlet.ServletContext servletContext, ExternalContext externalContext, jakarta.el.ExpressionFactory expressionFactory)
      Configures this Faces 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(jakarta.servlet.ServletContext servletContext, ExternalContext externalContext)
    • getUserDefinedExpressionFactory

      protected static jakarta.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 jakarta.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
    • loadExpressionFactory

      protected static jakarta.el.ExpressionFactory loadExpressionFactory(String expressionFactoryClassName, boolean logMissing)
    • initStartupFacesContext

      public FacesContext initStartupFacesContext(jakarta.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(jakarta.servlet.ServletContext servletContext)
      Specified by:
      initShutdownFacesContext in interface FacesInitializer
    • destroyShutdownFacesContext

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

      protected void initCDIIntegration(jakarta.servlet.ServletContext servletContext, ExternalContext externalContext)
      The intention of this method is provide a point where CDI integration is done. FlowScoped and ViewScoped requires CDI in order to work, so this method should set a BeanManager instance on application map under the key "oam.cdi.BEAN_MANAGER_INSTANCE". The default implementation look on ServletContext first and then use JNDI.
      Parameters:
      servletContext -
      externalContext -
    • _callPreDestroyOnInjectedJSFArtifacts

      public void _callPreDestroyOnInjectedJSFArtifacts(FacesContext facesContext)
    • initWebsocketIntegration

      protected void initWebsocketIntegration(jakarta.servlet.ServletContext servletContext, ExternalContext externalContext)
    • initAutomaticExtensionlessMapping

      protected void initAutomaticExtensionlessMapping(FacesContext facesContext, jakarta.servlet.ServletContext servletContext)
      Parameters:
      facesContext -
      servletContext -
      Since:
      2.3
    • initContainerIntegration

      protected void initContainerIntegration(jakarta.servlet.ServletContext servletContext, ExternalContext externalContext)