有两个待实现方法:
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException
单例ben的初始化和销毁顺序如下:
bean构造方法->postProcessBeforeInitialization->InitializingBean.afterPropertiesSet()(继承接口并实现)->initMethod(@bean注解属性)->postProcessAfterInitialization
DisposableBean.destroy()(继承接口并实现)->destroyMethod(@bean注解属性)
参考链接:
https://blog.youkuaiyun.com/varyall/article/details/82257202