Spring的接口InitializingBean、BeanPostProcessor以及注解@PostConstruct、bean的init-method的执行先后顺序

https://blog.csdn.net/qq_23876769/article/details/86566790

 

BeanPostProcessor的postProcessBeforeInitialization方法
@postConstruct > InitializingBean接口 > @Bean(initMethod)
BeanPostProcessor的postProcessAftrInitialization方法
@preDestroy >DisposableBean接口 > @Bean(destroyMethod)

posted @ 2021-04-05 21:37  chenxiangxiang  阅读(315)  评论(0编辑  收藏  举报