Apache Tomcat 6.0.43

org.apache.catalina.startup
Class ContextConfig

java.lang.Object
  extended by org.apache.catalina.startup.ContextConfig
All Implemented Interfaces:
LifecycleListener

public class ContextConfig
extends java.lang.Object
implements LifecycleListener

Startup event listener for a Context that configures the properties of that Context, and the associated defined servlets.

Author:
Craig R. McClanahan, Jean-Francois Arcand

Nested Class Summary
protected  class ContextConfig.ContextErrorHandler
          Deprecated. Unused. Use XmlErrorHandler. Will be removed in Tomcat 7.0.x
 
Field Summary
protected static java.util.Properties authenticators
          The set of Authenticators that we know how to configure.
protected  Context context
          The Context we are associated with.
protected static Digester contextDigester
          The Digester we will use to process web application context files.
protected  java.util.Map customAuthenticators
          Custom mappings of login methods to authenticators
protected  java.lang.String defaultContextXml
          The default web application's context file location.
protected  java.lang.String defaultWebXml
          The default web application's deployment descriptor location.
protected static long deploymentCount
          Deployment count.
protected static LoginConfig DUMMY_LOGIN_CONFIG
           
protected static Log log
           
protected  boolean ok
          Track any fatal errors during startup configuration processing.
protected  java.lang.String originalDocBase
          Original docBase.
protected  org.xml.sax.SAXParseException parseException
          Deprecated. Unused. Will be removed in Tomcat 7.0.x.
protected static StringManager sm
          The string resources for this package.
protected  Digester webDigester
          The Digester we will use to process web application deployment descriptor files.
protected  WebRuleSet webRuleSet
           
protected static boolean xmlNamespaceAware
          Deprecated. Unused. Will be removed in Tomcat 7.0.x.
protected static boolean xmlValidation
          Deprecated. Unused. Will be removed in Tomcat 7.0.x.
 
Constructor Summary
ContextConfig()
           
 
Method Summary
protected  void antiLocking()
           
protected  void applicationAnnotationsConfig()
          Process the application classes annotations, if it exists.
protected  void applicationWebConfig()
          Process the application configuration file, if it exists.
protected  void authenticatorConfig()
          Set up an Authenticator automatically if required, and one has not already been configured.
protected  void beforeStart()
          Process a "before start" event for this Context.
protected  void contextConfig()
          Process the default configuration file, if it exists.
protected  Digester createContextDigester()
          Create (if necessary) and return a Digester configured to process the context configuration descriptor for an application.
protected  void createWebXmlDigester(boolean namespaceAware, boolean validation)
          Create and return a Digester configured to process the web application deployment descriptor (web.xml).
protected  void defaultWebConfig()
          Process the default configuration file, if it exists.
protected  void destroy()
          Process a "destroy" event for this Context.
protected  void fixDocBase()
          Adjust docBase.
protected  java.lang.String getBaseDir()
           
protected  java.io.File getConfigBase()
          Get config base.
 java.lang.String getDefaultContextXml()
          Return the location of the default context file
 java.lang.String getDefaultWebXml()
          Return the location of the default deployment descriptor
protected  java.lang.String getHostConfigPath(java.lang.String resourceName)
           
protected  void init()
          Process a "init" event for this Context.
 void lifecycleEvent(LifecycleEvent event)
          Process events for an associated Context.
protected  void processContextConfig(java.io.File baseDir, java.lang.String resourceName)
          Process a context.xml.
protected  void processDefaultWebConfig(Digester digester, java.io.InputStream stream, org.xml.sax.InputSource source)
          Process a default web.xml.
 void setCustomAuthenticators(java.util.Map customAuthenticators)
          Sets custom mappings of login methods to authenticators.
 void setDefaultContextXml(java.lang.String path)
          Set the location of the default context file
 void setDefaultWebXml(java.lang.String path)
          Set the location of the default deployment descriptor
protected  void start()
          Process a "start" event for this Context.
protected  void stop()
          Process a "stop" event for this Context.
protected  void validateSecurityRoles()
          Validate the usage of security role names in the web application deployment descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Log log

sm

protected static final StringManager sm
The string resources for this package.


customAuthenticators

protected java.util.Map customAuthenticators
Custom mappings of login methods to authenticators


authenticators

protected static java.util.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 java.lang.String defaultContextXml
The default web application's context file location.


defaultWebXml

protected java.lang.String defaultWebXml
The default web application's deployment descriptor location.


ok

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


parseException

@Deprecated
protected org.xml.sax.SAXParseException parseException
Deprecated. Unused. Will be removed in Tomcat 7.0.x.
Any parse error which occurred while parsing XML descriptors.


originalDocBase

protected java.lang.String originalDocBase
Original docBase.


contextDigester

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


webDigester

protected Digester webDigester
The Digester we will use to process web application deployment descriptor files.


webRuleSet

protected WebRuleSet webRuleSet

xmlValidation

@Deprecated
protected static boolean xmlValidation
Deprecated. Unused. Will be removed in Tomcat 7.0.x.
Attribute value used to turn on/off XML validation


xmlNamespaceAware

@Deprecated
protected static boolean xmlNamespaceAware
Deprecated. Unused. Will be removed in Tomcat 7.0.x.
Attribute value used to turn on/off XML namespace awarenes.


deploymentCount

protected static long deploymentCount
Deployment count.


DUMMY_LOGIN_CONFIG

protected static final LoginConfig DUMMY_LOGIN_CONFIG
Constructor Detail

ContextConfig

public ContextConfig()
Method Detail

getDefaultWebXml

public java.lang.String getDefaultWebXml()
Return the location of the default deployment descriptor


setDefaultWebXml

public void setDefaultWebXml(java.lang.String path)
Set the location of the default deployment descriptor

Parameters:
path - Absolute/relative path to the default web.xml

getDefaultContextXml

public java.lang.String getDefaultContextXml()
Return the location of the default context file


setDefaultContextXml

public void setDefaultContextXml(java.lang.String path)
Set the location of the default context file

Parameters:
path - Absolute/relative path to the default context.xml

setCustomAuthenticators

public void setCustomAuthenticators(java.util.Map customAuthenticators)
Sets custom mappings of login methods to authenticators.

Parameters:
customAuthenticators - Custom mappings of login methods to authenticators

lifecycleEvent

public void lifecycleEvent(LifecycleEvent event)
Process events for an associated Context.

Specified by:
lifecycleEvent in interface LifecycleListener
Parameters:
event - The lifecycle event that has occurred

applicationAnnotationsConfig

protected void applicationAnnotationsConfig()
Process the application classes annotations, if it exists.


applicationWebConfig

protected void applicationWebConfig()
Process the application configuration file, if it exists.


authenticatorConfig

protected void authenticatorConfig()
Set up an Authenticator automatically if required, and one has not already been configured.


createWebXmlDigester

protected void createWebXmlDigester(boolean namespaceAware,
                                    boolean validation)
Create and return a Digester configured to process the web application deployment descriptor (web.xml).


createContextDigester

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


getBaseDir

protected java.lang.String getBaseDir()

defaultWebConfig

protected void defaultWebConfig()
Process the default configuration file, if it exists. The default config must be read with the container loader - so container servlets can be loaded


processDefaultWebConfig

protected void processDefaultWebConfig(Digester digester,
                                       java.io.InputStream stream,
                                       org.xml.sax.InputSource source)
Process a default web.xml.


contextConfig

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


processContextConfig

protected void processContextConfig(java.io.File baseDir,
                                    java.lang.String resourceName)
Process a context.xml.


fixDocBase

protected void fixDocBase()
                   throws java.io.IOException
Adjust docBase.

Throws:
java.io.IOException

antiLocking

protected void antiLocking()
                    throws java.io.IOException
Throws:
java.io.IOException

init

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


beforeStart

protected void beforeStart()
Process a "before start" event for this Context.


start

protected void start()
Process a "start" event for this Context.


stop

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


destroy

protected void destroy()
Process a "destroy" 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).


getConfigBase

protected java.io.File getConfigBase()
Get config base.


getHostConfigPath

protected java.lang.String getHostConfigPath(java.lang.String resourceName)

Apache Tomcat 6.0.43

Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.