-
public interface JavaClassLoaderRepresents an internal ClassLoader structure within a Java VM instance. For most ClassLoaders there is a corresponding
java.lang.ClassLoaderobject within with JavaRuntime. For primordial class loaders such as the bootstrap class loader, there may or may not be a correspondingjava.lang.ClassLoaderinstance.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
java.lang.ClassLoaderinstance.- See Also:
ClassLoader
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanequals(Object obj)Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.JavaClassfindClass(String name)Find a named class within this class loader.IteratorgetCachedClasses()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 VM does not make repeated requests for the same class.IteratorgetDefinedClasses()Get the set of classes which are defined in this JavaClassLoader.JavaObjectgetObject()Get the java.lang.ClassLoader instance associated with this class loader.inthashCode()Answers an integer hash code for the receiver.
-
-
-
Method Detail
-
getDefinedClasses
Iterator getDefinedClasses()
Get the set of classes which are defined in this JavaClassLoader.- Returns:
- an iterator over the collection of classes which are defined in this JavaClassLoader
- See Also:
JavaClass,CorruptData
-
getCachedClasses
Iterator 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 VM does not make repeated requests for the same class.- Returns:
- an iterator over the collection of classes which are defined in this JavaClassLoader or which were found by delegation to other JavaClassLoaders
- See Also:
JavaClass,CorruptData
-
findClass
JavaClass findClass(String name) throws CorruptDataException
Find a named class 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.- Parameters:
name- of the class to find. Packages should be separated by '/' instead of '.'- Returns:
- the JavaClass instance, or null if it is not found
- Throws:
CorruptDataException
-
getObject
JavaObject getObject() throws CorruptDataException
Get the java.lang.ClassLoader instance associated with this class loader.- Returns:
- a JavaObject representing the java.lang.ClassLoader instance associated with this class loader, or null if there is no Java class loader associated with this low-level class loader.
- Throws:
CorruptDataException- See Also:
JavaObject,ClassLoader
-
equals
boolean equals(Object obj)
Description copied from class:ObjectCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison. The implementation in Object answers true only if the argument is the exact same object as the receiver (==).- Overrides:
equalsin classObject- Parameters:
obj-- Returns:
- True if the given object refers to the same Java Class Loader in the image
- See Also:
Object.hashCode()
-
hashCode
int hashCode()
Description copied from class:ObjectAnswers an integer hash code for the receiver. Any two objects which answertruewhen passed to.equalsmust answer the same value for this method.- Overrides:
hashCodein classObject- Returns:
- the receiver's hash.
- See Also:
Object.equals(java.lang.Object)
-
-