edu.rice.cs.util.classloader
Class LimitingClassLoader
java.lang.Object
|
+--java.lang.ClassLoader
|
+--edu.rice.cs.util.classloader.LimitingClassLoader
- public class LimitingClassLoader
- extends ClassLoader
A class loader that does nothing but allow, at runtime,
classes to be put on a list of "do not load" classes,
which will be rejected from loading, even if they are available.
- Version:
- $Id: LimitingClassLoader.java,v 1.3 2002/02/08 14:22:22 brianstoler Exp $
Fields inherited from class java.lang.ClassLoader |
bootstrapClassPath, classes, defaultDomain, defaultPermissions, getClassLoaderPerm, initialized, loadedLibraryNames, nativeLibraries, nativeLibraryContext, nocerts, package2certs, packages, parent, scl, sclSet, sys_paths, systemNativeLibraries, usr_paths |
Methods inherited from class java.lang.ClassLoader |
, addClass, check, checkCerts, checkPackageAccess, compareCerts, copyFrom, defineClass, defineClass, defineClass, defineClass0, definePackage, findBootstrapClass, findBootstrapClass0, findClass, findLibrary, findLoadedClass, findNative, findResource, findResources, findSystemClass, getBootstrapClassPath, getBootstrapResource, getBootstrapResources, getCallerClassLoader, getDefaultDomain, getGetClassLoaderPerm, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, initializePath, isAncestor, loadClass, loadClassInternal, loadLibrary, loadLibrary0, removeSystemClassLoader, resolveClass, resolveClass0, setSigners |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
_restrictedList
private List _restrictedList
LimitingClassLoader
public LimitingClassLoader(ClassLoader parent)
- Creates a LimitingClassLoader.
- Parameters:
parent
- Parent class loader, which is used to load all classes
not restricted from loading.
addToRestrictedList
public void addToRestrictedList(String name)
clearRestrictedList
public void clearRestrictedList()
loadClass
protected Class loadClass(String name,
boolean resolve)
throws ClassNotFoundException
- Overrides
ClassLoader.loadClass(String,boolean)
to
reject classes whose names are on the restricted list.
- Overrides:
loadClass
in class ClassLoader
- Parameters:
name
- Name of class to loadresolve
- If true then resolve the class- Returns:
Class
object for the loaded class- Throws:
ClassNotFoundException
- if name is on the restricted list,
or if the parent class loader couldn't
find the class.