spring-refresh-prepareBeanFactory-ApplicationListenerDetector
在spring启动刷新的时候,会有一个准备工作也就是prepareBeanFactory方法,里面会添加BeanPostProcessor,也就是本文要说的ApplicationListenerDetector
prepareBeanFactory(beanFactory);
protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory) {
....
beanFactory.addBeanPostProcessor(new ApplicationListenerDetector(this));
....
}
ApplicationListenerDetector属于BeanPostProcessor类型,所以任何bean的实例化,包括spring自带的bean,只要调用doGetBean创建bean
spring-refresh-prepareBeanFactory-ApplicationListenerDetector最先出现在Python成神之路。
共有 0 条评论