|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ClassLoader
com.thoughtworks.xstream.core.util.CompositeClassLoader
public class CompositeClassLoader
ClassLoader that is composed of other classloaders. Each loader will be used to try to load the particular class, until one of them succeeds. Note: The loaders will always be called in the REVERSE order they were added in.
The Composite class loader also has registered the classloader that loaded xstream.jar and (if available) the thread's context classloader.
CompositeClassLoader loader = new CompositeClassLoader();
loader.add(MyClass.class.getClassLoader());
loader.add(new AnotherClassLoader());
loader.loadClass("com.blah.ChickenPlucker");
The above code will attempt to load a class from the following classloaders (in order):
| Constructor Summary | |
|---|---|
CompositeClassLoader()
|
|
| Method Summary | |
|---|---|
void |
add(java.lang.ClassLoader classLoader)
Add a loader to the n |
java.lang.Class |
loadClass(java.lang.String name)
|
| Methods inherited from class java.lang.ClassLoader |
|---|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeClassLoader()
| Method Detail |
|---|
public void add(java.lang.ClassLoader classLoader)
classLoader -
public java.lang.Class loadClass(java.lang.String name)
throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoaderjava.lang.ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||