You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by gi...@apache.org on 2023/09/15 05:15:27 UTC

[dubbo-website] branch cn-site updated: deploy: ae16715b59f8a33aa6e6de00e93d88603b2423e6

This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch cn-site
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git


The following commit(s) were added to refs/heads/cn-site by this push:
     new 54ced3dad56 deploy: ae16715b59f8a33aa6e6de00e93d88603b2423e6
54ced3dad56 is described below

commit 54ced3dad560576904c4caf12a3a5ff32374d42f
Author: chickenlj <ch...@users.noreply.github.com>
AuthorDate: Fri Sep 15 05:15:22 2023 +0000

    deploy: ae16715b59f8a33aa6e6de00e93d88603b2423e6
---
 sitemap.xml                                                         | 2 +-
 .../java-sdk/reference-manual/spi/description/dubbo-spi/index.html  | 6 +++---
 .../mannual/java-sdk/reference-manual/spi/description/index.xml     | 2 +-
 zh-cn/sitemap.xml                                                   | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sitemap.xml b/sitemap.xml
index 2759d61c900..63299ce0d6f 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://cn.dubbo.apache.org/zh-cn/sitemap.xml</loc><lastmod>2023-09-01T20:49:32+08:00</lastmod></sitemap><sitemap><loc>https://cn.dubbo.apache.org/en/sitemap.xml</loc><lastmod>2023-09-05T14:27:01+08:00</lastmod></sitemap></sitemapindex>
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8" standalone="yes"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://cn.dubbo.apache.org/zh-cn/sitemap.xml</loc><lastmod>2023-09-15T13:09:48+08:00</lastmod></sitemap><sitemap><loc>https://cn.dubbo.apache.org/en/sitemap.xml</loc><lastmod>2023-09-05T14:27:01+08:00</lastmod></sitemap></sitemapindex>
\ No newline at end of file
diff --git a/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/dubbo-spi/index.html b/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/dubbo-spi/index.html
index c3fc81b2de9..fe9aff8dd6a 100644
--- a/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/dubbo-spi/index.html
+++ b/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/dubbo-spi/index.html
@@ -1,4 +1,4 @@
-<!doctype html><html lang=zh-cn class=no-js><head><meta name=ROBOTS content="INDEX, FOLLOW"><link rel=canonical href=https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/dubbo-spi/><script>var _hmt=_hmt||[];(function(){var e,t=document.createElement("script");t.src="https://hm.baidu.com/hm.js?3b78f49ba47181e4d998a66b689446e9",e=document.getElementsByTagName("script")[0],e.parentNode.insertBefore(t,e)})()</script><meta charset=utf-8><meta name=viewp [...]
+<!doctype html><html lang=zh-cn class=no-js><head><meta name=ROBOTS content="INDEX, FOLLOW"><link rel=canonical href=https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/dubbo-spi/><script>var _hmt=_hmt||[];(function(){var e,t=document.createElement("script");t.src="https://hm.baidu.com/hm.js?3b78f49ba47181e4d998a66b689446e9",e=document.getElementsByTagName("script")[0],e.parentNode.insertBefore(t,e)})()</script><meta charset=utf-8><meta name=viewp [...]
 <script>var doNotTrack=!1;if(!doNotTrack){window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-NM6FFMT51J",{anonymize_ip:!1})}</script><link rel=preload href=/scss/main.min.fe7176cbe3102a33d3e8c0c9cec61eb52508abd24a2cc1ae23ccf535a481ffde.css as=style><link href=/scss/main.min.fe7176cbe3102a33d3e8c0c9cec61eb52508abd24a2cc1ae23ccf535a481ffde.css rel=stylesheet integrity><script src=/js/jquery-3.5.1.min.js integrity="sha256-9/a [...]
 <link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@docsearch/css@3><meta name=theme-color content="#326ce5"><link rel=stylesheet href=/css/feature-states.css><meta name=description content="本文介绍了 Dubbo SPI 的原理和实现细节"><meta property="og:description" content="本文介绍了 Dubbo SPI 的原理和实现细节"><meta name=twitter:description content="本文介绍了 Dubbo SPI 的原理和实现细节"><meta property="og:url" content="https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/dubbo-spi/"> [...]
 <link href=/css/community.css rel=stylesheet><link href=/css/contactus.css rel=stylesheet><link href=/css/language.css rel=stylesheet><script src=/js/script.js></script></head><body class="td-page td-documentation"><header><nav class="js-navbar-scroll navbar navbar-expand navbar-dark flex-column flex-md-row td-navbar" data-auto-burger=primary><a class=navbar-brand href=/zh-cn/><span class=navbar-logo></span><span class="text-uppercase font-weight-bold">Apache Dubbo</span></a><div class=" [...]
@@ -677,7 +677,7 @@
 Dubbo 中,SPI 主要有两种用法,一种是加载固定的扩展类,另一种是加载自适应扩展类。这两种方式会在下面详细的介绍。
 需要特别注意的是: 在 Dubbo 中,基于 SPI 扩展加载的类是单例的。</p><h3 id=11-加载固定的扩展类>1.1 加载固定的扩展类</h3><p>如果让你来设计加载固定扩展类,你会怎么做了?
 一种常见思路是读取特定目录下的配置文件,然后解析出全类名,通过反射机制来实例化这个类,然后将这个类放在集合中存起来,如果有需要的时候,直接从集合中取。Dubbo 中的实现也是这么一个思路。
-不过在 Dubbo 中,实现的更加完善,它实现类了 IOC 和 AOP 的功能。IOC 就是说如果这个扩展类依赖其他属性,Dubbo 会自动的将这个属性进行注入。这个功能如何实现了?一个常见思路是获取这个扩展类的 setter
+不过在 Dubbo 中,实现的更加完善,它实现了 IOC 和 AOP 的功能。IOC 就是说如果这个扩展类依赖其他属性,Dubbo 会自动的将这个属性进行注入。这个功能如何实现了?一个常见思路是获取这个扩展类的 setter
 方法,调用 setter 方法进行属性注入。AOP 指的是什么了?这个说的是 Dubbo 能够为扩展类注入其包装类。比如 DubboProtocol 是 Protocol 的扩展类,ProtocolListenerWrapper 是 DubboProtocol 的包装类。</p><h3 id=12-加载自适应扩展类>1.2 加载自适应扩展类</h3><p>先说明下自适应扩展类的使用场景。比如我们有需求,在调用某一个方法时,基于参数选择调用到不同的实现类。和工厂方法有些类似,基于不同的参数,构造出不同的实例对象。
 在 Dubbo 中实现的思路和这个差不多,不过 Dubbo 的实现更加灵活,它的实现和策略模式有些类似。每一种扩展类相当于一种策略,基于 URL 消息总线,将参数传递给 ExtensionLoader,通过 ExtensionLoader 基于参数加载对应的扩展类,实现运行时动态调用到目标实例上。</p><h2 id=2-dubbo-spi-源码分析>2. Dubbo SPI 源码分析</h2><h3 id=21-加载固定的扩展类>2.1 加载固定的扩展类</h3><p>Dubbo 中,SPI 加载固定扩展类的入口是 ExtensionLoader 的 getExtension 方法,下面我们对拓展类对象的获取过程进行详细的分析。</p><div class=highlight><pre tabindex=0 style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-java data-lang=java><span [...]
 </span></span><span style=display:flex><span>    <span style=color:#719e07>if</span> <span style=color:#719e07>(</span>name <span style=color:#719e07>==</span> <span style=color:#cb4b16>null</span> <span style=color:#719e07>||</span> name<span style=color:#719e07>.</span>length<span style=color:#719e07>()</span> <span style=color:#719e07>==</span> 0<span style=color:#719e07>)</span>
@@ -1185,7 +1185,7 @@ Dubbo 中,SPI 主要有两种用法,一种是加载固定的扩展类,另
 </span></span><span style=display:flex><span>    <span style=color:#719e07>}</span>
 </span></span><span style=display:flex><span><span style=color:#719e07>}</span>
 </span></span></code></pre></div><div id=pre-footer><h2>反馈</h2><p class=feedback--prompt>此页是否对您有帮助?</p><button class="btn btn-primary mb-4 feedback--yes">是</button>
-<button class="btn btn-primary mb-4 feedback--no">否</button></div><script>const yes=document.querySelector(".feedback--yes"),no=document.querySelector(".feedback--no");document.querySelectorAll(".feedback--link").forEach(e=>{e.href=e.href+window.location.pathname});const sendFeedback=e=>{gtag||console.log("!gtag"),gtag("event","click",{event_category:"Helpful",event_label:window.location.pathname,value:e})},disableButtons=()=>{yes.disabled=!0,yes.classList.add("feedback--button__disabled [...]
+<button class="btn btn-primary mb-4 feedback--no">否</button></div><script>const yes=document.querySelector(".feedback--yes"),no=document.querySelector(".feedback--no");document.querySelectorAll(".feedback--link").forEach(e=>{e.href=e.href+window.location.pathname});const sendFeedback=e=>{gtag||console.log("!gtag"),gtag("event","click",{event_category:"Helpful",event_label:window.location.pathname,value:e})},disableButtons=()=>{yes.disabled=!0,yes.classList.add("feedback--button__disabled [...]
 <a href="https://github.com/apache/dubbo-website/new/master/content/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/dubbo-spi.md?filename=change-me.md&amp;value=---%0Atitle%3A+%22Long+Page+Title%22%0AlinkTitle%3A+%22Short+Nav+Title%22%0Aweight%3A+100%0Adescription%3A+%3E-%0A+++++Page+description+for+heading+and+indexes.%0A---%0A%0A%23%23+Heading%0A%0AEdit+this+template+to+create+your+new+page.%0A%0A%2A+Give+it+a+good+name%2C+ending+in+%60.md%60+-+e.g.+%60getting-started. [...]
 <a href="https://github.com/apache/dubbo-website/issues/new?title=%e6%89%a9%e5%b1%95%e7%82%b9%e5%bc%80%e5%8f%91%e6%8c%87%e5%8d%97" target=_blank><i class="fab fa-github fa-fw"></i> 登记问题</a>
 <a href=https://github.com/apache/dubbo/issues/new target=_blank><i class="fas fa-tasks fa-fw"></i> 提交项目问题</a></div><nav id=TableOfContents><ul><li><a href=#1-dubbo-spi-扩展简介>1. Dubbo SPI 扩展简介</a><ul><li><a href=#11-加载固定的扩展类>1.1 加载固定的扩展类</a></li><li><a href=#12-加载自适应扩展类>1.2 加载自适应扩展类</a></li></ul></li><li><a href=#2-dubbo-spi-源码分析>2. Dubbo SPI 源码分析</a><ul><li><a href=#21-加载固定的扩展类>2.1 加载固定的扩展类</a></li><li><a href=#22-加载自适应扩展类>2.2 加载自适应扩展类</a></li></ul></li><li><a href=#3-dubbo-spi-扩展示例>3. D [...]
diff --git a/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/index.xml b/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/index.xml
index e69038768dd..1135ce0fd69 100644
--- a/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/index.xml
+++ b/zh-cn/overview/mannual/java-sdk/reference-manual/spi/description/index.xml
@@ -1752,7 +1752,7 @@ Dubbo 中,SPI 主要有两种用法,一种是加载固定的扩展类,另
 &lt;h3 id="11-加载固定的扩展类">1.1 加载固定的扩展类&lt;/h3>
 &lt;p>如果让你来设计加载固定扩展类,你会怎么做了?
 一种常见思路是读取特定目录下的配置文件,然后解析出全类名,通过反射机制来实例化这个类,然后将这个类放在集合中存起来,如果有需要的时候,直接从集合中取。Dubbo 中的实现也是这么一个思路。
-不过在 Dubbo 中,实现的更加完善,它实现类了 IOC 和 AOP 的功能。IOC 就是说如果这个扩展类依赖其他属性,Dubbo 会自动的将这个属性进行注入。这个功能如何实现了?一个常见思路是获取这个扩展类的 setter
+不过在 Dubbo 中,实现的更加完善,它实现了 IOC 和 AOP 的功能。IOC 就是说如果这个扩展类依赖其他属性,Dubbo 会自动的将这个属性进行注入。这个功能如何实现了?一个常见思路是获取这个扩展类的 setter
 方法,调用 setter 方法进行属性注入。AOP 指的是什么了?这个说的是 Dubbo 能够为扩展类注入其包装类。比如 DubboProtocol 是 Protocol 的扩展类,ProtocolListenerWrapper 是 DubboProtocol 的包装类。&lt;/p>
 &lt;h3 id="12-加载自适应扩展类">1.2 加载自适应扩展类&lt;/h3>
 &lt;p>先说明下自适应扩展类的使用场景。比如我们有需求,在调用某一个方法时,基于参数选择调用到不同的实现类。和工厂方法有些类似,基于不同的参数,构造出不同的实例对象。
diff --git a/zh-cn/sitemap.xml b/zh-cn/sitemap.xml
index cf80fdd746f..7c293a419c2 100644
--- a/zh-cn/sitemap.xml
+++ b/zh-cn/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://cn.dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4%E5%8D%87%E7%BA%A7-dubbo3-%E5%85%A8%E9%9D%A2%E5%8F%96%E4%BB%A3-hsf2/</loc><lastmod>2023-02-22T15:03:22+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority></url><url><loc>https://cn.dubbo.apache.org/zh-cn/overview/mannu [...]
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://cn.dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4%E5%8D%87%E7%BA%A7-dubbo3-%E5%85%A8%E9%9D%A2%E5%8F%96%E4%BB%A3-hsf2/</loc><lastmod>2023-02-22T15:03:22+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority></url><url><loc>https://cn.dubbo.apache.org/zh-cn/overview/mannu [...]
\ No newline at end of file