当前位置:网站首页>Beanpostprocessor and beanfactorypostprocessor
Beanpostprocessor and beanfactorypostprocessor
2022-06-29 07:21:00 【wending-Y】
BeanFactoryPostProcessor
For all read bean Can be modified , I've got all of them before Bean Definition , Whether it's xml Or comments
@Component
public class BeanFactoryPostProcessorImp implements BeanFactoryPostProcessor {
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
System.out.println("factory");
System.out.println(beanFactory.getBeanDefinition("simple").getBeanClassName());
}
}
BeanPostProcessor
initializeBean In this method, the post processor is executed
stay bean Before initialization , It can be processed after initialization
@Component
public class BeanPostProcessorImp implements BeanPostProcessor {
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
System.out.println(" Before initialization ");
return bean;
}
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
System.out.println(" After the initialization ");
return bean;
}
}
Conclusion
BeanFactoryPostProcessor Order first
BeanPostProcessor Order after
边栏推荐
- 如何看待软件测试培训?你需要培训吗?
- Daily question 1 - force deduction - there are three consecutive arrays of odd numbers
- Database - Synonyms
- Relevance - correlation analysis
- 电子商务盛行,怎么提高商店转换率?
- Redis (V) of NoSQL database: redis_ Jedis_ test
- Markdown 技能树(1):MarkDown介绍
- QT custom bit operation class
- What is the difference between software engineer and software development? What is the difference between software engineer and software developer?
- QT program packaging and publishing windeployqt tool
猜你喜欢

NoSQL数据库之Redis(四):Redis的发布和订阅

Digital IC Design - UART
【翻译】簇拥而出。构建现代应用程序的设计方法

RPC and RMI

通过keyup监听textarea输入更改按钮样式

Do you really understand "binder copy once"?

mmclassification安装与调试

NoSQL数据库介绍

Uniapp obtains the date implementation of the beginning and end of the previous month and the next month

Domestic code hosting center code cloud
随机推荐
期末总结——Spark
Twitter launches the test of anti abuse tool "safe mode" and adds enabling prompt
uva10891
Differences between JSON objects and JSON strings
Summary of some new datasets proposed by cvpr2021
如何给下属进行授权?
Redis of NoSQL database (I): Installation & Introduction
Qt STL类型迭代器
关于工作方法和高效工作的建议
什么是测试架构师
机器学习笔记 - 时间序列使用机器学习进行预测
2022.6.27-----leetcode.522
Illegal forward reference and enums
Idea integrated code cloud
消息队列之通过幂等设计和原子锁避免重复退款
Testing grpc service with grpcui
示波器 符号
Qt 处理图像数据的类区别(QPixmap、QImage、QPicture)
等保备案主体是谁?在当地网安进行备案是吗?
Do you really understand "binder copy once"?