AnnotationConfigServletWebServerApplicationContext解析
getBean方法
public <T> T getBean(Class<T> requiredType) throws BeansException { assertBeanFactoryActive();
return getBeanFactory().getBean(requiredType);
}
public final ConfigurableListableBeanFactory getBeanFactory() {
return this.beanFactory;
}
public GenericApplicationContext() {
this.beanFactory = new DefaultListableBeanFactory();
}
getBean方法的具体实现主要是通过beanFactory来实现的。
DefaultListableBeanFactory
类图
getBean具体的ioc流程后续分析
public <T> T getBean(Class<T> requiredType) throws BeansException { return getBean(requiredType, (Object[]) null);
}
以上是 AnnotationConfigServletWebServerApplicationContext解析 的全部内容, 来源链接: utcz.com/z/515050.html