@Override
public void refresh() throws BeansException, IllegalStateException {
synchronized (this.startupShutdownMonitor) {
// Prepare this context for refreshing.
prepareRefresh(); // Tell the subclass to refresh the internal bean factory.
ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory(); // Prepare the bean factory for use in this context.
prepareBeanFactory(beanFactory); try {
// Allows post-processing of the bean factory in context subclasses.
postProcessBeanFactory(beanFactory); // Invoke factory processors registered as beans in the context.
invokeBeanFactoryPostProcessors(beanFactory); // Register bean processors that intercept bean creation.
registerBeanPostProcessors(beanFactory); // Initialize message source for this context.
initMessageSource(); // Initialize event multicaster for this context.
initApplicationEventMulticaster(); // Initialize other special beans in specific context subclasses.
onRefresh(); // Check for listener beans and register them.
registerListeners(); // Instantiate all remaining (non-lazy-init) singletons.
finishBeanFactoryInitialization(beanFactory); // Last step: publish corresponding event.
finishRefresh();
} catch (BeansException ex) {
if (logger.isWarnEnabled()) {
logger.warn("Exception encountered during context initialization - " +
"cancelling refresh attempt: " + ex);
} // Destroy already created singletons to avoid dangling resources.
destroyBeans(); // Reset 'active' flag.
cancelRefresh(ex); // Propagate exception to caller.
throw ex;
} finally {
// Reset common introspection caches in Spring's core, since we
// might not ever need metadata for singleton beans anymore...
resetCommonCaches();
}
}
}

包括BeanDefinition的Resource定位,载入,注册三个基本过程

三个过程分开,并使用不同的模块来完成,如何使用相应的ResourceLoader,BeanDefinitionReader等模块,通过这样的设计方式,可以让用户更加啊灵活的对这三个过程进行剪裁或扩展

最新文章

  1. JavaScript自定义浏览器滚动条兼容IE、 火狐和chrome
  2. Linux基础介绍【第五篇】
  3. 从零开始学 Java - Spring 支持 CORS 请求踩的坑
  4. hadoop yarn running beyond physical memory used
  5. ·string和date转化以及数据库时间比较
  6. linq学习笔记:将List<T> 转换为 Dictionary<T Key,T Value>
  7. 【开源框架】Android之史上最全最简单最有用的第三方开源库收集整理,有助于快速开发,欢迎各位网友补充完善
  8. php 链接中加参数传递
  9. Hexo+NextT第三方服务调用【4】
  10. 结构-行为-样式-angularJs ngAnimate(Js实现)
  11. JAVA基础-抽象类
  12. 视觉SLAM
  13. webapi 使用Autofac 开发经历
  14. Azure Pipelines-部署代理问题
  15. HDU 6495 冰水挑战
  16. Qt中信号(signal)和槽(slot)的几种关联方法
  17. UITabView使用详解
  18. jquery 加載
  19. mysql----------阿里云RDS导入导出
  20. VBA 代码

热门文章

  1. 在阿里云Ubuntu 14.04.5 LTS下安装nethogs0.8.5
  2. POI CellStyle 中样式覆盖问题
  3. 深入了解Redis(8)-高可用方案
  4. sqlsugar入门(3)-DateTime.ToString("yyyy-MM-dd HH:mm:ss.fff")源码修改
  5. Spark: JAVA_HOME is not set
  6. mysql 一主多从环境搭建(亲测)
  7. HashMap的put kv,是如何扩容的?
  8. R语言factor类型转numeric
  9. 痞子衡嵌入式:RT-UFL - 一个适用全平台i.MXRT的超级下载算法设计
  10. 写博客真的很枯燥,更麻烦的是我还不会MD,排版太不友好了啊。