1. 生命周期
- 定义
- 初始化
- 使用
- 销毁
2. 初始化
- 实现
org.springframwork.beans.factory.InitializingBean接口,覆盖
afterPropertiesSet`方法 - 配置init-method
3. 销毁
- 实现
org.springframwork.beans.factory.DisposableBean
接口,覆盖destroy
方法 - 配置
destroy-method
org.springframwork.beans.factory.InitializingBean接口,覆盖
afterPropertiesSet`方法org.springframwork.beans.factory.DisposableBean
接口,覆盖destroy
方法destroy-method