|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
Autonomous sub-portion of a ClassWorld.
This class most closed maps to the ClassLoader
role from Java and in facts can provide a ClassLoader
view of itself using getClassLoader().
| Method Summary | |
void |
addConstituent(java.lang.String name,
byte[] b)
Adds a byte[] class definition as a constituent for locating classes. |
void |
addConstituent(java.net.URL constituent)
Add a constituent to this realm for locating classes. |
ClassRealm |
createChildRealm(java.lang.String id)
Create a child realm. |
java.util.Enumeration |
findResources(java.lang.String name)
|
java.lang.ClassLoader |
getClassLoader()
Retrieve the ClassLoader that models this
ClassRealm. |
java.lang.String |
getId()
Retrieve the id. |
java.net.URL |
getResource(java.lang.String name)
|
java.util.Enumeration |
getResources(java.lang.String name)
|
ClassWorld |
getWorld()
Retrieve the ClassWorld of which this is a member. |
void |
importFrom(java.lang.String realmId,
java.lang.String pkgName)
Import packages from another ClassRealm. |
java.lang.Class |
loadClass(java.lang.String name)
Load a class. |
void |
reload()
Reload all the constituents in the realm. |
void |
reload(boolean reloadParent)
Reload all the constituents in the realm. |
void |
setParent(ClassRealm classRealm)
Set the parent ClassRealm. |
| Method Detail |
public void addConstituent(java.lang.String name,
byte[] b)
throws java.lang.ClassNotFoundException
name - class nameb - the class definition as a byte[]
java.lang.ClassNotFoundExceptionpublic void addConstituent(java.net.URL constituent)
A constituent is a URL that points to either a JAR
format file containing classes and/or resources, or
a directory that should be used for searching. If
the constituent is a directory, then the URL must
end with a slash (/). Otherwise the
constituent will be treated as a JAR file.
constituent - URL to contituent jar or directory.public ClassRealm createChildRealm(java.lang.String id)
id - The name of child realm.
public java.util.Enumeration findResources(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.ClassLoader getClassLoader()
ClassLoader that models this
ClassRealm.
public java.lang.String getId()
public java.net.URL getResource(java.lang.String name)
public java.util.Enumeration getResources(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionpublic ClassWorld getWorld()
ClassWorld of which this is a member.
public void importFrom(java.lang.String realmId,
java.lang.String pkgName)
throws NoSuchRealmException
ClassRealm.
Specific packages can be imported from another realm instead of attempting to load them locally from this one. When importing a package a realm defers completely to the foreign realm to satisfy the package dependencies.
realmId - The realm id from which to import.pkgName - The package name to import.
NoSuchRealmException - If the id of the realm from which
to import does not correspond to a foreign realm within
this realm's world.
public java.lang.Class loadClass(java.lang.String name)
throws java.lang.ClassNotFoundException
name - The name of the class to load.
java.lang.ClassNotFoundException - If the class cannot be found.public void reload()
public void reload(boolean reloadParent)
reloadParent - Whether or not to reload the parent realm.public void setParent(ClassRealm classRealm)
ClassRealm.
classRealm - The parent ClassRealm.
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||