Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a395910

Browse filesBrowse files
committed
[U] 更新服务暴露原理文章;[A] 新增服务引用原理文章;
1 parent a9f25b0 commit a395910
Copy full SHA for a395910

File tree

Expand file treeCollapse file tree

2 files changed

+26
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+26
-0
lines changed
Open diff view settings
Collapse file
+23Lines changed: 23 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## 前言
2+
3+
## 正文
4+
5+
就DubboProtocolTest类下的testDubboProtocol()方法,服务引用流程:
6+
7+
1. ProtocolFilterWrapper#refer()
8+
2. ProtocolListenerWrapper#refer()
9+
3. AbstractProtocol#refer()
10+
4. DubboProtocol#protocolBindingRefer()
11+
5. DubboProtocol#getClients()
12+
6. DubboProtocol#getSharedClient()
13+
7. DubboProtocol#buildReferenceCountExchangeClientList()
14+
8. DubboProtocol#buildReferenceCountExchangeClient()
15+
9. DubboProtocol#initClient()
16+
10. Exchangers#connect()
17+
11. HeaderExchanger#connect()
18+
12. Transporters#connect()
19+
13. Transporter$Adaptive,代理出来的类,在服务暴露中有代码
20+
14. NettyTransporter#connect()
21+
15. NettyClient#init()
22+
16. AbstractClient#init()
23+
17. NettyClient#doOpen()
Collapse file

‎note/Dubbo/Dubbo底层源码学习——服务暴露.md‎

Copy file name to clipboardExpand all lines: note/Dubbo/Dubbo底层源码学习——服务暴露.md
+3Lines changed: 3 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class Protocol$Adaptive implements org.apache.dubbo.rpc.Protocol {
1313
org.apache.dubbo.common.URL url = arg1;
1414
String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
1515
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.Protocol) name from url (" + url.toString() + ") use keys([protocol])");
16+
// 这里extension为ProtocolFilterWrapper类
1617
org.apache.dubbo.rpc.Protocol extension = (org.apache.dubbo.rpc.Protocol)ExtensionLoader.getExtensionLoader(org.apache.dubbo.rpc.Protocol.class).getExtension(extName);
1718
return extension.refer(arg0, arg1);
1819
}
@@ -40,8 +41,10 @@ public class ProxyFactory$Adaptive implements org.apache.dubbo.rpc.ProxyFactory
4041
if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument == null");
4142
if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument getUrl() == null");
4243
org.apache.dubbo.common.URL url = arg0.getUrl();
44+
// 判断如果取不到proxy,则使用默认值javassist
4345
String extName = url.getParameter("proxy", "javassist");
4446
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.ProxyFactory) name from url (" + url.toString() + ") use keys([proxy])");
47+
// 这里extension是StubProxyFactoryWrapper对象
4548
org.apache.dubbo.rpc.ProxyFactory extension = (org.apache.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(org.apache.dubbo.rpc.ProxyFactory.class).getExtension(extName);
4649
return extension.getProxy(arg0);
4750
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.