dubbo源码阅读笔记--暴露服务时序

本文许多内容来源于http://dubbo.io/Developer+Guide-zh.htm#DeveloperGuide-zh-%E8%B0%83%E7%94%A8%E9%93%BE,感谢作者的分享。

dubbo的整体架构图中包含了很多内容,这里只分析服务暴露部分。


针对服务暴露,对上面的图做了些简化


时序图


分成六个阶段,下面分别列出每个阶段的调用堆栈。

1 初始化接口invoker

JavassistProxyFactory.getInvoker(T, Class<T>, URL) line: 40	
StubProxyFactoryWrapper.getInvoker(T, Class<T>, URL) line: 104	
ProxyFactory$Adpative.getInvoker(Object, Class, URL) line: not available	
ServiceBean<T>(ServiceConfig<T>).exportLocal(URL) line: 516	
ServiceBean<T>(ServiceConfig<T>).doExportUrlsFor1Protocol(ProtocolConfig, List<URL>) line: 469	
ServiceBean<T>(ServiceConfig<T>).doExportUrls() line: 285	
ServiceBean<T>(ServiceConfig<T>).doExport() line: 246	
ServiceBean<T>(ServiceConfig<T>).export() line: 145




2 初始化exporter
DubboExporter<T>.<init>(Invoker<T>, String, Map<String,Exporter<?>>) line: 36	
DubboProtocol.export(Invoker<T>) line: 240	
ProtocolFilterWrapper.export(Invoker<T>) line: 55	
ProtocolListenerWrapper.export(Invoker<T>) line: 56	
Protocol$Adpative.export(Invoker) line: not available	
ServiceBean<T>(ServiceConfig<T>).doExportUrlsFor1Protocol(ProtocolConfig, List<URL>) line: 495	
ServiceBean<T>(ServiceConfig<T>).doExportUrls() line: 285	
ServiceBean<T>(ServiceConfig<T>).doExport() line: 246	
ServiceBean<T>(ServiceConfig<T>).export() line: 145	



3 初始化server
DubboProtocol.createServer(URL) line: 318	
DubboProtocol.openServer(URL) line: 308	
DubboProtocol.export(Invoker<T>) line: 258	
ProtocolFilterWrapper.export(Invoker<T>) line: 55	
ProtocolListenerWrapper.export(Invoker<T>) line: 56	
Protocol$Adpative.export(Invoker) line: not available	
ServiceBean<T>(ServiceConfig<T>).doExportUrlsFor1Protocol(ProtocolConfig, List<URL>) line: 495	
ServiceBean<T>(ServiceConfig<T>).doExportUrls() line: 285	
ServiceBean<T>(ServiceConfig<T>).doExport() line: 246	
ServiceBean<T>(ServiceConfig<T>).export() line: 145	




4 绑定transporter
NettyTransporter.bind(URL, ChannelHandler) line: 33	
Transporter$Adpative.bind(URL, ChannelHandler) line: not available	
Transporters.bind(URL, ChannelHandler...) line: 48	
HeaderExchanger.bind(URL, ExchangeHandler) line: 41	
Exchangers.bind(URL, ExchangeHandler) line: 63	
DubboProtocol.createServer(URL) line: 329	
DubboProtocol.openServer(URL) line: 308	
DubboProtocol.export(Invoker<T>) line: 258	
ProtocolListenerWrapper.export(Invoker<T>) line: 56	
ProtocolFilterWrapper.export(Invoker<T>) line: 55	
Protocol$Adpative.export(Invoker) line: not available	
ServiceBean<T>(ServiceConfig<T>).doExportUrlsFor1Protocol(ProtocolConfig, List<URL>) line: 495	
ServiceBean<T>(ServiceConfig<T>).doExportUrls() line: 285	
ServiceBean<T>(ServiceConfig<T>).doExport() line: 246	
ServiceBean<T>(ServiceConfig<T>).export() line: 145	



5 初始化codec
NettyServer(AbstractEndpoint).<init>(URL, ChannelHandler) line: 47	
NettyServer(AbstractServer).<init>(URL, ChannelHandler) line: 59	
NettyServer.<init>(URL, ChannelHandler) line: 63	
NettyTransporter.bind(URL, ChannelHandler) line: 33	
Transporter$Adpative.bind(URL, ChannelHandler) line: not available	
Transporters.bind(URL, ChannelHandler...) line: 48	
HeaderExchanger.bind(URL, ExchangeHandler) line: 41	
Exchangers.bind(URL, ExchangeHandler) line: 63	
DubboProtocol.createServer(URL) line: 329	
DubboProtocol.openServer(URL) line: 308	
DubboProtocol.export(Invoker<T>) line: 258	
ProtocolListenerWrapper.export(Invoker<T>) line: 56	
ProtocolFilterWrapper.export(Invoker<T>) line: 55	
Protocol$Adpative.export(Invoker) line: not available	
RegistryProtocol.doLocalExport(Invoker<T>) line: 153	
RegistryProtocol.export(Invoker<T>) line: 107	
ProtocolListenerWrapper.export(Invoker<T>) line: 54	
ProtocolFilterWrapper.export(Invoker<T>) line: 53	
Protocol$Adpative.export(Invoker) line: not available	
ServiceBean<T>(ServiceConfig<T>).doExportUrlsFor1Protocol(ProtocolConfig, List<URL>) line: 489	
ServiceBean<T>(ServiceConfig<T>).doExportUrls() line: 285	
ServiceBean<T>(ServiceConfig<T>).doExport() line: 246	
ServiceBean<T>(ServiceConfig<T>).export() line: 145	



6 初始化channelHandler
AllChannelHandler(WrappedChannelHandler).<init>(ChannelHandler, URL) line: 47	//------------6
AllChannelHandler.<init>(ChannelHandler, URL) line: 32	
AllDispatcher.dispatch(ChannelHandler, URL) line: 32	
Dispatcher$Adpative.dispatch(ChannelHandler, URL) line: not available	
ChannelHandlers.wrapInternal(ChannelHandler, URL) line: 40	
ChannelHandlers.wrap(ChannelHandler, URL) line: 33	
NettyServer.<init>(URL, ChannelHandler) line: 63	//------------------5
NettyTransporter.bind(URL, ChannelHandler) line: 33	//-------------------4
Transporter$Adpative.bind(URL, ChannelHandler) line: not available	
Transporters.bind(URL, ChannelHandler...) line: 48	
HeaderExchanger.bind(URL, ExchangeHandler) line: 41	
Exchangers.bind(URL, ExchangeHandler) line: 63	
DubboProtocol.createServer(URL) line: 329	//----------------------3
DubboProtocol.openServer(URL) line: 308	
DubboProtocol.export(Invoker<T>) line: 258	
ProtocolFilterWrapper.export(Invoker<T>) line: 55	
ProtocolListenerWrapper.export(Invoker<T>) line: 56	
Protocol$Adpative.export(Invoker) line: not available	
RegistryProtocol.doLocalExport(Invoker<T>) line: 153	
RegistryProtocol.export(Invoker<T>) line: 107	
ProtocolFilterWrapper.export(Invoker<T>) line: 53	
ProtocolListenerWrapper.export(Invoker<T>) line: 54	//------------------2
Protocol$Adpative.export(Invoker) line: not available	
ServiceBean<T>(ServiceConfig<T>).doExportUrlsFor1Protocol(ProtocolConfig, List<URL>) line: 489	//-------------1
ServiceBean<T>(ServiceConfig<T>).doExportUrls() line: 285	
ServiceBean<T>(ServiceConfig<T>).doExport() line: 246	
ServiceBean<T>(ServiceConfig<T>).export() line: 145	




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值