dubbo源码解析2.0
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
7.2.2 DubboRegistryFactory 创建注册中心过程 ....................................................63 7.2.3 注册中心启动 ................................................................................................. 68 7.2.4 生产者发布服务 .............................................................................................69 7.2.4.1 Export 发布服务流程 ..............................................................................69 7.2.4.2 RegistryProtocol.export(Invoker)暴露服务 .............................................72 7.2.5 消费者引用服务 .............................................................................................73 7.2.5.1 Refer 取得 invoker 的过程 ...................................................................... 73 7.2.5.2 RegistryProtocol. Refer 过程 .................................................................... 74 7.3 集群&容错 ..............................................................................................................75 7.3.1 Cluster .............................................................................................................76 7.3.2 目录服务 Directory .........................................................................................78 7.3.3 router 路由服务..............................................................................................80 7.3.4 负载均衡 ......................................................................................................... 81 7.3.4.1 RandomLoadBalance................................................................................82 7.3.4.2 RoundRobinLoadBalance ......................................................................... 82 7.3.4.3 LeastActiveLoadBalance ........................................................................... 83 7.3.4.4 ConsistentHashLoadBalance .................................................................... 84 7.3.5 配置规则 ......................................................................................................... 84 7.4 telnet .......................................................................................................................85 7.5 监控.........................................................................................................................87 7.5.1 监控中心 ......................................................................................................... 87 7.5.2 SimpleMonitorService .....................................................................................89 7.5.2.1 Monitor 基础类 .......................................................................................89 7.5.2.2 SimpleMonitorService ..............................................................................91 7.5.2.3 产生监控数据.........................................................................................93 7.5.2.4 RegistryContainer .....................................................................................94 7.5.2.5 JettyContainer ..........................................................................................95
Dubbo 源码解析
本文为本人阅读 dubbo 源码时所作的知识整理,其中部分资料引用自本人所搜索到的 网上资料。
来自百度文库
目录
目录
目录 .................................................................................................................................................. 2 1 源码阅读路径...........................................................................................................................4 2 背景........................................................................................................................................... 4 3 Dubbo 架构 ...............................................................................................................................5 4 HelloWorld 例子 .......................................................................................................................7 5 源文件概述...............................................................................................................................8 6 核心机制分析.........................................................................................................................10 6.1 设计模式.................................................................................................................10 6.2 Bean 加载 ...............................................................................................................11 6.2.1 Spring 可扩展 Schema ....................................................................................11 6.2.2 Spring 加载 bean 流程 ...................................................................................15 6.2.2.1 解析 xml 中的 bean 定义 ....................................................................... 15 6.2.2.2 onApplicationEvent ..................................................................................17 6.2.2.3 Main ......................................................................................................... 19 6.3 Extension 机制 ........................................................................................................ 20 6.3.1 Java SPI ............................................................................................................20 6.3.2 扩展点.............................................................................................................20 6.3.2.1 扩展点配置.............................................................................................20 6.3.2.2 扩展点加载流程.....................................................................................21 6.3.2.3 扩展点装饰.............................................................................................28 6.3.2.4 ExtensionFactory ......................................................................................32 6.4 代理.........................................................................................................................36 6.4.1 Invoker 调用 .................................................................................................... 36 6.4.2 JDK 代理 .......................................................................................................... 39 6.4.3 Javaassist 代理(动态) ................................................................................39 6.5 远程调用流程 ......................................................................................................... 42 6.5.1 通信过程 ......................................................................................................... 42 6.5.2 序列化.............................................................................................................43 6.5.3 Encode 和 Decode...........................................................................................46 7 过程分析................................................................................................................................. 47 7.1 Refer & export ......................................................................................................... 47 7.1.1 调用顺序 ......................................................................................................... 47 7.1.2 生成 Invoker .................................................................................................... 50 7.1.3 export ..............................................................................................................58 7.2 Registry ....................................................................................................................60 7.2.1 RegistryFactory 和 Registry .............................................................................60