Package org.jini.rio.core.jsb
Interface ComponentLoader
- All Known Implementing Classes:
CommonClassLoader
public interface ComponentLoader
The ComponentLoader provides a mechanism for the ServiceBean to load classes and resources (such
as native libraries) making them (and the resources it uses) available to all services
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(String name, URL[] urls) Registers a class name, and the code source which is used as the search path to load the class.Creates an Object which has been added to the ComponentLoader using the addSystemComponent method, or is in the classpath of the ComponentLoader.booleantestComponentExistence(String name) Test whether a named component (Class) exists.booleantestResourceExistence(String name) Test whether a named resource exists.
-
Method Details
-
load
Object load(String name) throws ClassNotFoundException, IllegalAccessException, InstantiationException Creates an Object which has been added to the ComponentLoader using the addSystemComponent method, or is in the classpath of the ComponentLoader. The Object is loaded from the registered code source.- Parameters:
name- The name of the class. The resulting class will be loaded and a new instance of the class created using a zero-arg contructor.- Throws:
IllegalAccessException- - If the Class or its nullary constructor is not accessible.InstantiationException- - If this Class represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason.ClassNotFoundException- - If the class cannot be located by the class loader or it has not been registered
-
addComponent
Registers a class name, and the code source which is used as the search path to load the class.- Parameters:
name- The name of the classurls- Codebase for the class identified by the name parameter
-
testComponentExistence
Test whether a named component (Class) exists.- Parameters:
name- The component name- Returns:
- true If the requested component can be located, false otherwise.
-
testResourceExistence
Test whether a named resource exists. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.The name of a resource is a '/ '-separated path name that identifies the resource.
- Parameters:
name- The resource name- Returns:
- true If the requested resource can be located, false otherwise.
-