Spring-ApplicationContext refresh的流程

refresh的12个步骤
 
      1.prepareRefresh //完成整体的准备工作
        2.obtainFreshBeanFactory //2-6完成beanfactory的准备工作
        3.prepareBeanFactory
        4.postProcessBeanFactory
        5.invokeBeanFactoryPostProcessors
        6.registerBeanPostProcessors
        7.initMessageSource //7-12ApplicationContext 独有的一些功能的准备
        8.initApplicationEventMulticaster
        9.onRefresh
        10.registerListeners
        11.finishBeanFactoryInitialization //创建单例对象 在这里
        12.finishRefresh

Spring ApplicationContext refresh的流程_KNCCB的博客-CSDN博客ApplicationContext refresh的流程12个步骤:1.prepareRefresh1.这一步创建和准备了Environment对象初始化键值信息。作用之一是为后续@Value,值注入提供。2.obtainFreshBeanFactory1.BeanFactory的作用是负责bean的创建、依赖注入和初始化。2.BeanDefinition作为bean的设计蓝图,规定了bean的特征。BeanDefinition中的bean信息可以从xml、配置类或扫描获取。3.prehttps://blog.csdn.net/weixin_42338191/article/details/124729113?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165640673516782390558214%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=165640673516782390558214&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~pc_rank_34-6-124729113-null-null.142^v24^pc_rank_34,157^v15^new_3&utm_term=ApplicationContext+refresh&spm=1018.2226.3001.4187

Spring--ApplicationContext容器refresh过程_想当程序媛的秀妍的博客-CSDN博客文章目录构造函数:设置配置路径扩展功能源码整体的步骤:具体分析prepareRefresh刷新上下文的准备工作obtainFreshBeanFactory(读取xml并初始化BeanFactory)BeanFactory的后处理激活注册的BeanFactoryPostProcessorBeanFactoryPostProcessor的典型应用:PropertyPlaceholderConfigurer自定义BeanFactoryPostProcessor激活BeanFactoryPostProcessor注https://blog.csdn.net/m0_52675592/article/details/117079442?ops_request_misc=&request_id=&biz_id=102&utm_term=ApplicationContext%20refresh&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-3-117079442.142^v24^pc_rank_34,157^v15^new_3&spm=1018.2226.3001.4187  Spring源码私家笔记—— ApplicationContext.refresh()方法浅析_请给我一根烟的时间的博客-CSDN博客_applicationcontext refresh从本章开始我们将开始进入Spring容器真正的刷新启动过程,直接点击或者debugger进入AbstractApplicationContext的refresh()方法。这里再次提示一下大家,在先前的提到过的“胸有大纲,心中不慌”,大家务必要克制自己挨个debugger进refresh的每个方法进行查看的冲动。大家想啊,Spring的作者把一个个的对象和方法封装出来,就是想要屏蔽底层实现的复杂性,那我们就按照这一个个方法名先理解个大概。建议大家直接把springframework的官方源码clone下来,https://blog.csdn.net/mytream/article/details/124575312?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165640673516780366567298%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=165640673516780366567298&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-124575312-null-null.142^v24^pc_rank_34,157^v15^new_3&utm_term=ApplicationContext+refresh&spm=1018.2226.3001.4187


版权声明:本文为TIANJIAWEN原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
THE END
< <上一篇
下一篇>>