版權聲明:本文為博主原創(chuàng)文章,轉載請注明出處,歡迎交流學習!
接著上一章節(jié)的內容,我們來分析當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(); } }
延伸閱讀
學習是年輕人改變自己的最好方式