|
Voyager ORB | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.ClassLoader | +--com.objectspace.voyager.loader.VoyagerClassLoader
VoyagerClassLoader is the default class loader, and supports custom loading of resources such as classes and proxies.
A VoyagerClassLoader maintains a list of prioritized resource loaders that implement IResourceLoader. If a resource cannot be found in the local CLASSPATH, each loader is sent getResourceAsStream( name ), starting at the loader with the highest priority. If two or more resource loaders are added at the same priority level, they are consulted in the order they were added.
The dynamic proxy generator implements IResourceLoader and is automatically installed at priority 5.
Method Summary | |
static IResourceLoader |
addResourceLoader(IResourceLoader resource)
Add a resource loader of priority 10 to my list of loaders. |
static IResourceLoader |
addResourceLoader(IResourceLoader resource,
float priority)
If the specified resource loader is not already in my list of loaders, add it at the specified priority and return it, otherwise return the existing loader. |
static void |
addURLResource(java.lang.String url)
Add a loader that obtains resources from the specified URL. |
java.io.InputStream |
getLocalResourceAsStream(java.lang.String name)
Searches all installed resource loaders for the resource name specified. |
java.net.URL |
getResource(java.lang.String name)
Return a URL for the requested resource. |
java.io.InputStream |
getResourceAsStream(java.lang.String name)
Return an InputStream containing the bytes for the requested resource. |
static boolean |
isResourceLoadingEnabled()
Return true if resource loading is enabled. |
protected java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
Load the specifed class, resolving if necessary. |
static java.lang.Class |
loadClass(java.lang.String url,
java.lang.String classname)
This method is used for bootstrapping clients via the VoyagerClassLoader. |
static boolean |
removeResourceLoader(IResourceLoader resource)
If the specified resource loader is in my list of loaders, remove it and return true, otherwise return false. |
static void |
setResourceLoadingEnabled(boolean flag)
If the flag is true, enable resource loading. |
Methods inherited from class java.lang.ClassLoader |
defineClass,
defineClass,
defineClass,
definePackage,
findClass,
findLibrary,
findLoadedClass,
findResource,
findResources,
findSystemClass,
getPackage,
getPackages,
getParent,
getResources,
getSystemClassLoader,
getSystemResource,
getSystemResourceAsStream,
getSystemResources,
loadClass,
resolveClass,
setSigners |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public static IResourceLoader addResourceLoader(IResourceLoader resource)
resource
- The resource loader.public static IResourceLoader addResourceLoader(IResourceLoader resource, float priority)
resource
- The resource loader.priority
- The search priority.public static boolean removeResourceLoader(IResourceLoader resource)
resource
- The resource loader.public static void setResourceLoadingEnabled(boolean flag)
flag
- The new setting.public static boolean isResourceLoadingEnabled()
public static void addURLResource(java.lang.String url) throws java.net.MalformedURLException
url
- The URL to search when loading resources.public static java.lang.Class loadClass(java.lang.String url, java.lang.String classname) throws java.net.MalformedURLException, java.lang.ClassNotFoundException
url
- The url of the "codebase" from which the class can be loaded.classname
- The fully qualified name of the class to load.protected java.lang.Class loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
name
- The full name of the class to load.resolve
- If true, resolve immediately.public java.net.URL getResource(java.lang.String name)
name
- The filename, including path, of a particular resource.public java.io.InputStream getResourceAsStream(java.lang.String name)
name
- The full filename of a particular resource.public java.io.InputStream getLocalResourceAsStream(java.lang.String name)
|
ObjectSpace Inc. | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |