初始化:
 1)@PostConstruct注解
 2)afterPropertiesSet(实现InitializingBean接口而定义的)
 3)init-method
 销毁:
 1)@PreDestroy注解
 2)destroy(实现DisposableBean接口而定义的)
 3)自定义的destroy方法
                
Spring6.0官方文档示例:(27)bean的多个生命周期方法共存时的执行顺序
阅读 61
2023-11-10
初始化:
 1)@PostConstruct注解
 2)afterPropertiesSet(实现InitializingBean接口而定义的)
 3)init-method
 销毁:
 1)@PreDestroy注解
 2)destroy(实现DisposableBean接口而定义的)
 3)自定义的destroy方法
                
相关推荐
精彩评论(0)