@ -990,9 +990,17 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
@@ -990,9 +990,17 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
@ -269,13 +269,15 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
@@ -269,13 +269,15 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
// Fallback as of 6.2: process given singleton bean outside of singleton lock.
// Thread-safe exposure is still guaranteed, there is just a risk of collisions
// when triggering creation of other beans as dependencies of the current bean.
if(logger.isInfoEnabled()){
logger.info("Obtaining singleton bean '"+beanName+"' in thread \""+
Thread.currentThread().getName()+"\" while other thread holds "+
"singleton lock for other beans "+this.singletonsCurrentlyInCreation);
@ -117,7 +117,15 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
@@ -117,7 +117,15 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
@ -130,11 +138,13 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
@@ -130,11 +138,13 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
}
else{
if(shouldPostProcess){
if(isSingletonCurrentlyInCreation(beanName)){
// Temporarily return non-post-processed object, not storing it yet
returnobject;
if(locked){
if(isSingletonCurrentlyInCreation(beanName)){
// Temporarily return non-post-processed object, not storing it yet
@ -143,7 +153,9 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
@@ -143,7 +153,9 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
"Post-processing of FactoryBean's singleton object failed",ex);
}
finally{
afterSingletonCreation(beanName);
if(locked){
afterSingletonCreation(beanName);
}
}
}
if(containsSingleton(beanName)){
@ -154,7 +166,9 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
@@ -154,7 +166,9 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg