Java Tutorial/Spring/RMI

Материал из Java эксперт
Перейти к: навигация, поиск

RMI Remoting

File: context.xml



   <source lang="java">

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans>

  <bean id="rmserver" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
    <property name="serviceUrl">
        <value>rmi://localhost/rmserver</value>   
    </property>
    <property name="serviceInterface">
        <value>rmserver</value>
    </property>
  </bean>
  <bean class="org.springframework.remoting.rmi.RmiServiceExporter">
    <property name="service">
        <value>rmservice</value>   
    </property>
    <property name="serviceName">
        <value>service1</value>   
    </property>
    <property name="serviceInterface">
        <value>rmservice</value>
    </property>
  </bean>
  <bean id="rmservice" class="RMIserviceimpl">
  </bean>
  <bean id="rmserverimpl" class="RMIserverimpl">
     <property name="rmserver"><ref bean="RMIserver"/></property>
  </bean>
  

</beans></source>