java.rmi.server
Class RemoteObjectInvocationHandler

java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteObjectInvocationHandler
- All Implemented Interfaces:
- java.lang.reflect.InvocationHandler, java.rmi.Remote, java.io.Serializable
- public class RemoteObjectInvocationHandler
- extends RemoteObject
- implements java.lang.reflect.InvocationHandler, java.rmi.Remote, java.io.Serializable
Together with dynamic proxy instance, this class replaces the generated RMI
stub (*_Stub) classes that (following 1.5 specification) should be no longer
required. It is unusual to use the instances of this class directly in the
user program. Such instances are automatically created and returned by
java.rmi.registry.Registry or UnicastRemoteObject methods if the remote
reference is known but the corresponding stub class is not accessible.
|
Field Summary |
(package private) static java.lang.Class[] |
anObjectC
The class array to define parameters of .equals |
(package private) static java.util.Hashtable |
methodHashCodes
The RMI method hash codes, computed once as described in the section 8.3
of the Java Remote Method Invocation (RMI) Specification. |
(package private) static java.lang.Object[] |
noArgs
The empty object array to replace null when no args are passed. |
(package private) static java.lang.Class[] |
noArgsC
The empty class array to define parameters of .hashCode and .toString. |
(package private) static long |
serialVersionUID
Use the jdk 1.5 SUID for interoperability. |
serialVersionUID
static final long serialVersionUID
- Use the jdk 1.5 SUID for interoperability.
- See Also:
- Constant Field Values
methodHashCodes
static java.util.Hashtable methodHashCodes
- The RMI method hash codes, computed once as described in the section 8.3
of the Java Remote Method Invocation (RMI) Specification.
noArgsC
static final java.lang.Class[] noArgsC
- The empty class array to define parameters of .hashCode and .toString.
anObjectC
static final java.lang.Class[] anObjectC
- The class array to define parameters of .equals
noArgs
static final java.lang.Object[] noArgs
- The empty object array to replace null when no args are passed.
RemoteObjectInvocationHandler
public RemoteObjectInvocationHandler(RemoteRef reference)
- Construct the remote invocation handler that forwards calls to the given
remote object.
invoke
public java.lang.Object invoke(java.lang.Object proxyInstance,
java.lang.reflect.Method method,
java.lang.Object[] parameters)
throws java.lang.Throwable
- Invoke the remote method. When the known method is invoked on a created RMI
stub proxy class, the call is delivered to this method and then transferred
to the
RemoteRef.invoke(Remote, Method, Object[], long) 55 of the
remote reference that was passed in constructor. The methods are handled as
following:
- The toString() method is delegated to the passed proxy instance.
- The .equals method only returns true if the passed object is an
instance of proxy class and its invocation handler is equal to this
invocation handles.
- The .hashCode returns the hashCode of this invocation handler (if the.
- All other methods are converted to remote calls and forwarded to the
remote reference.
- Specified by:
invoke in interface java.lang.reflect.InvocationHandler