public class ClassRealm extends URLClassLoader
Constructor and Description |
---|
ClassRealm(ClassWorld world,
String id,
ClassLoader baseClassLoader)
Creates a new class realm.
|
close, definePackage, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public ClassRealm(ClassWorld world, String id, ClassLoader baseClassLoader)
world
- The class world this realm belongs to, must not be null
.id
- The identifier for this realm, must not be null
.baseClassLoader
- The base class loader for this realm, may be null
to use the bootstrap class
loader.public String getId()
public ClassWorld getWorld()
public void importFromParent(String packageName)
public void importFrom(String realmId, String packageName) throws NoSuchRealmException
NoSuchRealmException
public void importFrom(ClassLoader classLoader, String packageName)
public ClassLoader getImportClassLoader(String name)
public Collection<ClassRealm> getImportRealms()
public Strategy getStrategy()
public void setParentClassLoader(ClassLoader parentClassLoader)
public ClassLoader getParentClassLoader()
public void setParentRealm(ClassRealm realm)
public ClassRealm getParentRealm()
public ClassRealm createChildRealm(String id) throws DuplicateRealmException
DuplicateRealmException
public void addURL(URL url)
addURL
in class URLClassLoader
public Class<?> loadClass(String name) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
protected Class<?> findClass(String name) throws ClassNotFoundException
findClass
in class URLClassLoader
ClassNotFoundException
public URL getResource(String name)
getResource
in class ClassLoader
public URL findResource(String name)
findResource
in class URLClassLoader
public Enumeration<URL> getResources(String name) throws IOException
getResources
in class ClassLoader
IOException
public Enumeration<URL> findResources(String name) throws IOException
findResources
in class URLClassLoader
IOException
public void display()
public void display(PrintStream out)
public Enumeration<URL> loadResourcesFromImport(String name)
public Enumeration<URL> loadResourcesFromSelf(String name)
public Enumeration<URL> loadResourcesFromParent(String name)
Copyright © 2002–2014 Codehaus. All rights reserved.