|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | 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.net.URL constituent)
Add a constituent to this realm for locating classes. |
java.lang.ClassLoader |
getClassLoader()
Retrieve the ClassLoader that models this
ClassRealm . |
java.lang.String |
getId()
Retrieve the id. |
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. |
Method Detail |
public java.lang.String getId()
public 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.ClassLoader getClassLoader()
ClassLoader
that models this
ClassRealm
.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 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |