Package org.glassfish.internal.api
Interface DelegatingClassLoader.ClassFinder
- Enclosing class:
DelegatingClassLoader
public static interface DelegatingClassLoader.ClassFinder
This interface is an optimization.
The findClass method of ClassLoader is usually a protected method.
Calling loadClass on a ClassLoader is expensive, as it searches
the delegation hierarchy before searching in its private space.
-
Method Summary
Modifier and TypeMethodDescriptionClass<?> Finds the class with the specified binary name.Class<?> findExistingClass(String name) Returns the loaded class with the given binary name.findResource(String name) Finds the resource with the given name.findResources(String name) Returns an enumeration of URL objects representing all resources with the given name.Returns the parent class loader.
-
Method Details
-
getParent
ClassLoader getParent()Returns the parent class loader.The parent class loader used to check delegation hierarchy.
- Returns:
- the parent classloader
- See Also:
-
findClass
Finds the class with the specified binary name.- Parameters:
name- the binary name of the class- Returns:
- the resulting
Classobject - Throws:
ClassNotFoundException- if class could not be found- See Also:
-
findExistingClass
Returns the loaded class with the given binary name.- Parameters:
name- the binary name of the class- Returns:
- the
Classobject, ornullif the class has not been loaded - See Also:
-
findResource
Finds the resource with the given name.- Parameters:
name- the resource name- Returns:
- a URL object for reading the resource, or
nullif the resource could not be found - See Also:
-
findResources
Returns an enumeration of URL objects representing all resources with the given name.- Parameters:
name- the resource name- Returns:
- an enumeration of URL objects for the resources
- Throws:
IOException- if an I/O error occurs- See Also:
-