org.springframework.remoting.rmi
Class RmiServiceExporter
org.springframework.remoting.support.RemoteExporter
|
+--org.springframework.remoting.rmi.RmiServiceExporter
- public class RmiServiceExporter
- extends RemoteExporter
- implements InitializingBean
RMI exporter that exposes the specified service as RMI object with the specified
name. Such services can be accessed via plain RMI or via RmiProxyFactoryBean.
Also supports exposing any non-RMI service via RMI invokers, to be accessed via
RmiProxyFactoryBean's automatic detection of such invokers.
With an RMI invoker, 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.
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.
- Author:
- Juergen Hoeller
- Since: 13.05.2003
- See Also: RmiProxyFactoryBean, HessianServiceExporter, BurlapServiceExporter
| Method Summary |
void | afterPropertiesSet() Register the service as RMI object. |
void | setRegistryPort(int registryPort) Set the port of the registry for the exported RMI service,
i.e. |
void | setServiceName(String serviceName) Set the name of the exported RMI service,
i.e. |
void | setServicePort(int servicePort) Set the port that the exported RMI service will use. |
afterPropertiesSet
public void afterPropertiesSet()
throws java.lang.Exception
- Register the service as RMI object.
Creates an RMI registry on the specified port if none exists.
setRegistryPort
public void setRegistryPort(int registryPort)
- Set the port of the registry for the exported RMI service,
i.e. rmi://localhost:PORT/name
Default is Registry.REGISTRY_PORT (1099).
setServiceName
public void setServiceName(String serviceName)
- Set the name of the exported RMI service,
i.e. rmi://localhost:port/NAME
setServicePort
public void setServicePort(int servicePort)
- Set the port that the exported RMI service will use.
Default is 0 (anonymous port).
to Class java.lang.String