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>
  • 相关阅读:
    PhpStorm 2019.3 汉化包
    PHP性能监控
    Jsonp post 跨域方案
    解决前后端调用,跨域二次请求Access-Control-Max-Age
    npm安装全局模块之后项目提示找不到的解决
    centos7 安装nodejs 最新版
    基于 ThinkJS 的 WebSocket 通信详解
    php方法注释
    恶意评论过滤插件
    redis与memcached区别
  • 原文地址:https://www.cnblogs.com/zhijicompanyethan/p/13928234.html
Copyright © 2011-2022 走看看