Top Description Fields Constructors Methods
com.sun.istack.tools

public Class MaskingClassLoader

extends ClassLoader
Class Inheritance
Imports
java.util.Collection

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

Field Summary

Modifier and TypeField and Description
private final String[]

Constructor Summary

AccessConstructor and Description
public
public
public
public

Method Summary

Modifier and TypeMethod and Description
protected synchronized Class<?>
loadClass(String name, boolean resolve)

Overrides java.lang.ClassLoader.loadClass.

Loads the class with the specified binary name.

Inherited from java.lang.ClassLoader:
clearAssertionStatusdefineClassdefineClassdefineClassdefineClassdefinePackagefindClassfindClassfindLibraryfindLoadedClassfindResourcefindResourcefindResourcesfindSystemClassgetClassLoadingLockgetDefinedPackagegetDefinedPackagesgetNamegetPackagegetPackagesgetParentgetPlatformClassLoadergetResourcegetResourceAsStreamgetResourcesgetSystemClassLoadergetSystemResourcegetSystemResourceAsStreamgetSystemResourcesgetUnnamedModuleisRegisteredAsParallelCapableloadClassregisterAsParallelCapableresolveClassresourcessetClassAssertionStatussetDefaultAssertionStatussetPackageAssertionStatussetSigners

Field Detail

masksback to summary
private final String[] masks

Constructor Detail

MaskingClassLoaderback to summary
public MaskingClassLoader(String... masks)
MaskingClassLoaderback to summary
public MaskingClassLoader(Collection<String> masks)
MaskingClassLoaderback to summary
public MaskingClassLoader(ClassLoader parent, String... masks)
MaskingClassLoaderback to summary
public MaskingClassLoader(ClassLoader parent, Collection<String> masks)

Method Detail

loadClassback to summary
protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException

Overrides java.lang.ClassLoader.loadClass.

Doc from java.lang.ClassLoader.loadClass.

Loads the class with the specified binary name. The default implementation of this method searches for classes in the following order:

  1. Invoke findLoadedClass(String) to check if the class has already been loaded.

  2. Invoke the loadClass method on the parent class loader. If the parent is null the class loader built into the virtual machine is used, instead.

  3. Invoke the findClass(String) method to find the class.

If the class was found using the above steps, and the resolve flag is true, this method will then invoke the resolveClass(Class) method on the resulting Class object.

Subclasses of ClassLoader are encouraged to override findClass(String), rather than this method.

Unless overridden, this method synchronizes on the result of getClassLoadingLock method during the entire class loading process.

Annotations
@Override
Exceptions
ClassNotFoundException:
If the class could not be found