com.sun.faces.config
Class ConfigureListener

java.lang.Object
  extended by com.sun.faces.config.ConfigureListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

public class ConfigureListener
extends java.lang.Object
implements javax.servlet.ServletContextListener

Parse all relevant JavaServer Faces configuration resources, and configure the Reference Implementation runtime environment.


Field Summary
protected static java.lang.String FACES_CONFIG_BEAN_KEY
          ServletContext attribute key.
protected static java.lang.String JSF_RI_CONFIG
          The path to the RI main configuration file.
protected static java.lang.String META_INF_RESOURCES
          The resource path for faces-config files included in the META-INF directory of JAR files.
protected static java.lang.String WEB_INF_RESOURCE
          The resource path for the faces configuration in the WEB-INF directory of an application.
protected  WebConfiguration webConfig
           
 
Constructor Summary
ConfigureListener()
           
 
Method Summary
protected  void configure(javax.servlet.ServletContext context, FacesConfigBean config)
          Configure the JavaServer Faces reference implementation based on the accumulated configuration beans.
 void contextDestroyed(javax.servlet.ServletContextEvent sce)
           
 void contextInitialized(javax.servlet.ServletContextEvent sce)
           
protected  org.apache.commons.digester.Digester digester(boolean validateXml)
          Configure and return a Digester instance suitable for parsing the runtime configuration information we need.
protected  boolean isFeatureEnabled(WebConfiguration.BooleanWebContextInitParameter param)
          Determines if a particular feature, configured via the web deployment descriptor as a true/false value, is enabled or not.
 void logOverriddenContextConfigValues()
          A subclass of ConfigureListener can override isFeatureEnabled and reset one of the boolean values.
protected  void parse(org.apache.commons.digester.Digester digester, java.net.URL url, FacesConfigBean fcb)
          Parse the configuration resource at the specified URL, using the specified Digester instance.
 void registerELResolverAndListenerWithJsp(javax.servlet.ServletContext context)
           
protected  void releaseDigester(org.apache.commons.digester.Digester toRelease)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACES_CONFIG_BEAN_KEY

protected static final java.lang.String FACES_CONFIG_BEAN_KEY

ServletContext attribute key.

See Also:
Constant Field Values

JSF_RI_CONFIG

protected static final java.lang.String JSF_RI_CONFIG

The path to the RI main configuration file.

See Also:
Constant Field Values

META_INF_RESOURCES

protected static final java.lang.String META_INF_RESOURCES

The resource path for faces-config files included in the META-INF directory of JAR files.

See Also:
Constant Field Values

WEB_INF_RESOURCE

protected static final java.lang.String WEB_INF_RESOURCE

The resource path for the faces configuration in the WEB-INF directory of an application.

See Also:
Constant Field Values

webConfig

protected WebConfiguration webConfig
Constructor Detail

ConfigureListener

public ConfigureListener()
Method Detail

logOverriddenContextConfigValues

public void logOverriddenContextConfigValues()
A subclass of ConfigureListener can override isFeatureEnabled and reset one of the boolean values. This method lets the user know that this happened for a particular feature.


contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent sce)
Specified by:
contextInitialized in interface javax.servlet.ServletContextListener

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent sce)
Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener

configure

protected void configure(javax.servlet.ServletContext context,
                         FacesConfigBean config)
                  throws java.lang.Exception

Configure the JavaServer Faces reference implementation based on the accumulated configuration beans.

Parameters:
context - ServletContext for this web application
config - FacesConfigBean that is the root of the tree of configuration information
Throws:
java.lang.Exception - if an error occurs during the boostrap process

digester

protected org.apache.commons.digester.Digester digester(boolean validateXml)

Configure and return a Digester instance suitable for parsing the runtime configuration information we need.

Parameters:
validateXml - if true, validation is turned on during parsing.
Returns:
a Digester instance suitable for parsing faces-config documents

releaseDigester

protected void releaseDigester(org.apache.commons.digester.Digester toRelease)

parse

protected void parse(org.apache.commons.digester.Digester digester,
                     java.net.URL url,
                     FacesConfigBean fcb)

Parse the configuration resource at the specified URL, using the specified Digester instance.

Parameters:
digester - Digester to use for parsing
url - URL of the configuration resource to be parsed
fcb - FacesConfigBean to accumulate results

isFeatureEnabled

protected boolean isFeatureEnabled(WebConfiguration.BooleanWebContextInitParameter param)

Determines if a particular feature, configured via the web deployment descriptor as a true/false value, is enabled or not.

Parameters:
param - the BooleanWebContextInitParameter of interest
Returns:
true if the feature in question is enabled, otherwise false

registerELResolverAndListenerWithJsp

public void registerELResolverAndListenerWithJsp(javax.servlet.ServletContext context)


Copyright ? 2002-2006 Sun Microsystems, Inc. All Rights Reserved.