rmi实例(Spring整合)

实例代码在附件中,spring配置文件如下:
server端
<bean id="helloService" class="org.springframework.remoting.rmi.RmiServiceExporter">
<property name="service">
<bean class="com.service.impl.HelloServiceImpl"></bean>
</property>
<property name="serviceName" value="helloService"></property>
<property name="serviceInterface" value="com.service.HelloService"></property>
<property name="registryPort" value="8088"></property>
</bean>

client端:
<bean id="helloService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceUrl" value="rmi://10.21.139.43:8088/helloService"></property>
<property name="serviceInterface" value="cn.service.HelloService"></property>
</bean>

猜你喜欢

转载自spacecity.iteye.com/blog/1471250