|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JavaClassLoader
Represents an internal ClassLoader structure within a Java Virtual Machine instance.
For most ClassLoaders there is a corresponding ClassLoader
instance within with JavaRuntime. For primordial class loaders such as
the bootstrap class loader, there may or may not be a corresponding
ClassLoader
instance.
Since Java does not define any strict inheritance structure between
class loaders, there are no APIs for inspecting 'child' or 'parent'
class loaders. This information may be inferred by inspecting the
corresponding ClassLoader
instance:
pseudo javacode example
JavaClassLoader loader; JavaObject instance=loader.getObject(); String classLoaderName=instance.getJavaClass().getName();
ClassLoader
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
JavaClass |
findClass(java.lang.String name)
Find a class by name within this class loader. |
java.util.List<JavaClass> |
getCachedClasses()
When a ClassLoader successfully delegates a findClass() request to another ClassLoader, the result of the delegation must be cached within the internal structure so that the Java Virtual Machine does not make repeated requests for the same class. |
java.util.List<JavaClass> |
getDefinedClasses()
Get the set of classes which are defined in this JavaClassLoader. |
JavaObject |
getObject()
Get the ClassLoader instance (represented by a JavaObject
associated with this class loader. |
int |
hashCode()
|
Method Detail |
---|
java.util.List<JavaClass> getDefinedClasses()
Get the set of classes which are defined in this JavaClassLoader.
Calling the JavaClass.getClassLoader()
method on objects returned in this list will
return this JavaClassLoader
The returned list follows the standard semantics for javax.tools.diagnostics collections.
The returned value is never null but can be an empty list.
JavaClass
java.util.List<JavaClass> getCachedClasses()
When a ClassLoader successfully delegates a findClass() request to another ClassLoader, the result of the delegation must be cached within the internal structure so that the Java Virtual Machine does not make repeated requests for the same class.
The contents of the returned list is a superset of that returned bygetDefinedClasses()
The returned list follows the standard semantics for javax.tools.diagnostics collections.
The returned value is never null but can be an empty list.
JavaClass
JavaClass findClass(java.lang.String name) throws CorruptDataException
Find a class by name within this class loader. The class may have been defined in this class loader, or this class loader may have delegated the load to another class loader and cached the result.
The form of the name presented to this method should be as follows
[ packagenamepart / ... ] (classname ) [ $innerclassname ...]
Examples
name
- of the class to find. Packages should be separated by
'/' instead of '.'
CorruptDataException
- if the underlying data is in an unexpected stateJavaObject getObject() throws CorruptDataException
ClassLoader
instance (represented by a JavaObject
associated with this class loader. If there is no associated class loader, for example the
system class loader , then null will be returned.
Further examination of the returned object is implementation specific.
ClassLoader
instance
CorruptDataException
- if the underlying data is in an unexpected stateJavaObject
,
ClassLoader
boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
-
int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |