zoukankan      html  css  js  c++  java
  • Usage(用法)

    Spring configuration of local service

    local.xml:

    <bean id=“xxxService” class=“com.xxx.XxxServiceImpl” />
    <bean id=“xxxAction” class=“com.xxx.XxxAction”>
        <property name=“xxxService” ref=“xxxService” />
    </bean>
    

    Spring configuration of remote service

    Spring远程服务配置

    The remote configuration can be done by very little change based on the local configuration:

    远程服务基于本地配置小小的改动就可以完成。

    • split the local.xml into two part, put the service define part into remote-privider.xml(exists in the provider node), meanwhile the refrence part into remote-consumer.xml(exists in the consumer node).
    • 把local.xml切割成两部分,把定义服务的部分放在remote-provider.xml中(存在于提供端),与此同时引用部分放在remote-consumer.xml(存在于消费端节点)
    • add <dubbo:service> to the provider's configuration, and <dubbo:reference> to the consumer's configuration.
    • 添加<dubbo:service>到提供端配置,并且添加<dubbo:reference>到消费端配置。

    remote-provider.xml:

    远程提供者xml

    <!-- define remote service bean the same way as local service bean -->
        像本地服务bean一样定义远程服务bean <bean id=“xxxService” class=“com.xxx.XxxServiceImpl” /> <!-- expose the remote service -->
    暴露远程服务 <dubbo:service interface=“com.xxx.XxxService” ref=“xxxService” />

    remote-consumer.xml:

    远程消费端xml

    <!-- reference the remote service -->
    <dubbo:reference id=“xxxService” interface=“com.xxx.XxxService” />
    <!-- use remote service the same say as local service -->
    <bean id=“xxxAction” class=“com.xxx.XxxAction”> 
        <property name=“xxxService” ref=“xxxService” />
    </bean>
  • 相关阅读:
    数论练习(5)——青蛙的约会(扩gcd)
    数论练习(4)——同余方程(扩gcd)
    数论练习(3)——相同后三位(快速幂)
    s if标签
    spring获取webapplicationcontext,applicationcontext几种方法详解
    Java精确测量代码运行时间 代码执行时间 纳秒 nanoTime
    java中使用二进制进行权限控制
    hibernate注解配置举例说明
    js日期处理
    Spring 简单而强大的事务管理功能
  • 原文地址:https://www.cnblogs.com/zhijicompanyethan/p/13928234.html
Copyright © 2011-2022 走看看