org.springframework.remoting.rmi
Class RmiInvocationWrapper

java.lang.Object
  extended by org.springframework.remoting.rmi.RmiInvocationWrapper
All Implemented Interfaces:
java.rmi.Remote, RmiInvocationHandler

 class RmiInvocationWrapper
extends java.lang.Object
implements RmiInvocationHandler

Server-side implementation of RmiInvocationHandler. An instance of this class exists for each remote object. Automatically created by RmiServiceExporter for non-RMI service implementations.

This is an SPI class, not to be used directly by applications.

Since:
14.05.2003
Author:
Juergen Hoeller
See Also:
RmiServiceExporter

Field Summary
private  RmiBasedExporter rmiExporter
           
private  java.lang.Object wrappedObject
           
 
Constructor Summary
RmiInvocationWrapper(java.lang.Object wrappedObject, RmiBasedExporter rmiExporter)
          Create a new RmiInvocationWrapper for the given object
 
Method Summary
 java.lang.String getTargetInterfaceName()
          Exposes the exporter's service interface, if any, as target interface.
 java.lang.Object invoke(RemoteInvocation invocation)
          Delegates the actual invocation handling to the RMI exporter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wrappedObject

private final java.lang.Object wrappedObject

rmiExporter

private final RmiBasedExporter rmiExporter
Constructor Detail

RmiInvocationWrapper

public RmiInvocationWrapper(java.lang.Object wrappedObject,
                            RmiBasedExporter rmiExporter)
Create a new RmiInvocationWrapper for the given object

Parameters:
wrappedObject - the object to wrap with an RmiInvocationHandler
rmiExporter - the RMI exporter to handle the actual invocation
Method Detail

getTargetInterfaceName

public java.lang.String getTargetInterfaceName()
Exposes the exporter's service interface, if any, as target interface.

Specified by:
getTargetInterfaceName in interface RmiInvocationHandler
Returns:
the name of the target interface, or null if none
See Also:
RemoteExporter.getServiceInterface()

invoke

public java.lang.Object invoke(RemoteInvocation invocation)
                        throws java.rmi.RemoteException,
                               java.lang.NoSuchMethodException,
                               java.lang.IllegalAccessException,
                               java.lang.reflect.InvocationTargetException
Delegates the actual invocation handling to the RMI exporter.

Specified by:
invoke in interface RmiInvocationHandler
Parameters:
invocation - object that encapsulates invocation parameters
Returns:
the object returned from the invoked method, if any
Throws:
java.rmi.RemoteException - in case of communication errors
java.lang.NoSuchMethodException - if the method name could not be resolved
java.lang.IllegalAccessException - if the method could not be accessed
java.lang.reflect.InvocationTargetException - if the method invocation resulted in an exception
See Also:
RmiBasedExporter.invoke(org.springframework.remoting.support.RemoteInvocation, Object)