public class MultiClassLoader extends ClassLoader
THREAD_LOADER
constant is a marker that will be replaced
with the context loader of the current thread.Modifier and Type | Field and Description |
---|---|
static ClassLoader |
SYSTEM_LOADER
The standard system class loader.
|
static ClassLoader |
THREAD_LOADER
Marker that will be replaced with the context loader of the current
thread whenever it is discovered in the class loader list.
|
Constructor and Description |
---|
MultiClassLoader()
Constructor; initializes the loader with an empty list of delegates.
|
MultiClassLoader(ClassLoader... loaders) |
MultiClassLoader(MultiClassLoader other)
Construct with the class loaders of another multi loader.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addClassLoader(ClassLoader loader)
Add the given class loader to the set of loaders that will be tried.
|
boolean |
addClassLoader(int index,
ClassLoader loader)
Add the given class loader at the specified index.
|
boolean |
addClassLoaders(int index,
MultiClassLoader multi)
Adds all class loaders from the given multi loader starting at the
given index.
|
boolean |
addClassLoaders(MultiClassLoader multi)
Adds all the class loaders from the given multi loader.
|
void |
clear()
Clear the list of class loaders.
|
boolean |
containsClassLoader(ClassLoader loader)
Returns true if the list contains the given class loader or marker.
|
boolean |
equals(Object other) |
protected Class<?> |
findClass(String name) |
protected URL |
findResource(String name) |
protected Enumeration<URL> |
findResources(String name) |
ClassLoader |
getClassLoader(int index)
Return the class loader at the given index.
|
ClassLoader[] |
getClassLoaders()
Return an array of all contained class loaders.
|
int |
hashCode() |
boolean |
isEmpty()
Return true if there are no internal class laoders.
|
boolean |
removeClassLoader(ClassLoader loader)
Remove the given loader from the list.
|
void |
setClassLoaders(MultiClassLoader multi)
Set the class loaders of this loader to those of the given loader.
|
int |
size()
Return the number of internal class loaders.
|
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 static final ClassLoader THREAD_LOADER
public static final ClassLoader SYSTEM_LOADER
public MultiClassLoader()
public MultiClassLoader(MultiClassLoader other)
public MultiClassLoader(ClassLoader... loaders)
public boolean containsClassLoader(ClassLoader loader)
public ClassLoader[] getClassLoaders()
public ClassLoader getClassLoader(int index)
public boolean addClassLoader(ClassLoader loader)
public boolean addClassLoader(int index, ClassLoader loader)
public void setClassLoaders(MultiClassLoader multi)
public boolean addClassLoaders(int index, MultiClassLoader multi)
public boolean addClassLoaders(MultiClassLoader multi)
public boolean removeClassLoader(ClassLoader loader)
public void clear()
public int size()
public boolean isEmpty()
protected 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
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.