|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.jini.rio.boot.CommonClassLoader
public class CommonClassLoader
The CommonClassLoader implements ComponentLoader
interface and is created by the
RioServiceDescriptor
or
RioActivatableServiceDescriptor
when starting a Rio
service and contains common declared platform JARs to be made available to its
children.
The CommonClassLoader enables a platform oriented framework conducive towards creating a layered product. The resulting capabilities allow the declaration of JARs that are added to the CommonClassLoader, making the classes accessible by all ClassLoader instances which delegate to the CommonClassLoader. In this fashion a platform can be declared, initialized and made available.
The ClassLoader hierarchy when starting a Rio service is as follows :
AppCL | CommonClassLoader + | +-------+-------+----...---+ | | | Service-1CL Service-2CL Service-nCL |
Method Summary | |
---|---|
void |
addCommonJARs(URL[] jars)
Add common JARs |
void |
addComponent(String name,
URL[] urls)
Registers a class name, and the code source which is used as the search path to load the class. |
static CommonClassLoader |
getInstance()
Get an instance of the CommonCLassLoader |
URL[] |
getURLs()
Override getURLs to ensure when an Object is marshalled its annotation is correct |
Object |
load(String name)
Creates an Object which has been added to the ComponentLoader using the addSystemComponent method, or is in the classpath of the ComponentLoader. |
boolean |
testComponentExistence(String name)
Test whether a named component (Class) exists. |
boolean |
testResourceExistence(String name)
Test whether a named resource exists. |
String |
toString()
Returns a string representation of this class loader. |
Methods inherited from class java.net.URLClassLoader |
---|
addURL, definePackage, findClass, findResource, findResources, getPermissions, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
---|
defineClass, defineClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static CommonClassLoader getInstance()
public URL[] getURLs()
getURLs
in class URLClassLoader
public boolean testComponentExistence(String name)
ComponentLoader
testComponentExistence
in interface ComponentLoader
name
- The component name
ComponentLoader.testComponentExistence(java.lang.String)
public void addCommonJARs(URL[] jars)
jars
- Array of URLspublic boolean testResourceExistence(String name)
ComponentLoader
The name of a resource is a '/ '-separated path name that identifies the resource.
testResourceExistence
in interface ComponentLoader
name
- The resource name
ComponentLoader.testResourceExistence(java.lang.String)
public void addComponent(String name, URL[] urls)
ComponentLoader
addComponent
in interface ComponentLoader
name
- The name of the classurls
- Codebase for the class identified by the name parameterComponentLoader.addComponent(java.lang.String, java.net.URL[])
public Object load(String name) throws ClassNotFoundException, IllegalAccessException, InstantiationException
ComponentLoader
load
in interface ComponentLoader
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.
ClassNotFoundException
- - If the class cannot be located by the
class loader or it has not been registered
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.ComponentLoader.load(java.lang.String)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |