public class: RemoteObjectInvocationHandler
All Implemented Interfaces:
InvocationHandler, Remote, Serializable
An implementation of the
use with Java Remote Method Invocation (Java RMI). This invocation
handler can be used in conjunction with a dynamic proxy instance as a
replacement for a pregenerated stub class.
Applications are not expected to use this class directly. A remote
object exported to use a dynamic proxy with UnicastRemoteObject
or Activatable has an instance of this class as that proxy's
Ann - Wollrath
|Method from java.rmi.server.RemoteObjectInvocationHandler Summary:|
|Methods from java.lang.Object:|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait|
|Method from java.rmi.server.RemoteObjectInvocationHandler Detail:|
public Object invoke(Object proxy,
Object args) throws Throwable
Processes a method invocation made on the encapsulating
proxy, and returns the result.
RemoteObjectInvocationHandler implements this method
method is one of the following methods, it
is processed as described below:
- Object.hashCode : Returns the hash
code value for the proxy.
- Object.equals : Returns
if the argument (
args) is an instance of a dynamic
proxy class and this invocation handler is equal to the invocation
handler of that argument, and returns
- Object.toString : Returns a string
representation of the proxy.
Otherwise, a remote call is made as follows:
proxy is not an instance of the interface
Remote , then an IllegalArgumentException is thrown.
- Otherwise, the invoke method is invoked
on this invocation handler's
args, and the
method hash (defined in section 8.3 of the "Java Remote Method
Invocation (RMI) Specification") for
method, and the
result is returned.
- If an exception is thrown by
that exception is a checked exception that is not assignable to any
exception in the
throws clause of the method
implemented by the
proxy's class, then that exception
is wrapped in an UnexpectedException and the wrapped
exception is thrown. Otherwise, the exception thrown by
invoke is thrown by this method.
The semantics of this method are unspecified if the
arguments could not have been produced by an instance of some
valid dynamic proxy class containing this invocation handler.