|
|
|
@ -303,12 +303,11 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements |
|
|
|
beforeSingletonCreation(beanName); |
|
|
|
beforeSingletonCreation(beanName); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (BeanCurrentlyInCreationException ex) { |
|
|
|
catch (BeanCurrentlyInCreationException ex) { |
|
|
|
if (locked) { |
|
|
|
|
|
|
|
this.lenientCreationLock.lock(); |
|
|
|
this.lenientCreationLock.lock(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
while ((singletonObject = this.singletonObjects.get(beanName)) == null) { |
|
|
|
while ((singletonObject = this.singletonObjects.get(beanName)) == null) { |
|
|
|
if (!this.singletonsInLenientCreation.contains(beanName)) { |
|
|
|
if (!this.singletonsInLenientCreation.contains(beanName)) { |
|
|
|
throw ex; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
try { |
|
|
|
this.lenientCreationFinished.await(); |
|
|
|
this.lenientCreationFinished.await(); |
|
|
|
@ -317,11 +316,15 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements |
|
|
|
Thread.currentThread().interrupt(); |
|
|
|
Thread.currentThread().interrupt(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return singletonObject; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
finally { |
|
|
|
finally { |
|
|
|
this.lenientCreationLock.unlock(); |
|
|
|
this.lenientCreationLock.unlock(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (singletonObject != null) { |
|
|
|
|
|
|
|
return singletonObject; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (locked) { |
|
|
|
|
|
|
|
throw ex; |
|
|
|
} |
|
|
|
} |
|
|
|
// Try late locking for waiting on specific bean to be finished.
|
|
|
|
// Try late locking for waiting on specific bean to be finished.
|
|
|
|
this.singletonLock.lock(); |
|
|
|
this.singletonLock.lock(); |
|
|
|
|