在DefaultListableBeanFactory的registerBeanDefinition
里打上断点,运行Entrance,观察调用栈:
Entrance源码:阅读Spring源码第一步:源码编译与创建调试入口
注册是从主函数开始的:
之后进入到FileSystemXmlApplicationContext的构造函数:
public FileSystemXmlApplicationContext(String configLocation) throws BeansException {
this(new String[] {configLocation}, true, null);
}
又调用了另外一个构造函数:
public FileSystemXmlApplicationContext(
String[] configLocations, boolean refresh, @Nullable ApplicationContext parent)
throws BeansException {
super(parent);
setConfigLocations(configLocations);
if (ref