版权声明:本文为博主原创文章,转载请注明出处,欢迎交流学习!
接着上一章节的内容,我们来分析当new一个FileSystemXmlApplicationContext对象的时候,spring到底做了那些事。FileSystemXmlApplicationContext类的内容主要是定义了若干重载的构造方法,核心构造方法如下:
/**
* Create a new FileSystemXmlApplicationContext with the given parent,
* loading the definitions from the given XML files.
*
* loading all bean definitions and creating all singletons.
* Alternatively, call refresh manually after further configuring the context.
*
*/
public FileSystemXmlApplicationContext(
String[] configLocations, boolean refresh, @Nullable ApplicationContext parent) throws BeansException { super(parent);
setConfigLocations(configLocations); if (refresh) {
refresh();
}
}
延伸阅读
学习是年轻人改变自己的最好方式
