【开源中国 APP 全新上线】“动弹” 回归、集成大模型对话、畅读技术报告”
spring我们什么时候使用BeanFactoryPostProcessor,什么时候使用BeanPostProcessor?
前者是在BenFactory的生命周期中产生影响,后者是对Bean的生命周期产生影响,两者的处理目标不同
建议看一下Spring的源码,特别是org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#doCreateBean()方法,这个方法里面涵盖了Spring整个生命周期回调。
前者是在BenFactory的生命周期中产生影响,后者是对Bean的生命周期产生影响,两者的处理目标不同
建议看一下Spring的源码,特别是org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#doCreateBean()方法,这个方法里面涵盖了Spring整个生命周期回调。