摘要: 在spring容器初始化bean和销毁bean的以前的操作有很多种, 目前我知道的有:在xml中定义的时候用init-method和destory-method,还有一种就是定义bean的时候实现DisposableBean和InitializingBean 这两个接口,打开Initializing 阅读全文
posted @ 2020-08-10 16:58 edda_huang 阅读(735) 评论(0) 推荐(0) 编辑
摘要: InitializingBean顾名思义,应该是初始化Bean相关的接口。 先看一下该接口都定义了哪些方法: public interface InitializingBean { void afterPropertiesSet() throws Exception; } 看方法名,应该是在读完Pr 阅读全文
posted @ 2020-08-10 16:53 edda_huang 阅读(459) 评论(0) 推荐(0) 编辑