ClassPathXmlApplicationContext:
public ClassPathXmlApplicationContext(
String[] configLocations, boolean refresh, @Nullable ApplicationContext parent)
throws BeansException {
//设置传入进来的父容器、创建Bean资源解析器
super(parent); // 代码1
//将传入进来的配置文件路径(如spring/aaa.xml,spring/bbb.xml)保存起来
setConfigLocations(configLocations); // 代码2
if (refresh) {
//初始化最核心的方法,就是refresh()
//把所有的Bean重新构造一遍
//主线
refresh(); // 代码3
}
}