Package org.apache.hadoop.util
Class ApplicationClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.apache.hadoop.util.ApplicationClassLoader
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
ApplicationClassLoader
A
URLClassLoader for application isolation. Classes from the
application JARs are loaded in preference to the parent loader.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault value of the system classes if the user did not override them. -
Constructor Summary
ConstructorsConstructorDescriptionApplicationClassLoader(String classpath, ClassLoader parent, List<String> systemClasses) ApplicationClassLoader(URL[] urls, ClassLoader parent, List<String> systemClasses) -
Method Summary
Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Field Details
-
SYSTEM_CLASSES_DEFAULT
Default value of the system classes if the user did not override them. JDK classes, hadoop classes and resources, and some select third-party classes are considered system classes, and are not loaded by the application classloader.
-
-
Constructor Details
-
ApplicationClassLoader
-
ApplicationClassLoader
public ApplicationClassLoader(String classpath, ClassLoader parent, List<String> systemClasses) throws MalformedURLException - Throws:
MalformedURLException
-
-
Method Details
-
getResource
- Overrides:
getResourcein classClassLoader
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
isSystemClass
Checks if a class should be included as a system class. A class is a system class if and only if it matches one of the positive patterns and none of the negative ones.- Parameters:
name- the class name to checksystemClasses- a list of system class configurations.- Returns:
- true if the class is a system class
-