两个jvm之间的通信。
RMI全称是Remote Method Invocation-远程方法调用。
定义服务端(spring demo):
<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
<!-- does not necessarily have to be the same name as the bean to be exported -->
<property name="serviceName" value="自定义"/>
<property name="service" ref="自定义"/>
<property name="serviceInterface" value="自定义"/>
<!-- defaults to 1099 -->
<property name="registryPort" value="1199"/>
</bean>
定义客户端(spring demo):
<bean id="accountService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceUrl" value="rmi://HOST:1199/AccountService"/>
<property name="serviceInterface" value="自定义"/>
</bean>
转载于:https://blog.51cto.com/jun123/1656346