解释 Spring 框架中 bean 的生命周期?
2024-08-31 19:15:12
Spring 容器 从 XML 文件中读取 bean 的定义,并实例化 bean。
Spring 根据 bean 的定义填充所有的属性。
如果 bean 实现了 BeanNameAware 接口,Spring 传递 bean 的 ID 到
setBeanName 方法。
如果 Bean 实现了 BeanFactoryAware 接口, Spring 传递
beanfactory 给 setBeanFactory 方法。
如果有任何与 bean 相关联的 BeanPostProcessors,Spring 会在
postProcesserBeforeInitialization()方法内调用它们。
如果 bean 实现 IntializingBean 了,调用它的 afterPropertySet 方法,
如果 bean 声明了初始化方法,调用此初始化方法。
如果有 BeanPostProcessors 和 bean 关联,这些 bean 的
postProcessAfterInitialization() 方法将被调用。
如果 bean 实现了 DisposableBean,它将调用 destroy()方法。
最新文章
- Electronic oscillator
- CodeBlock 使用TextOut出错
- haproxy 安装 各个参数的测试
- 测试-Animator的“当前剪辑CurrentAnimatorStateInfo”
- iOS开发——企业证书(免审核 299$)
- 【Bug笔记】The superclass &;quot;javax.servlet.http.HttpServlet&;quot; was not found on the Java Build Path
- Jmeter+Jenkins的聚合报告中添加QPS栏目显示
- VMware14.0.0 版本虚拟机安装Ubuntu16.04 LTS版本Linux系统(多图详细步骤)
- 20165314《网络对抗技术》week1 Exp0 Kali安装
- hbase_1
- 【Linux】【Java】CentOS7安装最新版Java1.8.191运行开发环境
- maya shell 和 UV shell 的区别
- 《DSP using MATLAB》Problem 7.5
- hdu5157 Harry and magic string【manacher】
- Bytom矿池接入协议指南
- Java SE-基本数据类型对应包装类
- 阿里云CentOS 7服务器挂载数据盘
- angularAMD快速入门
- BZOJ1879_Bill的挑战_KEY
- Intel MKL(Math Kernel Library)
热门文章
- BI系统:发挥大数据的价值
- vue项目npm run dev 报错error in ./src/main.js Module build failed: Error: Cannot find module 'babel-plugin-syntax-jsx'
- WebSocket长连接
- php 23种设计模式 - 迭代器模式
- 如何实现 UITabbarController 的 State Preservation?
- C盘爆满,你的专属清道夫来啦
- 命令行安装django以及新建项目及应用
- ArcMap操作练习题目及答案
- 如何构建Docker镜像
- 使用python自动发放员工工资条到个人邮箱