<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!--利用Spring来实现RMI,不用实现remote接口,也不用调用rmic编译stub和skeleton, -->
<!--服务端可以定义org.springframework.remoting.rmi.RmiServiceExporter类完成RMI服务器实现. -->
<!--客户端只要定义org.springframework.remoting.rmi.RmiProxyFactoryBean,告知rmi的url和接口 -->
<bean id="cDeskService" class="com.cdesk.service.impl.CDeskService"></bean>
<!-- -->
<bean id="rmiServiceExporter_cDesk" class="org.springframework.remoting.rmi.RmiServiceExporter">
<!-- 定义服务名称 -->
<property name="serviceName" value="cDesk" />
<!-- 业务实现类 -->
<property name="service" ref="cDeskService" />
<!-- 业务接口 -->
<property name="serviceInterface" value="com.cdesk.service.ICDeskService" />
<!-- 端口号 -->
<property name="servicePort" value="8888"></property>
</bean>
<bean id="baseService" class="com.base.service.impl.BaseService"></bean>
<!-- 基础类的rmi -->
<bean id="rmiServiceExporter_base" class="org.springframework.remoting.rmi.RmiServiceExporter">
<!-- 定义服务名称 -->
<property name="serviceName" value="base" />
<!-- 业务实现类 -->
<property name="service" ref="baseService" />
<!-- 业务接口 -->
<property name="serviceInterface" value="com.base.service.IBaseService" />
<!-- 端口号 -->
<property name="servicePort" value="8888"></property>
</bean>
</beans>