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

从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中调用。实际上还有很多后置处理器的更多具体实现。

猜你喜欢

转载自www.cnblogs.com/zzq-include/p/12228461.html