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>
  • 相关阅读:
    算法的学习 — 冒泡排序
    自定义UICollectionLayout布局 —— UIKit之学习UICollectionView记录一《瀑布流》
    HDU 1541 Stars (线段树||树状数组)
    HDU 1617 Phone List (排序||字典树)
    CSU 1312 CX and girls (最短路)
    CSU 1320 Scoop water (卡特兰数)
    POJ 1838 Banana (并查集)
    POJ 1837 Balance (DP)
    POJ 1088 滑雪 (记忆化搜索)
    TYVJ 1261 可达总数 (BFS)
  • 原文地址:https://www.cnblogs.com/zhijicompanyethan/p/13928234.html
Copyright © 2011-2022 走看看