Class ContextConfig

  • All Implemented Interfaces:
    LifecycleListener
    Direct Known Subclasses:
    WebModuleContextConfig

    public class ContextConfig
    extends Object
    implements LifecycleListener
    Startup event listener for a Context that configures the properties of that Context, and the associated defined servlets.
    Version:
    $Revision: 1.14 $ $Date: 2007/02/20 20:16:56 $
    Author:
    Craig R. McClanahan, Jean-Francois Arcand
    • Field Detail

      • authenticators

        protected static final Properties authenticators
        The set of Authenticators that we know how to configure. The key is the name of the implemented authentication method, and the value is the fully qualified Java class name of the corresponding Valve.
      • context

        protected Context context
        The Context we are associated with.
      • defaultContextXml

        protected String defaultContextXml
        The default web application's context file location.
      • defaultWebXml

        protected String defaultWebXml
        The default web application's deployment descriptor location.
      • ok

        protected boolean ok
        Track any fatal errors during startup configuration processing.
      • parseException

        protected SAXParseException parseException
        Any parse error which occurred while parsing XML descriptors.
      • contextDigester

        protected static final Digester contextDigester
        The Digester we will use to process web application context files.
      • webDigester

        protected static final Digester webDigester
        The Digester we will use to process web application deployment descriptor files.
      • webRuleSet

        protected static final WebRuleSet webRuleSet
        The Rule used to parse the web.xml
    • Constructor Detail

      • ContextConfig

        public ContextConfig()
    • Method Detail

      • setClassLoader

        public void setClassLoader​(ClassLoader cl)
      • getDebug

        public int getDebug()
        Return the debugging detail level for this component.
      • setDebug

        public void setDebug​(int debug)
        Set the debugging detail level for this component.
        Parameters:
        debug - The new debugging detail level
      • getDefaultWebXml

        public String getDefaultWebXml()
        Return the location of the default deployment descriptor
      • setDefaultWebXml

        public void setDefaultWebXml​(String path)
        Set the location of the default deployment descriptor
        Parameters:
        path - Absolute/relative path to the default web.xml
      • getDefaultContextXml

        public String getDefaultContextXml()
        Return the location of the default context file
      • setDefaultContextXml

        public void setDefaultContextXml​(String path)
        Set the location of the default context file
        Parameters:
        path - Absolute/relative path to the default context.xml
      • setCustomAuthenticators

        public void setCustomAuthenticators​(Map<String,​Authenticator> customAuthenticators)
        Sets custom mappings of login methods to authenticators.
        Parameters:
        customAuthenticators - Custom mappings of login methods to authenticators
      • managerConfig

        protected void managerConfig()
        Set up a manager.
      • authenticatorConfig

        protected void authenticatorConfig()
                                    throws LifecycleException
        Set up an Authenticator automatically if required, and one has not already been configured.
        Throws:
        LifecycleException
      • createWebDigester

        public static Digester createWebDigester()
        Create and return a Digester configured to process the web application deployment descriptor (web.xml).
      • createWebXmlDigester

        public static Digester createWebXmlDigester​(boolean namespaceAware,
                                                    boolean validation)
      • createContextDigester

        protected static Digester createContextDigester()
        Create and return a Digester configured to process the context configuration descriptor for an application.
      • getBaseDir

        protected String getBaseDir()
      • defaultConfig

        protected void defaultConfig()
                              throws LifecycleException
        Process the default configuration file, if it exists. The default config must be read with the container loader - so container servlets can be loaded
        Throws:
        LifecycleException
      • contextConfig

        protected void contextConfig()
        Process the default configuration file, if it exists.
      • processContextConfig

        protected void processContextConfig​(File baseDir,
                                            String resourceName)
        Process a context.xml.
      • init

        protected void init()
        Process a "init" event for this Context.
      • stop

        protected void stop()
        Process a "stop" event for this Context.
      • validateSecurityRoles

        protected void validateSecurityRoles()
        Validate the usage of security role names in the web application deployment descriptor. If any problems are found, issue warning messages (for backwards compatibility) and add the missing roles. (To make these problems fatal instead, simply set the ok instance variable to false as well).