Spring-03-什么是BeanPostProcessor

它就是一个接口,实现了它就有两个能力,在创建Bean的过程中会去回调到方法,让你干预到Bean的创建过程

1 实例化前

1
2
3
default @Nullable Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return bean;
}

2 实例化后

1
2
3
default @Nullable Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}

Spring-03-什么是BeanPostProcessor
https://bannirui.github.io/2023/03/11/Spring/Spring-03-什么是BeanPostProcessor/
作者
dingrui
发布于
2023年3月11日
许可协议