Package org.eclipse.jetty.webapp
Class MetaInfConfiguration
java.lang.Object
org.eclipse.jetty.webapp.AbstractConfiguration
org.eclipse.jetty.webapp.MetaInfConfiguration
- All Implemented Interfaces:
Configuration
MetaInfConfiguration
Scan META-INF of jars to find:
- tlds
- web-fragment.xml
- resources
- those from the container classpath whose pattern matched the WebInfConfiguration.CONTAINER_JAR_PATTERN
- those from WEB-INF/lib
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.webapp.Configuration
Configuration.ClassList, Configuration.Wrapper, Configuration.WrapperFunction -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final booleanstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.eclipse.jetty.webapp.Configuration
ATTR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFind all .tld files in all subdirs of the given dir.Find all .tld files in the given jar.voidpostConfigure(WebAppContext context) Clear down after configuration.voidpreConfigure(WebAppContext context) Set up for configuration.voidscanForFragment(WebAppContext context, org.eclipse.jetty.util.resource.Resource jar, ConcurrentHashMap<org.eclipse.jetty.util.resource.Resource, org.eclipse.jetty.util.resource.Resource> cache) Scan for META-INF/web-fragment.xml file in the given jar.voidscanForResources(WebAppContext context, org.eclipse.jetty.util.resource.Resource target, ConcurrentHashMap<org.eclipse.jetty.util.resource.Resource, org.eclipse.jetty.util.resource.Resource> cache) Scan for META-INF/resources dir in the given jar.voidscanForTlds(WebAppContext context, org.eclipse.jetty.util.resource.Resource jar, ConcurrentHashMap<org.eclipse.jetty.util.resource.Resource, Collection<URL>> cache) Discover META-INF/*.tld files in the given jarvoidscanJars(WebAppContext context, Collection<org.eclipse.jetty.util.resource.Resource> jars, boolean useCaches) For backwards compatibility.voidscanJars(WebAppContext context, Collection<org.eclipse.jetty.util.resource.Resource> jars, boolean useCaches, List<String> scanTypes) Look into the jars to discover info in META-INF.Methods inherited from class org.eclipse.jetty.webapp.AbstractConfiguration
cloneConfigure, configure, deconfigure, destroy
-
Field Details
-
USE_CONTAINER_METAINF_CACHE
- See Also:
-
DEFAULT_USE_CONTAINER_METAINF_CACHE
public static final boolean DEFAULT_USE_CONTAINER_METAINF_CACHE- See Also:
-
CACHED_CONTAINER_TLDS
- See Also:
-
CACHED_CONTAINER_FRAGMENTS
- See Also:
-
CACHED_CONTAINER_RESOURCES
- See Also:
-
METAINF_TLDS
- See Also:
-
METAINF_FRAGMENTS
- See Also:
-
METAINF_RESOURCES
- See Also:
-
__allScanTypes
-
-
Constructor Details
-
MetaInfConfiguration
public MetaInfConfiguration()
-
-
Method Details
-
preConfigure
Description copied from interface:ConfigurationSet up for configuration.Typically this step discovers configuration resources
- Specified by:
preConfigurein interfaceConfiguration- Overrides:
preConfigurein classAbstractConfiguration- Parameters:
context- The context to configure- Throws:
Exception- if unable to pre configure
-
scanJars
public void scanJars(WebAppContext context, Collection<org.eclipse.jetty.util.resource.Resource> jars, boolean useCaches) throws Exception For backwards compatibility. This method will always scan for all types of data.- Parameters:
context- the context for the scanjars- the jars to scanuseCaches- if true, the scanned info is cached- Throws:
Exception- if unable to scan the jars
-
scanJars
public void scanJars(WebAppContext context, Collection<org.eclipse.jetty.util.resource.Resource> jars, boolean useCaches, List<String> scanTypes) throws Exception Look into the jars to discover info in META-INF. If useCaches == true, then we will cache the info discovered indexed by the jar in which it was discovered: this speeds up subsequent context deployments.- Parameters:
context- the context for the scanjars- the jars resources to scanuseCaches- if true, cache the info discoveredscanTypes- the type of things to look for in the jars- Throws:
Exception- if unable to scan the jars
-
scanForResources
public void scanForResources(WebAppContext context, org.eclipse.jetty.util.resource.Resource target, ConcurrentHashMap<org.eclipse.jetty.util.resource.Resource, org.eclipse.jetty.util.resource.Resource> cache) throws ExceptionScan for META-INF/resources dir in the given jar.- Parameters:
context- the context for the scantarget- the target resource to scan forcache- the resource cache- Throws:
Exception- if unable to scan for resources
-
scanForFragment
public void scanForFragment(WebAppContext context, org.eclipse.jetty.util.resource.Resource jar, ConcurrentHashMap<org.eclipse.jetty.util.resource.Resource, org.eclipse.jetty.util.resource.Resource> cache) throws ExceptionScan for META-INF/web-fragment.xml file in the given jar.- Parameters:
context- the context for the scanjar- the jar resource to scan for fragements incache- the resource cache- Throws:
Exception- if unable to scan for fragments
-
scanForTlds
public void scanForTlds(WebAppContext context, org.eclipse.jetty.util.resource.Resource jar, ConcurrentHashMap<org.eclipse.jetty.util.resource.Resource, Collection<URL>> cache) throws ExceptionDiscover META-INF/*.tld files in the given jar- Parameters:
context- the context for the scanjar- the jar resources to scan tlds forcache- the resource cache- Throws:
Exception- if unable to scan for tlds
-
postConfigure
Description copied from interface:ConfigurationClear down after configuration.- Specified by:
postConfigurein interfaceConfiguration- Overrides:
postConfigurein classAbstractConfiguration- Parameters:
context- The context to configure- Throws:
Exception- if unable to post configure
-
getTlds
Find all .tld files in all subdirs of the given dir.- Parameters:
dir- the directory to scan- Returns:
- the list of tlds found
- Throws:
IOException- if unable to scan the directory
-
getTlds
Find all .tld files in the given jar.- Parameters:
uri- the uri to jar file- Returns:
- the collection of tlds as url references
- Throws:
IOException- if unable to scan the jar file
-