Class WebappClassLoaderBase

All Implemented Interfaces:
Closeable, AutoCloseable, Lifecycle, WebappProperties, InstrumentableClassLoader
Direct Known Subclasses:
ParallelWebappClassLoader, WebappClassLoader

public abstract class WebappClassLoaderBase extends URLClassLoader implements Lifecycle, InstrumentableClassLoader, WebappProperties
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 - 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.

Remy Maucherat, Craig R. McClanahan