Spring的ApplicationContext的生命周期
来源:互联网 发布:死寂木偶比利淘宝 编辑:程序博客网 时间:2024/06/18 15:37
一:ApplicationContext生命周期
bean被载入到容器中时,他的生命周期就开始了。
bean工厂在一个bean可以使用前完成很多 工作:
1.容器寻找bean的定义信息并实例化。
2.使用依赖注入,spring按bean定义信息配置bean的所有属性。
3.若bean实现了BeanNameAware接口,工厂调用Bean的setBeanName()方法传递bean的ID。
4.若bean实现了BeanFactoryAware接口,工厂调用setBeanFactory()方法传入工厂自身。
5.若BeanPostProcessor和bean关联,则它们的postProcessBeforeInitialization()方法被调用。
6.若bean指定了ini-method方法、,它将被调用。
7.最后,若有BeanPostProcessor和bean关联,则它们的postProcessAfterInitialization()方法被调用。
二:流程图:
阅读全文
2 0
- Spring的ApplicationContext的生命周期
- Spring中bean的生命周期---在ApplicationContext中
- Spring中BeanFactory和ApplicationContext的生命周期及其区别详解
- ApplicationContext中Bean的生命周期
- ApplicationContext中Bean的生命周期
- Spring bean生命周期---ApplicationContext
- spring不懂的applicationContext
- spring 的 applicationcontext.xml
- Spring的applicationContext.xml
- spring 的 applicationcontext.xml
- Spring的applicationContext.xml
- Spring ApplicationContext的应用
- spring的applicationContext.xml
- spring的applicationContext.xml
- Spring的Applicationcontext配置文件
- spring的applicationContext模板
- Spring的ApplicationContext
- spring中在ApplicationContext或在BeanFactory中Bean的生命周期总结
- web.xml中load-on-startup的作用
- notify和notifyAll
- Java中break的第三种用法
- js 光标从一个框输入完之后自动跳到另一个框
- android中播放视频
- Spring的ApplicationContext的生命周期
- Liunx上安装及使用Nginx
- 9.线程
- servlet jsp一套完整的增删查改思路
- 多线程下的单例模式
- java 观察者模式 简明版
- Caffe中学习率策略应如何选择
- java js 文件图片通过FTP进行上传和同步
- Android实现https单双向认证及自签名证书生成方法