前言
在前面springcloud_openfeign的文章中了解到FeignClientsRegistrar
在扫描到满足条件的feign接口后会生成BeanDefinition
并注入到spring上下文容器, 并且在FeignClientFactoryBean
中构建Feign.Builder
时会从父子容器中获取相关的组件设置给它, 那么注入到容器中时怎么选择容器, 以及使用时是怎么从容器中获取的呢??, 本节我们就来了解一下springcloud中的父子容器, 以及springcloud_openfeign是怎么使用父子容器的。
springcloud中的父子容器
基础知识了解
在spring框架中有一个非常重要的类org.springframework.context.ApplicationContext
, 它有个方法getParent
public interface ApplicationContext extends