Class RmiProxyFactoryBean

All Implemented Interfaces:
FactoryBean, InitializingBean

public class RmiProxyFactoryBean
extends RemoteProxyFactoryBean

Factory bean for transparent RMI proxies. Behaves like the proxied service when used as bean reference, exposing the specified service interface. The service URL must be a valid RMI URL like "rmi://localhost:1099/myservice".

Transparent means that RMI communication works on the RemoteInvocationHandler level, needing only one stub for any service. Service interfaces do not have to extend java.rmi.Remote or throw RemoteException on all methods, but in and out parameters have to be serializable.

This proxy factory can only access RMI objects that got exported with a RemoteInvocationWrapper, i.e. working on the RemoteInvocationHandler level.

The major advantage of RMI, compared to Hessian and Burlap, is serialization. Effectively, any serializable Java object can be transported without hassle. Hessian and Burlap have their own (de-)serialization mechanisms, but are HTTP-based and thus much easier to setup than RMI.

Juergen Hoeller
See Also:
RmiServiceExporter, RemoteInvocationHandler, RemoteInvocationWrapper

Constructor Summary
Method Summary
protected  java.lang.Object createProxy()
          Create the proxy instance.
Methods inherited from class
afterPropertiesSet, getObject, getPropertyValues, getServiceInterface, getServiceUrl, isSingleton, setServiceInterface, setServiceUrl
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public RmiProxyFactoryBean()
Method Detail


protected java.lang.Object createProxy()
Description copied from class: RemoteProxyFactoryBean
Create the proxy instance. Can use the properties of this factory, although the actually used settings will vary. For example, certain protocols do not support authentication.
createProxy in class RemoteProxyFactoryBean
Following copied from class:
the new proxy instance

Rod Johnson and Spring contributors 2001-2003.