Class RMIClassLoaderSpi
java.lang.Object
java.rmi.server.RMIClassLoaderSpi
public abstract class RMIClassLoaderSpi extends Object
RMIClassLoaderSpi is the service provider interface for RMIClassLoader. In particular, an RMIClassLoaderSpi instance provides an implementation of the following static methods of RMIClassLoader: -
RMIClassLoader.loadClass(URL,String) -
RMIClassLoader.loadClass(String,String) -
RMIClassLoader.loadClass(String,String,ClassLoader) -
RMIClassLoader.loadProxyClass(String,String[],ClassLoader) -
RMIClassLoader.getClassLoader(String) -
RMIClassLoader.getClassAnnotation(Class)
RMIClassLoader for a description of how a provider instance is chosen.- Since:
- 1.4
- See Also:
Constructor Summary
| Constructor | Description |
|---|---|
RMIClassLoaderSpi() |
Constructor for subclasses to call. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
abstract String |
getClassAnnotation |
Provides the implementation for RMIClassLoader.getClassAnnotation(Class). |
abstract ClassLoader |
getClassLoader |
Provides the implementation for RMIClassLoader.getClassLoader(String). |
abstract Class |
loadClass |
Provides the implementation for RMIClassLoader.loadClass(URL,String), RMIClassLoader.loadClass(String,String), and RMIClassLoader.loadClass(String,String,ClassLoader). |
abstract Class |
loadProxyClass |
Provides the implementation for RMIClassLoader.loadProxyClass(String,String[],ClassLoader). |
Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | Modifier and Type | Method | Description |
|---|---|---|
protected Object |
clone() |
Creates and returns a copy of this object. |
boolean |
equals |
Indicates whether some other object is "equal to" this one. |
protected void |
finalize() |
Deprecated, for removal: This API element is subject to removal in a future version. Finalization is deprecated and subject to removal in a future release. |
final Class |
getClass() |
Returns the runtime class of this Object. |
int |
hashCode() |
Returns a hash code value for this object. |
final void |
notify() |
Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() |
Wakes up all threads that are waiting on this object's monitor. |
String |
toString() |
Returns a string representation of the object. |
final void |
wait() |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
Constructor Details
RMIClassLoaderSpi
public RMIClassLoaderSpi()
Constructor for subclasses to call.
Method Details
loadClass
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- the list of URLs (separated by spaces) to load the class from, ornull -
name- the name of the class to load -
defaultLoader- additional contextual class loader to use, ornull - Returns:
- the
Classobject representing the loaded class - Throws:
-
MalformedURLException- ifcodebaseis non-nulland contains an invalid URL, or ifcodebaseisnulland 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
loadProxyClass
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 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- the list of URLs (space-separated) to load classes from, ornull -
interfaces- the names of the interfaces for the proxy class to implement -
defaultLoader- additional contextual class loader to use, ornull - Returns:
- a dynamic proxy class that implements the named interfaces
- Throws:
-
MalformedURLException- ifcodebaseis non-nulland contains an invalid URL, or ifcodebaseisnulland 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 ifProxy.getProxyClass(ClassLoader,Class[])would throw anIllegalArgumentExceptionfor the given interface list)
getClassLoader
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.- Parameters:
-
codebase- the list of URLs (space-separated) from which the returned class loader will load classes from, ornull - Returns:
- a class loader that loads classes from the given codebase URL path
- Throws:
-
MalformedURLException- ifcodebaseis non-nulland contains an invalid URL, or ifcodebaseisnulland a provider-specific URL used to identify the class loader is invalid
getClassAnnotation
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- the class to obtain the annotation for - Returns:
- a string to be used to annotate the given class when it gets marshalled, or
null - Throws:
-
NullPointerException- ifclisnull
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.