org.codehaus.classworlds
Class DefaultClassRealm
java.lang.Object
org.codehaus.classworlds.DefaultClassRealm
- All Implemented Interfaces:
- ClassRealm
public class DefaultClassRealm
- extends Object
- implements ClassRealm
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultClassRealm
public DefaultClassRealm(ClassWorld world,
String id)
DefaultClassRealm
public DefaultClassRealm(ClassWorld world,
String id,
ClassLoader foreignClassLoader)
getConstituents
public URL[] getConstituents()
- Specified by:
getConstituents
in interface ClassRealm
getParent
public ClassRealm getParent()
- Specified by:
getParent
in interface ClassRealm
setParent
public void setParent(ClassRealm parent)
- Specified by:
setParent
in interface ClassRealm
getId
public String getId()
- Specified by:
getId
in interface ClassRealm
getWorld
public ClassWorld getWorld()
- Specified by:
getWorld
in interface ClassRealm
importFrom
public void importFrom(String realmId,
String packageName)
throws NoSuchRealmException
- Specified by:
importFrom
in interface ClassRealm
- Throws:
NoSuchRealmException
addConstituent
public void addConstituent(URL constituent)
- Specified by:
addConstituent
in interface ClassRealm
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?
- Parameters:
constituent
- class nameb
- the class definition as a byte[]
- Throws:
ClassNotFoundException
locateSourceRealm
public ClassRealm locateSourceRealm(String classname)
- Specified by:
locateSourceRealm
in interface ClassRealm
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interface ClassRealm
createChildRealm
public ClassRealm createChildRealm(String id)
throws DuplicateRealmException
- Specified by:
createChildRealm
in interface ClassRealm
- Throws:
DuplicateRealmException
loadClass
public Class loadClass(String name)
throws ClassNotFoundException
- Specified by:
loadClass
in interface ClassRealm
- Throws:
ClassNotFoundException
getResource
public URL getResource(String name)
- Specified by:
getResource
in interface ClassRealm
getResourceAsStream
public InputStream getResourceAsStream(String name)
- Specified by:
getResourceAsStream
in interface ClassRealm
findResources
public Enumeration findResources(String name)
throws IOException
- Specified by:
findResources
in interface ClassRealm
- Throws:
IOException
display
public void display()
- Specified by:
display
in interface ClassRealm
Copyright © 2002-2012 Codehaus. All Rights Reserved.