java.rmi.server
Class RMIClassLoader
java.lang.Object
|
+--java.rmi.server.RMIClassLoader
- public class RMIClassLoader
- extends java.lang.Object
RMIClassLoader
provides static methods for loading classes
from a network location (one or more URLs) and obtaining the location
from which an existing class can be loaded. These methods are used by
the RMI runtime when marshalling and unmarshalling classes of parameters
and return values.
- Since:
- JDK1.1
Method Summary |
static java.lang.String |
getClassAnnotation(java.lang.Class cl)
Returns the class annotation (representing the location for
a class) that RMI will use to annotate the call stream when
marshalling objects of the given class. |
static java.lang.ClassLoader |
getClassLoader(java.lang.String codebase)
Returns a class loader that loads classes from the given codebase URL
path. |
static java.lang.Class |
loadClass(java.lang.String codebase,
java.lang.String name)
Loads a class from a codebase URL path. |
static java.lang.Class |
loadClass(java.net.URL codebase,
java.lang.String name)
Loads a class from a codebase URL. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
loadClass
public static java.lang.Class loadClass(java.net.URL codebase,
java.lang.String name)
throws java.net.MalformedURLException,
java.lang.ClassNotFoundException
- Loads a class from a codebase URL. If the given codebase is
null
, then the Class
object returned is
equivalent to the Class
object returned by
RMIClassLoader.loadClass(name)
.
- Parameters:
codebase
- the URL to load the class fromname
- the name of the class to load- Returns:
- the
Class
object representing the loaded class - Throws:
- java.net.MalformedURLException - if the
codebase
paramater
contains an invalid non-null URL- java.lang.ClassNotFoundException - if a definition for the class could not
be found at the specified URL
- Since:
- JDK1.1
loadClass
public static java.lang.Class loadClass(java.lang.String codebase,
java.lang.String name)
throws java.net.MalformedURLException,
java.lang.ClassNotFoundException
- Loads a class from a codebase URL path. If the given codebase is
null
, then the Class
object returned is
equivalent to the Class
object returned by
RMIClassLoader.loadClass(name)
.
- Parameters:
codebase
- the list of space-separated URLs to load the class fromname
- the name of the class to load- Returns:
- the
Class
object representing the loaded class - Throws:
- java.net.MalformedURLException - if the
codebase
paramater
contains an invalid non-null URL- java.lang.ClassNotFoundException - if a definition for the class could not
be found at the specified location
- Since:
- 1.2
getClassLoader
public static java.lang.ClassLoader getClassLoader(java.lang.String codebase)
throws java.net.MalformedURLException,
java.lang.SecurityException
- Returns a class loader that loads classes from the given codebase URL
path. The class loader returned is the class loader that the
#loadClass(String,String)
method would use to load classes
from the given codebase. If a class loader with the same codebase URL
path already exists for RMI runtime, it will be returned; otherwise, a
new class loader will be created. If the given codebase is null, it
returns the class loader used to load classes via the
#loadClass(String)
method.
- Parameters:
codebase
- the list of space-separated URLs which the
the class loader will load classes from- Returns:
- a class loader that loads classes from the given codebase URL
path
- Throws:
- java.net.MalformedURLException - if the
codebase
paramater
contains an invalid non-null URL- java.lang.SecurityException - if the caller does not have permission to
connect to all of the URLs in
codebase
URL path - Since:
- 1.3
getClassAnnotation
public static java.lang.String getClassAnnotation(java.lang.Class cl)
- Returns the class annotation (representing the location for
a class) that RMI will use to annotate the call stream when
marshalling objects of the given class.
- Parameters:
cl
- the class to obtain the annotation for- Returns:
- a string to be used to annotate the class when marshalled
- Since:
- 1.2
Java is a trademark or registred trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo, Alto, California, 94303, U.S.A All Rights Reserved. < /font >