编辑: 思念那么浓 | 2012-12-25 |
} protected T doGetBean(final String name, @Nullable final Class requiredType,@Nullable final Object[] args, boolean typeCheckOnly) throws BeansException { final String beanName = transformedBeanName(name);
Object bean;
// Eagerly check singleton cache for manually registered singletons. Object sharedInstance = getSingleton(beanName);
//省略代码 } @Nullable protected Object getSingleton(String beanName, boolean allowEarlyReference) { Object singletonObject = this.singletonObjects.get(beanName);
if (singletonObject == null &
&
isSingletonCurrentlyInCreation (beanName)) { synchronized (this.singletonObjects) { singletonObject = this.earlySingletonObjects.get(beanName);
if (singletonObject == null &
&
allowEarlyReference) { ObjectFactory singletonFactory = this.singletonFacto........