@InterfaceAudience.Public @InterfaceStability.Unstable public class ApplicationClassLoader extends URLClassLoader
URLClassLoader
for application isolation. Classes from the
application JARs are loaded in preference to the parent loader.Modifier and Type | Field and Description |
---|---|
static String |
SYSTEM_CLASSES_DEFAULT
Default value of the system classes if the user did not override them.
|
Constructor and Description |
---|
ApplicationClassLoader(String classpath,
ClassLoader parent,
List<String> systemClasses) |
ApplicationClassLoader(URL[] urls,
ClassLoader parent,
List<String> systemClasses) |
Modifier and Type | Method and Description |
---|---|
URL |
getResource(String name) |
static boolean |
isSystemClass(String name,
List<String> systemClasses)
Checks if a class should be included as a system class.
|
Class<?> |
loadClass(String name) |
protected Class<?> |
loadClass(String name,
boolean resolve) |
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public static final String SYSTEM_CLASSES_DEFAULT
public ApplicationClassLoader(URL[] urls, ClassLoader parent, List<String> systemClasses)
public ApplicationClassLoader(String classpath, ClassLoader parent, List<String> systemClasses) throws MalformedURLException
MalformedURLException
public URL getResource(String name)
getResource
in class ClassLoader
public Class<?> loadClass(String name) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
public static boolean isSystemClass(String name, List<String> systemClasses)
name
- the class name to checksystemClasses
- a list of system class configurations.Copyright © 2022 Apache Software Foundation. All rights reserved.