首页 > 编程语言 > 详细

java rmi解决的问题

时间:2015-05-29 15:55:27      阅读:242      评论:0      收藏:0      [点我收藏+]

两个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>

客户端调用服务端:

@Autowired

private ServerInterface serverOperationImpl;

        accountService.方法名;


java rmi解决的问题

原文:http://jun123.blog.51cto.com/9893428/1656346

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!