com.interface21.remoting.rmi
Class RmiProxyFactoryBean
java.lang.Object
|
+--com.interface21.remoting.support.RemoteProxyFactoryBean
|
+--com.interface21.remoting.rmi.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.
- Since:
- 13.05.2003
- Author:
- Juergen Hoeller
- See Also:
RmiServiceExporter,
RemoteInvocationHandler,
RemoteInvocationWrapper
|
Method Summary |
protected java.lang.Object |
createProxy()
Create the proxy instance. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RmiProxyFactoryBean
public RmiProxyFactoryBean()
createProxy
protected java.lang.Object createProxy()
throws java.net.MalformedURLException,
RemoteAccessException
- 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.
- Overrides:
createProxy in class RemoteProxyFactoryBean
- Following copied from class:
com.interface21.remoting.support.RemoteProxyFactoryBean
- Returns:
- the new proxy instance
Rod Johnson and Spring contributors 2001-2003.