@ -279,7 +279,25 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
@@ -279,7 +279,25 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
if(logger.isDebugEnabled()){
logger.debug("Creating shared instance of singleton bean '"+beanName+"'");
}
beforeSingletonCreation(beanName);
try{
beforeSingletonCreation(beanName);
}
catch(BeanCurrentlyInCreationExceptionex){
if(locked){
throwex;
}
// Try late locking for waiting on specific bean to be finished.
this.singletonLock.lock();
locked=true;
// Singleton object should have appeared in the meantime.