Class WebAppClassLoader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClassVisibilityChecker
Specializes URLClassLoader with some utility and file mapping methods.
This loader defaults to the 2.3 servlet spec behavior where non
system classes are loaded from the classpath in preference to the
parent loader. Java2 compliant loading, where the parent loader
always has priority, can be selected with the
WebAppContext.setParentLoaderPriority(boolean)
method and influenced with WebAppClassLoader.Context.isHiddenClass(Class)
and
WebAppClassLoader.Context.isProtectedClass(Class)
.
If no parent class loader is provided, then the current thread context classloader will be used. If that is null then the classloader that loaded this class is used as the parent.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.ee.webapp.WebAppClassLoader
WebAppClassLoader.Context
-
Constructor Summary
ConstructorsConstructorDescriptionWebAppClassLoader
(ClassLoader parent, WebAppClassLoader.Context context) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.eclipse.jetty.ee.webapp.WebAppClassLoader
addClassPath, addClassPath, addJars, addTransformer, close, findClass, foundClass, getContext, getName, getPermissions, getResource, getResources, isHiddenClass, isProtectedClass, loadAsResource, loadClass, removeTransformer, runWithHiddenClassAccess, setName, toString
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstance
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getPackage, getPackages, getParent, getPlatformClassLoader, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.ClassVisibilityChecker
isServerClass, isSystemClass
-
Constructor Details
-
WebAppClassLoader
Deprecated, for removal: This API element is subject to removal in a future version. -
WebAppClassLoader
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
runWithServerClassAccess
@Deprecated(since="12.1.0", forRemoval=true) public static <T> T runWithServerClassAccess(PrivilegedExceptionAction<T> action) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.Run an action with access to ServerClassesRun the passed
PrivilegedExceptionAction
with the classloader configured so as to allow server classes to be visible- Type Parameters:
T
- the type of PrivilegedExceptionAction- Parameters:
action
- The action to run- Returns:
- The return from the action
- Throws:
Exception
- if thrown by the action
-
WebAppClassLoader
directly instead.