首页 > 编程语言 > 详细

spring的9个后置处理器的详细情况

时间:2020-01-22 14:05:21      阅读:1108      评论:0      收藏:0      [点我收藏+]

从getSingleton方法开始:

sharedInstance = getSingleton(beanName, new ObjectFactory<Object>() {
                        @Override
                        public Object getObject() throws BeansException {
                            try {
                                return createBean(beanName, mbd, args);
                            }
                            catch (BeansException ex) {
                                // Explicitly remove instance from singleton cache: It might have been put there
                                // eagerly by the creation process, to allow for circular reference resolution.
                                // Also remove any beans that received a temporary reference to the bean.
                                destroySingleton(beanName);
                                throw ex;
                            }
                        }
                    });

其中的createBean方法中就有bean的处理器。

beanPostProcess只是处置处理器,最顶层的接口,相当于一个最基本的后置处理器,会在initializationBean中调用。实际上还有很多后置处理器的更多具体实现。

 

spring的9个后置处理器的详细情况

原文:https://www.cnblogs.com/zzq-include/p/12228461.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!