org.codehaus.classworlds
Class DefaultClassRealm
java.lang.Object
org.codehaus.classworlds.DefaultClassRealm
- ClassRealm
public class DefaultClassRealm
extends java.lang.Object
Implementation of
ClassRealm
. The realm is the class loading gateway.
The search is proceded as follows:
- Search the parent class loader (passed via the constructor) if there
is one.
- Search the imports.
- Search this realm's constituents.
- Search the parent realm.
$Id: DefaultClassRealm.java 126 2006-01-12 04:17:51Z $
DefaultClassRealm
public DefaultClassRealm(ClassWorld world,
String id)
DefaultClassRealm
public DefaultClassRealm(ClassWorld world,
String id,
ClassLoader foreignClassLoader)
addConstituent
public void addConstituent(String constituent,
byte[] b)
throws ClassNotFoundException
Adds a byte[] class definition as a constituent for locating classes.
Currently uses BytesURLStreamHandler to hold a reference of the byte[] in memory.
This ensures we have a unifed URL resource model for all constituents.
The code to cache to disk is commented out - maybe a property to choose which method?
constituent
- class nameb
- the class definition as a byte[]
loadClass
public Class loadClass(String name)
throws ClassNotFoundException
- loadClass in interface ClassRealm