java.rmi.server
Class RemoteObjectInvocationHandler

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.rmi.server.RemoteObject sample code for java.rmi.server.RemoteObject definition code for java.rmi.server.RemoteObject 
      extended by java.rmi.server.RemoteObjectInvocationHandler
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , InvocationHandler sample code for java.lang.reflect.InvocationHandler definition code for java.lang.reflect.InvocationHandler , Remote sample code for java.rmi.Remote definition code for java.rmi.Remote

public class RemoteObjectInvocationHandler
extends RemoteObject sample code for java.rmi.server.RemoteObject definition code for java.rmi.server.RemoteObject
implements InvocationHandler sample code for java.lang.reflect.InvocationHandler definition code for java.lang.reflect.InvocationHandler

An implementation of the InvocationHandler interface for 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 sample code for java.rmi.server.UnicastRemoteObject definition code for java.rmi.server.UnicastRemoteObject or Activatable sample code for java.rmi.activation.Activatable definition code for java.rmi.activation.Activatable has an instance of this class as that proxy's invocation handler.

Since:
1.5
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject sample code for java.rmi.server.RemoteObject definition code for java.rmi.server.RemoteObject
ref sample code for java.rmi.server.RemoteObject.ref definition code for java.rmi.server.RemoteObject.ref
 
Constructor Summary
RemoteObjectInvocationHandler sample code for java.rmi.server.RemoteObjectInvocationHandler.RemoteObjectInvocationHandler(java.rmi.server.RemoteRef) definition code for java.rmi.server.RemoteObjectInvocationHandler.RemoteObjectInvocationHandler(java.rmi.server.RemoteRef) (RemoteRef sample code for java.rmi.server.RemoteRef definition code for java.rmi.server.RemoteRef  ref)
          Creates a new RemoteObjectInvocationHandler constructed with the specified RemoteRef.
 
Method Summary
 Object sample code for java.lang.Object definition code for java.lang.Object invoke sample code for java.rmi.server.RemoteObjectInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) definition code for java.rmi.server.RemoteObjectInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) (Object sample code for java.lang.Object definition code for java.lang.Object  proxy, Method sample code for java.lang.reflect.Method definition code for java.lang.reflect.Method  method, Object sample code for java.lang.Object definition code for java.lang.Object [] args)
          Processes a method invocation made on the encapsulating proxy instance, proxy, and returns the result.
 
Methods inherited from class java.rmi.server.RemoteObject sample code for java.rmi.server.RemoteObject definition code for java.rmi.server.RemoteObject
equals sample code for java.rmi.server.RemoteObject.equals(java.lang.Object) definition code for java.rmi.server.RemoteObject.equals(java.lang.Object) , getRef sample code for java.rmi.server.RemoteObject.getRef() definition code for java.rmi.server.RemoteObject.getRef() , hashCode sample code for java.rmi.server.RemoteObject.hashCode() definition code for java.rmi.server.RemoteObject.hashCode() , toString sample code for java.rmi.server.RemoteObject.toString() definition code for java.rmi.server.RemoteObject.toString() , toStub sample code for java.rmi.server.RemoteObject.toStub(java.rmi.Remote) definition code for java.rmi.server.RemoteObject.toStub(java.rmi.Remote)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

RemoteObjectInvocationHandler sample code for java.rmi.server.RemoteObjectInvocationHandler(java.rmi.server.RemoteRef) definition code for java.rmi.server.RemoteObjectInvocationHandler(java.rmi.server.RemoteRef)

public RemoteObjectInvocationHandler(RemoteRef sample code for java.rmi.server.RemoteRef definition code for java.rmi.server.RemoteRef  ref)
Creates a new RemoteObjectInvocationHandler constructed with the specified RemoteRef.

Parameters:
ref - the remote ref
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if ref is null
Method Detail

invoke sample code for java.rmi.server.RemoteObjectInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) definition code for java.rmi.server.RemoteObjectInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])

public Object sample code for java.lang.Object definition code for java.lang.Object  invoke(Object sample code for java.lang.Object definition code for java.lang.Object  proxy,
                     Method sample code for java.lang.reflect.Method definition code for java.lang.reflect.Method  method,
                     Object sample code for java.lang.Object definition code for java.lang.Object [] args)
              throws Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable 
Processes a method invocation made on the encapsulating proxy instance, proxy, and returns the result.

RemoteObjectInvocationHandler implements this method as follows:

If method is one of the following methods, it is processed as described below:

Otherwise, a remote call is made as follows:

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.

Specified by:
invoke sample code for java.lang.reflect.InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) definition code for java.lang.reflect.InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) in interface InvocationHandler sample code for java.lang.reflect.InvocationHandler definition code for java.lang.reflect.InvocationHandler
Parameters:
proxy - the proxy instance that the method was invoked on
method - the Method instance corresponding to the interface method invoked on the proxy instance
args - an array of objects containing the values of the arguments passed in the method invocation on the proxy instance, or null if the method takes no arguments
Returns:
the value to return from the method invocation on the proxy instance
Throws:
Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable - the exception to throw from the method invocation on the proxy instance
See Also: