ioc容器初始化
2020-09-15 10:04:17 0 举报
ioc容器初始化
作者其他创作
大纲/内容
1调用容器准备刷新的方法,获取容器的当时时间,同时给容器设置同步标识\t\t\tprepareRefresh()
5调用所有注册的BeanFactoryPostProcessor的Bean\t\t\t\tinvokeBeanFactoryPostProcessors(beanFactory)
9调用子类的某些特殊Bean初始化方法 onRefresh()
AbstractApplicationContext
loadBeanDefinitions
AbstractBeanDefinitionReader
11初始化所有剩余的单例Bean\t\t\t\tfinishBeanFactoryInitialization(beanFactory)
initHandlerAdapters
initServletBean()
2告诉子类启动refreshBeanFactory()方法,Bean定义资源文件的载入从子类的refreshBeanFactory()方法启动obtainFreshBeanFactory()
FrameworkServlet
7初始化信息源,和国际化相关.\t\t\t\tinitMessageSource()
initStrategies
initWebApplicationContext
refresh()
DispatcherServlet
initViewResolvers
initFlashMapManager
8初始化容器事件传播器.\t\t\t\tinitApplicationEventMulticaster()
ConfigurableApplicationContext
initHandlerExceptionResolvers
4为容器的某些子类指定特殊的BeanPost事件处理器\t\t\t\tpostProcessBeanFactory(beanFactory)
configureAndRefreshWebApplicationContext
XmlBeanDefinitionReader
initThemeResolver
initServletBean
10为事件传播器注册事件监听器.\t\t\t\tregisterListeners()
doRegisterBeanDefinitions
obtainFreshBeanFactory
initRequestToViewNameTranslator
registerBeanDefinitions
DefaultBeanDefinitionDocumentReader
refreshBeanFactory
initHandlerMappings
initLocaleResolver
12初始化容器的生命周期事件处理器,并发布容器的生命周期事件\t\t\t\tfinishRefresh()
init()
6为BeanFactory注册BeanPost事件处理器.BeanPostProcessor是Bean后置处理器,用于监听容器触发的事件 registerBeanPostProcessors(beanFactory)
createWebApplicationContext
3为BeanFactory配置容器特性,例如类加载器、事件处理器等\t\t\tprepareBeanFactory(beanFactory)
refresh()
onRefresh
initMultipartResolver
AbstractXmlApplicationContext
doLoadDocument
AbstractRefreshableApplicationContext
0 条评论
下一页