Package hudson.util
Class MaskingClassLoader
java.lang.Object
java.lang.ClassLoader
hudson.util.DelegatingClassLoader
hudson.util.MaskingClassLoader
ClassLoader
that masks a specified set of classes
from its parent class loader.
This code is used to create an isolated environment.
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
ConstructorsConstructorDescriptionMaskingClassLoader
(ClassLoader parent, String... masks) MaskingClassLoader
(ClassLoader parent, Collection<String> masks) -
Method Summary
Modifier and TypeMethodDescriptiongetResource
(String name) getResources
(String name) protected Class
<?> Parent-first delegation without synchronizing onClassLoader.getClassLoadingLock(String)
.Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
MaskingClassLoader
-
MaskingClassLoader
-
-
Method Details
-
loadClass
Description copied from class:DelegatingClassLoader
Parent-first delegation without synchronizing onClassLoader.getClassLoadingLock(String)
. This prevents creation/retention of per-name lock objects in a loader that does not define classes. The defining loader downstream still serializes class definition as required.- Overrides:
loadClass
in classDelegatingClassLoader
- Parameters:
name
- The binary name of the classresolve
- Iftrue
then resolve the class- Returns:
- The resulting
Class
object - Throws:
ClassNotFoundException
- If the class could not be found
-
getResource
- Overrides:
getResource
in classClassLoader
-
getResources
- Overrides:
getResources
in classClassLoader
- Throws:
IOException
-