Class WebappClassLoaderBase

java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.apache.catalina.loader.WebappClassLoaderBase
All Implemented Interfaces:
Closeable, AutoCloseable, Lifecycle, WebappProperties, InstrumentableClassLoader, PermissionCheck
Direct Known Subclasses:
ParallelWebappClassLoader, WebappClassLoader

public abstract class WebappClassLoaderBase extends URLClassLoader implements Lifecycle, InstrumentableClassLoader, WebappProperties, PermissionCheck
Specialized web application class loader.

This class loader is a full reimplementation of the URLClassLoader from the JDK. It is designed to be fully compatible with a normal URLClassLoader, although its internal behavior may be completely different.

IMPLEMENTATION NOTE - By default, this class loader follows the delegation model required by the specification. The bootstrap class loader will be queried first, then the local repositories, and only then delegation to the parent class loader will occur. This allows the web application to override any shared class except the classes from J2SE. Special handling is provided from the JAXP XML parser interfaces, the JNDI interfaces, and the classes from the servlet API, which are never loaded from the webapp repositories. The delegate property allows an application to modify this behavior to move the parent class loader ahead of the local repositories.

IMPLEMENTATION NOTE - Due to limitations in Jasper compilation technology, any repository which contains classes from the servlet API will be ignored by the class loader.

IMPLEMENTATION NOTE - The class loader generates source URLs which include the full JAR URL when a class is loaded from a JAR file, which allows setting security permission at the class level, even when a class is contained inside a JAR.

IMPLEMENTATION NOTE - Local repositories are searched in the order they are added via the initial constructor.

IMPLEMENTATION NOTE - No check for sealing violations or security is made unless a security manager is present.

IMPLEMENTATION NOTE - As of 8.0, this class loader implements InstrumentableClassLoader, permitting web application classes to instrument other classes in the same web application. It does not permit instrumentation of system or container classes or classes in other web apps.

Author:
Remy Maucherat, Craig R. McClanahan