mirror of
https://github.com/youthlql/JavaYouth.git
synced 2026-04-18 17:03:40 +00:00
小更新,可忽略
This commit is contained in:
@@ -13,12 +13,19 @@ abbrlink: 796f395d
|
||||
date: 2021-10-06 13:21:58
|
||||
---
|
||||
|
||||
|
||||
|
||||
## 第四节: Spring与Dubbo整合原理与源码分析
|
||||
|
||||
|
||||
|
||||
### 笔记更新地址:
|
||||
|
||||
[https://www.yuque.com/books/share/f2394ae6-381b-4f44-819e-c231b39c1497](https://www.yuque.com/books/share/f2394ae6-381b-4f44-819e-c231b39c1497?#)(密码:kyys) 《Dubbo笔记》
|
||||
|
||||
|
||||
|
||||
### 整体架构和流程
|
||||
|
||||
<img src="https://npm.elemecdn.com/youthlql@1.0.4/rpc/dubbo/v1/04_di_si_jie/Spring整合Dubbo架构图.png"/>
|
||||
|
||||
#### 处理@Service
|
||||
|
||||
@@ -170,10 +177,11 @@ public class DubboConfigConfigurationRegistrar implements ImportBeanDefinitionRe
|
||||
|
||||
#### 流程
|
||||
|
||||
<img src="https://npm.elemecdn.com/youthlql@1.0.4/rpc/dubbo/v1/04_di_si_jie/Spring整合Dubbo只properties文件解析流程.png"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Spring启动时,会调用DubboConfigConfigurationRegistrar的registerBeanDefinitions方法,该方法是利用Spring中的AnnotatedBeanDefinitionReader来读取:
|
||||
|
||||
@@ -856,10 +864,11 @@ DubboConfigConfigurationRegistrar的作用是向Spring容器中注册两个Bean:
|
||||
|
||||
> 主要就是处理@Service注解
|
||||
|
||||
<img src="https://npm.elemecdn.com/youthlql@1.0.4/rpc/dubbo/v1/04_di_si_jie/@Service注解处理流程.png"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ServiceAnnotationBeanPostProcessor是一个BeanDefinitionRegistryPostProcessor,是用来注册BeanDefinition的。这个类的名字起的不太好。
|
||||
|
||||
@@ -909,6 +918,8 @@ ServiceBean表示一个Dubbo服务,它有一些参数,比如:
|
||||
|
||||
|
||||
|
||||
> 关于RuntimeBeanReference参考[https://www.yuque.com/renyong-jmovm/ufz328/gbwvk7](https://www.yuque.com/renyong-jmovm/ufz328/gbwvk7)。
|
||||
|
||||
|
||||
|
||||
##### 代码注释
|
||||
@@ -1220,6 +1231,7 @@ public class ServiceAnnotationBeanPostProcessor implements BeanDefinitionRegistr
|
||||
|
||||
> 处理@Reference注解
|
||||
|
||||
<img src="https://npm.elemecdn.com/youthlql@1.0.4/rpc/dubbo/v1/04_di_si_jie/@Reference注解处理流程.png"/>
|
||||
|
||||
##### 总结
|
||||
|
||||
|
||||
Reference in New Issue
Block a user