Spring-RMI
Spring RMI Author: HuiFer 源码阅读仓库: SourceHot-Spring Spring 远程服务调用 DEMO 服务提供方 服务提供方需要准备接口、接口实现泪 接口 1 2 3 public interface IDemoRmiService { int add(int a, int b); } 接口实现 1 2 3 4 5 6 public class IDemoRmiServiceImpl implements IDemoRmiService { @Override public int add(int a, int b) { return a + b; } } xml 配置文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="demoRmiService" class="com.huifer.source.spring.rmi.impl.IDemoRmiServiceImpl"/> <bean id="demoRmi" class="org.springframework.remoting.rmi.RmiServiceExporter"> <!-- 服务--> <property name="service" ref="demoRmiService"/> <!-- 服务名称……