Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

Copyright © 2006 Sun Microsystems, Inc. All rights reserved.

J2ME RMI Optional Package

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
 

Method Detail

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 codebase is null, then the value of the system property java.rmi.server.codebase is used in place of the given codebase.
Parameters:
codebase - the URL to load the class from
name - 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 codebase is null, then the value of the system property java.rmi.server.codebase is used as the URL path.
Parameters:
codebase - the list of space-separated URLs to load the class from
name - 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 for the same codebase argument. If a class loader for the same codebase URL path already exists for RMI runtime, it will be returned; otherwise, a new class loader will be created.

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

J2ME RMI Optional Package

Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

For more information, please consult the JSR 66 specification.