Top Description Constructors Methods
java.rmi.server

public abstract Class RMIClassLoaderSpi

extends Object
Class Inheritance
Imports
java.net.MalformedURLException, .URL

RMIClassLoaderSpi is the service provider interface for RMIClassLoader. In particular, an RMIClassLoaderSpi instance provides an implementation of the following static methods of RMIClassLoader: When one of those methods is invoked, its behavior is to delegate to a corresponding method on an instance of this class. The details of how each method delegates to the provider instance is described in the documentation for each particular method. See the documentation for RMIClassLoader for a description of how a provider instance is chosen.
Authors
Peter Jones, Laird Dornin
Since
1.4
See Also
RMIClassLoader

Constructor Summary

AccessConstructor and Description
public
RMIClassLoaderSpi()

Constructor for subclasses to call.

Method Summary

Modifier and TypeMethod and Description
public abstract String

Returns:

a string to be used to annotate the given class when it gets marshalled, or null
getClassAnnotation
(Class<?>
the class to obtain the annotation for
cl
)

Provides the implementation for RMIClassLoader#getClassAnnotation(Class).

public abstract ClassLoader

Returns:

a class loader that loads classes from the given codebase URL path
getClassLoader
(String
the list of URLs (space-separated) from which the returned class loader will load classes from, or null
codebase
)

Provides the implementation for RMIClassLoader#getClassLoader(String).

public abstract Class<?>

Returns:

the Class object representing the loaded class
loadClass
(String
the list of URLs (separated by spaces) to load the class from, or null
codebase
,
String
the name of the class to load
name
,
ClassLoader
additional contextual class loader to use, or null
defaultLoader
)

Provides the implementation for RMIClassLoader#loadClass(URL, String), RMIClassLoader#loadClass(String, String), and RMIClassLoader#loadClass(String, String, ClassLoader).

public abstract Class<?>

Returns:

a dynamic proxy class that implements the named interfaces
loadProxyClass
(String
the list of URLs (space-separated) to load classes from, or null
codebase
,
String[]
the names of the interfaces for the proxy class to implement
interfaces
,
ClassLoader
additional contextual class loader to use, or null
defaultLoader
)

Provides the implementation for RMIClassLoader#loadProxyClass(String, String[], ClassLoader).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RMIClassLoaderSpiback to summary
public RMIClassLoaderSpi()

Constructor for subclasses to call.

Method Detail

getClassAnnotationback to summary
public abstract String getClassAnnotation(Class<?> cl)

Provides the implementation for RMIClassLoader#getClassAnnotation(Class). Returns the annotation string (representing a location for the class definition) that RMI will use to annotate the class descriptor when marshalling objects of the given class.

Parameters
cl:Class<?>

the class to obtain the annotation for

Returns:String

a string to be used to annotate the given class when it gets marshalled, or null

Exceptions
NullPointerException:
if cl is null
getClassLoaderback to summary
public abstract ClassLoader getClassLoader(String codebase) throws MalformedURLException

Provides the implementation for RMIClassLoader#getClassLoader(String). Returns a class loader that loads classes from the given codebase URL path.

If there is a security manager, its checkPermission method will be invoked with a RuntimePermission("getClassLoader") permission; this could result in a SecurityException. The implementation of this method may also perform further security checks to verify that the calling context has permission to connect to all of the URLs in the codebase URL path.

Parameters
codebase:String

the list of URLs (space-separated) from which the returned class loader will load classes from, or null

Returns:ClassLoader

a class loader that loads classes from the given codebase URL path

Exceptions
MalformedURLException:
if codebase is non-null and contains an invalid URL, or if codebase is null and a provider-specific URL used to identify the class loader is invalid
SecurityException:
if there is a security manager and the invocation of its checkPermission method fails, or if the caller does not have permission to connect to all of the URLs in the codebase URL path
loadClassback to summary
public abstract Class<?> loadClass(String codebase, String name, ClassLoader defaultLoader) throws MalformedURLException, ClassNotFoundException

Provides the implementation for RMIClassLoader#loadClass(URL, String), RMIClassLoader#loadClass(String, String), and RMIClassLoader#loadClass(String, String, ClassLoader). Loads a class from a codebase URL path, optionally using the supplied loader. Typically, a provider implementation will attempt to resolve the named class using the given defaultLoader, if specified, before attempting to resolve the class from the codebase URL path.

An implementation of this method must either return a class with the given name or throw an exception.

Parameters
codebase:String

the list of URLs (separated by spaces) to load the class from, or null

name:String

the name of the class to load

defaultLoader:ClassLoader

additional contextual class loader to use, or null

Returns:Class<?>

the Class object representing the loaded class

Exceptions
MalformedURLException:
if codebase is non-null and contains an invalid URL, or if codebase is null and a provider-specific URL used to load classes is invalid
ClassNotFoundException:
if a definition for the class could not be found at the specified location
loadProxyClassback to summary
public abstract Class<?> loadProxyClass(String codebase, String[] interfaces, ClassLoader defaultLoader) throws MalformedURLException, ClassNotFoundException

Provides the implementation for RMIClassLoader#loadProxyClass(String, String[], ClassLoader). Loads a dynamic proxy class (see java.lang.reflect.Proxy that implements a set of interfaces with the given names from a codebase URL path, optionally using the supplied loader.

An implementation of this method must either return a proxy class that implements the named interfaces or throw an exception.

Parameters
codebase:String

the list of URLs (space-separated) to load classes from, or null

interfaces:String[]

the names of the interfaces for the proxy class to implement

defaultLoader:ClassLoader

additional contextual class loader to use, or null

Returns:Class<?>

a dynamic proxy class that implements the named interfaces

Exceptions
MalformedURLException:
if codebase is non-null and contains an invalid URL, or if codebase is null and a provider-specific URL used to load classes is invalid
ClassNotFoundException:
if a definition for one of the named interfaces could not be found at the specified location, or if creation of the dynamic proxy class failed (such as if java.lang.reflect.Proxy#getProxyClass(ClassLoader, Class[]) would throw an IllegalArgumentException for the given interface list)