dubbo源码解析
2021-07-03 17:19:01 0 举报
dubbo整合spring源码流程
作者其他创作
大纲/内容
ReferenceAnnotationBeanPostProcessor
@Import导入DubboConfigConfigurationRegistrar
注册registerReferenceBean
读取注解EnableDubboConfigBinding
spring扩展点:实现了BeanDefinitionRegistryPostProcessor接口,spring启动时会调用postProcessBeanDefinitionRegistry
入口
生成一个ServiceBeanbuildServiceBeanDefinition
doExportUrlsFor1Protocol
RegistryProtocol.export
ServiceBean.onApplicationEvent
处理@Reference注解registerReferenceAnnotationBeanPostProcessor
注册一个ServiceAnnotationBeanPostProcessor
spring扩展点:该接口实现了ImportBeanDefinitionRegistrar,会在spring注册beanDefinition的时候调用
DubboConfigConfiguration
真正解析配置文件DubboConfigBindingRegistrar.registerDubboConfigBeans
registerBeans
检查并且更新参数checkAndUpdateSubConfigs
处理@service注解registerServiceAnnotationBeanPostProcessor
注册ServiceBeanregisterServiceBean
解析配置文件如application.port=xxresolveMultipleBeanNames
DubboConfigBindingRegistrar.registerBeanDefinitions
扫描@Service注解的类findServiceAnnotation
doExportUrls
protocol.export
分割线
注册bean定义registry.registerBeanDefinition
spring整合结束
1.整合spring开始@EnableDubbo
postProcessBeforeInitializationpostProcessAfterInitialization
@DubboComponentScan
2.dubbo服务导出开始
为每个bean注册一个bean定义registerDubboConfigBean
为每个bean注册一个bean的后置处理器registerDubboConfigBindingBeanPostProcessor
@EnableDubboConfig解析配置文件
ServiceBean监听了spring启动事件,spring启动完后会调用此方法进行服务导出
@Import导入DubboComponentScanRegistrar
super.export()
找到服务实现类对应的接口resolveServiceInterfaceClass
doLocalExport
spring扩展点:是一个BeanPostProcessor,bean的后置处理器,调用doGetInjectedBean
生成对象ReferenceBeanbuildReferenceBeanIfAbsent
export()
doExport
registerServiceBeans
registerDubboConfigBeanCustomizers
0 条评论
回复 删除
下一页