|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.startup.ContextConfig
public class ContextConfig
Startup event listener for a Context that configures the properties of that Context, and the associated defined servlets.
Field Summary | |
---|---|
protected static Properties |
authenticators
The set of Authenticators that we know how to configure. |
protected Context |
context
The Context we are associated with. |
protected Map<String,Authenticator> |
customAuthenticators
Custom mappings of login methods to authenticators |
protected String |
defaultContextXml
Deprecated. Unnecessary |
protected String |
defaultWebXml
The default web application's deployment descriptor location. |
protected static long |
deploymentCount
Deployment count. |
protected static LoginConfig |
DUMMY_LOGIN_CONFIG
|
protected boolean |
handlesTypesAnnotations
Flag that indicates if at least one HandlesTypes entry is present
that represents an annotation. |
protected boolean |
handlesTypesNonAnnotations
Flag that indicates if at least one HandlesTypes entry is present
that represents a non-annotation. |
protected static Map<Host,org.apache.catalina.startup.ContextConfig.DefaultWebXmlCacheEntry> |
hostWebXmlCache
Cache of default web.xml fragments per Host |
protected Map<ServletContainerInitializer,Set<Class<?>>> |
initializerClassMap
Map of ServletContainerInitializer to classes they expressed interest in. |
protected Map<String,org.apache.catalina.startup.ContextConfig.JavaClassCacheEntry> |
javaClassCache
Cache of JavaClass objects (byte code) by fully qualified class name. |
protected boolean |
ok
Track any fatal errors during startup configuration processing. |
protected String |
originalDocBase
Original docBase. |
protected static StringManager |
sm
The string resources for this package. |
protected Map<Class<?>,Set<ServletContainerInitializer>> |
typeInitializerMap
Map of Types to ServletContainerInitializer that are interested in those types. |
protected Digester |
webDigester
The Digester we will use to process web application
deployment descriptor files. |
protected Digester |
webFragmentDigester
The Digester we will use to process web fragment
deployment descriptor files. |
protected WebRuleSet |
webFragmentRuleSet
|
protected WebRuleSet |
webRuleSet
|
Constructor Summary | |
---|---|
ContextConfig()
|
Method Summary | |
---|---|
protected void |
antiLocking()
|
protected void |
applicationAnnotationsConfig()
Process the application classes annotations, 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 |
checkHandlesTypes(JavaClass javaClass)
For classes packaged with the web application, the class and each super class needs to be checked for a match with HandlesTypes or
for an annotation that matches HandlesTypes . |
protected void |
configureStart()
Process a "contextConfig" event for this Context. |
protected void |
configureStop()
Process a "stop" event for this Context. |
protected void |
contextConfig(Digester digester)
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 WebXml |
createWebXml()
|
void |
createWebXmlDigester(boolean namespaceAware,
boolean validation)
Create and return a Digester configured to process the web application deployment descriptor (web.xml). |
protected void |
destroy()
Process a "destroy" event for this Context. |
protected void |
fixDocBase()
Adjust docBase. |
protected String |
getBaseDir()
|
protected File |
getConfigBase()
Get config base. |
protected InputSource |
getContextWebXmlSource()
Identify the application web.xml to be used and obtain an input source for it. |
String |
getDefaultContextXml()
Deprecated. Never changed from default |
String |
getDefaultWebXml()
Return the location of the default deployment descriptor |
protected InputSource |
getGlobalWebXmlSource()
Identify the default web.xml to be used and obtain an input source for it. |
protected File |
getHostConfigBase()
|
protected InputSource |
getHostWebXmlSource()
Identify the host web.xml to be used and obtain an input source for it. |
protected ServletContainerInitializer |
getServletContainerInitializer(InputStream is)
Extract the name of the ServletContainerInitializer. |
protected InputSource |
getWebXmlSource(String filename,
String path)
|
protected void |
init()
Process a "init" event for this Context. |
void |
lifecycleEvent(LifecycleEvent event)
Process events for an associated Context. |
protected void |
parseWebXml(InputSource source,
WebXml dest,
boolean fragment)
|
protected void |
processAnnotations(Set<WebXml> fragments)
|
protected void |
processAnnotationsFile(File file,
WebXml fragment)
|
protected void |
processAnnotationsJar(URL url,
WebXml fragment)
|
protected void |
processAnnotationsJndi(URL url,
WebXml fragment)
|
protected void |
processAnnotationsStream(InputStream is,
WebXml fragment)
|
protected String[] |
processAnnotationsStringArray(ElementValue ev)
|
protected void |
processAnnotationsUrl(URL url,
WebXml fragment)
|
protected void |
processAnnotationWebFilter(String className,
AnnotationEntry ae,
WebXml fragment)
process filter annotation and merge with existing one! |
protected Map<String,String> |
processAnnotationWebInitParams(ElementValue ev)
|
protected void |
processAnnotationWebServlet(String className,
AnnotationEntry ae,
WebXml fragment)
|
protected void |
processContextConfig(Digester digester,
URL contextXml)
Process a context.xml. |
protected Map<String,WebXml> |
processJarsForWebFragments()
Scan /META-INF/lib for JARs and for each one found add it and any /META-INF/web-fragment.xml to the resulting Map. web-fragment.xml files will be parsed before being added to the map. |
protected void |
processResourceJARs(Set<WebXml> fragments)
Scan JARs that contain web-fragment.xml files that will be used to configure this application to see if they also contain static resources. |
protected void |
processServletContainerInitializers(Set<WebXml> fragments)
Scan JARs for ServletContainerInitializer implementations. |
void |
setCustomAuthenticators(Map<String,Authenticator> customAuthenticators)
Sets custom mappings of login methods to authenticators. |
void |
setDefaultContextXml(String path)
Deprecated. Unused |
void |
setDefaultWebXml(String path)
Set the location of the default deployment descriptor |
protected void |
validateSecurityRoles()
Validate the usage of security role names in the web application deployment descriptor. |
protected void |
webConfig()
Scan the web.xml files that apply to the web application and merge them using the rules defined in the spec. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final StringManager sm
protected static final LoginConfig DUMMY_LOGIN_CONFIG
protected static final Properties authenticators
protected static long deploymentCount
protected static final Map<Host,org.apache.catalina.startup.ContextConfig.DefaultWebXmlCacheEntry> hostWebXmlCache
protected Map<String,Authenticator> customAuthenticators
protected Context context
@Deprecated protected String defaultContextXml
protected String defaultWebXml
protected boolean ok
protected String originalDocBase
protected final Map<ServletContainerInitializer,Set<Class<?>>> initializerClassMap
protected final Map<Class<?>,Set<ServletContainerInitializer>> typeInitializerMap
protected final Map<String,org.apache.catalina.startup.ContextConfig.JavaClassCacheEntry> javaClassCache
HandlesTypes
.
protected boolean handlesTypesAnnotations
HandlesTypes
entry is present
that represents an annotation.
protected boolean handlesTypesNonAnnotations
HandlesTypes
entry is present
that represents a non-annotation.
protected Digester webDigester
Digester
we will use to process web application
deployment descriptor files.
protected WebRuleSet webRuleSet
protected Digester webFragmentDigester
Digester
we will use to process web fragment
deployment descriptor files.
protected WebRuleSet webFragmentRuleSet
Constructor Detail |
---|
public ContextConfig()
Method Detail |
---|
public String getDefaultWebXml()
public void setDefaultWebXml(String path)
path
- Absolute/relative path to the default web.xml@Deprecated public String getDefaultContextXml()
@Deprecated public void setDefaultContextXml(String path)
path
- Absolute/relative path to the default context.xmlpublic void setCustomAuthenticators(Map<String,Authenticator> customAuthenticators)
customAuthenticators
- Custom mappings of login methods to
authenticatorspublic void lifecycleEvent(LifecycleEvent event)
lifecycleEvent
in interface LifecycleListener
event
- The lifecycle event that has occurredprotected void applicationAnnotationsConfig()
protected void authenticatorConfig()
public void createWebXmlDigester(boolean namespaceAware, boolean validation)
protected Digester createContextDigester()
protected String getBaseDir()
protected void contextConfig(Digester digester)
protected void processContextConfig(Digester digester, URL contextXml)
protected void fixDocBase() throws IOException
IOException
protected void antiLocking()
protected void init()
protected void beforeStart()
protected void configureStart()
protected void configureStop()
protected void destroy()
protected void validateSecurityRoles()
ok
instance variable to false
as well).
protected File getConfigBase()
protected File getHostConfigBase()
protected void webConfig()
protected WebXml createWebXml()
protected void processServletContainerInitializers(Set<WebXml> fragments)
protected ServletContainerInitializer getServletContainerInitializer(InputStream is) throws IOException
is
- The resource where the name is defined
IOException
protected void processResourceJARs(Set<WebXml> fragments)
protected InputSource getGlobalWebXmlSource()
protected InputSource getHostWebXmlSource()
protected InputSource getContextWebXmlSource()
protected InputSource getWebXmlSource(String filename, String path)
filename
- Name of the file (possibly with one or more leading path
segments) to readpath
- Location that filename is relative toprotected void parseWebXml(InputSource source, WebXml dest, boolean fragment)
protected Map<String,WebXml> processJarsForWebFragments()
null
will be used if no web-fragment.xml was found. Any JARs
known not contain fragments will be skipped.
protected void processAnnotations(Set<WebXml> fragments)
protected void processAnnotationsUrl(URL url, WebXml fragment)
protected void processAnnotationsJar(URL url, WebXml fragment)
protected void processAnnotationsJndi(URL url, WebXml fragment)
protected void processAnnotationsFile(File file, WebXml fragment)
protected void processAnnotationsStream(InputStream is, WebXml fragment) throws ClassFormatException, IOException
ClassFormatException
IOException
protected void checkHandlesTypes(JavaClass javaClass)
HandlesTypes
or
for an annotation that matches HandlesTypes
.
javaClass
- protected void processAnnotationWebServlet(String className, AnnotationEntry ae, WebXml fragment)
protected void processAnnotationWebFilter(String className, AnnotationEntry ae, WebXml fragment)
className
- ae
- fragment
- protected String[] processAnnotationsStringArray(ElementValue ev)
protected Map<String,String> processAnnotationWebInitParams(ElementValue ev)
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |