public class DelegatingClassLoader extends ClassLoader
Modifier and Type | Class and Description |
---|---|
static interface |
DelegatingClassLoader.ClassFinder
findClass method of ClassLoader is usually a protected method.
|
Constructor and Description |
---|
DelegatingClassLoader(ClassLoader parent) |
DelegatingClassLoader(ClassLoader parent,
List<DelegatingClassLoader.ClassFinder> delegates) |
Modifier and Type | Method and Description |
---|---|
boolean |
addDelegate(DelegatingClassLoader.ClassFinder d)
Adds a ClassFinder to list of delegates.
|
Class<?> |
findClass(String name) |
protected URL |
findResource(String name) |
protected Enumeration<URL> |
findResources(String name) |
List<DelegatingClassLoader.ClassFinder> |
getDelegates() |
String |
getName() |
boolean |
removeDelegate(DelegatingClassLoader.ClassFinder d)
Removes a ClassFinder from list of delegates.
|
void |
setName(String name) |
String |
toString() |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public DelegatingClassLoader(ClassLoader parent, List<DelegatingClassLoader.ClassFinder> delegates) throws IllegalArgumentException
IllegalArgumentException
- when the delegate does not have same parent
as this classloader.public DelegatingClassLoader(ClassLoader parent)
public boolean addDelegate(DelegatingClassLoader.ClassFinder d) throws IllegalStateException, IllegalArgumentException
d
- ClassFinder to add to the list of delegatesIllegalStateException
- when this method is called after the
classloader has been used to load any class.IllegalArgumentException
- when the delegate does not have same parent
as this classloader.public boolean removeDelegate(DelegatingClassLoader.ClassFinder d)
d
- ClassFinder to remove from the list of delegatesIllegalStateException
- when this method is called after the
classloader has been used to load any class.public Class<?> findClass(String name) throws ClassNotFoundException
findClass
in class ClassLoader
ClassNotFoundException
protected URL findResource(String name)
findResource
in class ClassLoader
protected Enumeration<URL> findResources(String name) throws IOException
findResources
in class ClassLoader
IOException
public String getName()
public void setName(String name)
public List<DelegatingClassLoader.ClassFinder> getDelegates()
Copyright © 2021. All rights reserved.