Class java.rmi.server.StubClassLoader
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.rmi.server.StubClassLoader

java.lang.Object
   |
   +----java.lang.ClassLoader
           |
           +----java.rmi.server.StubClassLoader

public class StubClassLoader
extends ClassLoader
The StubClassLoader class is used by the RMI runtime to load stubs and skeletons needed by RMI. The usual ClassLoader interface is used to load classes.

To support the safety properties of the Java RMI runtime, the stub class loader always loads locally available classes. Only if the required stubs are not available and a security manager is in force will stubs be loaded from a network source.

A StubClassLoader can be found or created for a particular URL. The class loader keeps a cache of loaders for individual URLs and the classes that have been loaded from them. When a stub or skeleton is loaded, any class references that occur as parameters or returns will also be loaded from the same host.

Server processes must declare, to the RMI runtime, the location of the stubs that will be available to their clients. The property "java.rmi.server.StubClassBase" should be a URL from which stub classes and classes used by stubs will be loaded.


Method Index

 o getClassLoader(URL)
Get a class loader.
 o getLocalLoader()
If a security manager is present, find or create a class loader defined locally; if one cannot be found or created, null is returned and the caller should use class.forName() to resolve the class.
 o loadClass(String)
Load a class from this class loader.
 o loadClass(String, boolean)
Load and resolve a class.

Methods

 o getClassLoader
  public static synchronized StubClassLoader getClassLoader(URL codebase)
Get a class loader. If no security manager is defined, always throw a security exception
 o getLocalLoader
  public static synchronized StubClassLoader getLocalLoader() throws MalformedURLException
If a security manager is present, find or create a class loader defined locally; if one cannot be found or created, null is returned and the caller should use class.forName() to resolve the class. If a security exception is caught while creating the local stub loader the local loader is disabled, and null is returned everafter. The base directory can be specified in the property "java.rmi.server.StubClassBase"
 o loadClass
  public Class loadClass(String name) throws ClassNotFoundException
Load a class from this class loader.
 o loadClass
  protected Class loadClass(String name,
                            boolean resolve) throws ClassNotFoundException
Load and resolve a class. Only if there is security manager will it try to load from a URL.
Overrides:
loadClass in class ClassLoader

All Packages  Class Hierarchy  This Package  Previous  Next  Index