|
|
|
@ -392,6 +392,9 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac |
|
|
|
Object result = existingBean; |
|
|
|
Object result = existingBean; |
|
|
|
for (BeanPostProcessor beanProcessor : getBeanPostProcessors()) { |
|
|
|
for (BeanPostProcessor beanProcessor : getBeanPostProcessors()) { |
|
|
|
result = beanProcessor.postProcessBeforeInitialization(result, beanName); |
|
|
|
result = beanProcessor.postProcessBeforeInitialization(result, beanName); |
|
|
|
|
|
|
|
if (result == null) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -402,6 +405,9 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac |
|
|
|
Object result = existingBean; |
|
|
|
Object result = existingBean; |
|
|
|
for (BeanPostProcessor beanProcessor : getBeanPostProcessors()) { |
|
|
|
for (BeanPostProcessor beanProcessor : getBeanPostProcessors()) { |
|
|
|
result = beanProcessor.postProcessAfterInitialization(result, beanName); |
|
|
|
result = beanProcessor.postProcessAfterInitialization(result, beanName); |
|
|
|
|
|
|
|
if (result == null) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -682,11 +688,14 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected Object getEarlyBeanReference(String beanName, RootBeanDefinition mbd, Object bean) { |
|
|
|
protected Object getEarlyBeanReference(String beanName, RootBeanDefinition mbd, Object bean) { |
|
|
|
Object exposedObject = bean; |
|
|
|
Object exposedObject = bean; |
|
|
|
if (!mbd.isSynthetic() && hasInstantiationAwareBeanPostProcessors()) { |
|
|
|
if (bean != null && !mbd.isSynthetic() && hasInstantiationAwareBeanPostProcessors()) { |
|
|
|
for (BeanPostProcessor bp : getBeanPostProcessors()) { |
|
|
|
for (BeanPostProcessor bp : getBeanPostProcessors()) { |
|
|
|
if (bp instanceof SmartInstantiationAwareBeanPostProcessor) { |
|
|
|
if (bp instanceof SmartInstantiationAwareBeanPostProcessor) { |
|
|
|
SmartInstantiationAwareBeanPostProcessor ibp = (SmartInstantiationAwareBeanPostProcessor) bp; |
|
|
|
SmartInstantiationAwareBeanPostProcessor ibp = (SmartInstantiationAwareBeanPostProcessor) bp; |
|
|
|
exposedObject = ibp.getEarlyBeanReference(exposedObject, beanName); |
|
|
|
exposedObject = ibp.getEarlyBeanReference(exposedObject, beanName); |
|
|
|
|
|
|
|
if (exposedObject == null) { |
|
|
|
|
|
|
|
return exposedObject; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|