Merge 9f81ec20f2 into 11d5bd9ffa
This commit is contained in:
commit
0f67e08d45
|
|
@ -148,7 +148,7 @@ public class ReferenceBean<T>
|
|||
private MutablePropertyValues propertyValues;
|
||||
|
||||
// actual reference config
|
||||
private ReferenceConfig referenceConfig;
|
||||
private volatile ReferenceConfig referenceConfig;
|
||||
|
||||
// ReferenceBeanManager
|
||||
private ReferenceBeanManager referenceBeanManager;
|
||||
|
|
@ -423,15 +423,22 @@ public class ReferenceBean<T>
|
|||
|
||||
private Object getCallProxy() throws Exception {
|
||||
if (referenceConfig == null) {
|
||||
referenceBeanManager.initReferenceBean(this);
|
||||
applicationContext
|
||||
.getBean(DubboConfigApplicationListener.class.getName(), DubboConfigApplicationListener.class)
|
||||
.init();
|
||||
logger.warn(
|
||||
CONFIG_DUBBO_BEAN_INITIALIZER,
|
||||
"",
|
||||
"",
|
||||
"ReferenceBean is not ready yet, please make sure to call reference interface method after dubbo is started.");
|
||||
synchronized (LockUtils.getSingletonMutex(applicationContext)) {
|
||||
if (referenceConfig == null) {
|
||||
referenceBeanManager.initReferenceBean(this);
|
||||
applicationContext
|
||||
.getBean(
|
||||
DubboConfigApplicationListener.class.getName(),
|
||||
DubboConfigApplicationListener.class)
|
||||
.init();
|
||||
logger.warn(
|
||||
CONFIG_DUBBO_BEAN_INITIALIZER,
|
||||
"",
|
||||
"",
|
||||
"ReferenceBean is not ready yet, please make sure to "
|
||||
+ "call reference interface method after dubbo is started.");
|
||||
}
|
||||
}
|
||||
}
|
||||
// get reference proxy
|
||||
// Subclasses should synchronize on the given Object if they perform any sort of extended singleton creation
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class DubboConfigApplicationListener
|
|||
}
|
||||
}
|
||||
|
||||
public void init() {
|
||||
public synchronized void init() {
|
||||
// It's expected to be notified at
|
||||
// org.springframework.context.support.AbstractApplicationContext.registerListeners(),
|
||||
// before loading non-lazy singleton beans. At this moment, all BeanFactoryPostProcessor have been processed,
|
||||
|
|
|
|||
Loading…
Reference in New Issue