Package hudson.util
Class MaskingClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- hudson.util.MaskingClassLoader
-
public class MaskingClassLoader extends ClassLoader
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
Constructors Constructor Description MaskingClassLoader(ClassLoader parent, String... masks)
MaskingClassLoader(ClassLoader parent, Collection<String> masks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(String prefix)
URL
getResource(String name)
Enumeration<URL>
getResources(String name)
protected Class<?>
loadClass(String name, boolean resolve)
-
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 Detail
-
MaskingClassLoader
public MaskingClassLoader(ClassLoader parent, String... masks)
-
MaskingClassLoader
public MaskingClassLoader(ClassLoader parent, Collection<String> masks)
-
-
Method Detail
-
loadClass
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
getResource
public URL getResource(String name)
- Overrides:
getResource
in classClassLoader
-
getResources
public Enumeration<URL> getResources(String name) throws IOException
- Overrides:
getResources
in classClassLoader
- Throws:
IOException
-
add
public void add(String prefix)
-
-