INNER CODE UNIT · Java
getBean
chaokunyang/jkes · jkes-boot/jkes-spring-data-jpa/src/main/java/com/timeyang/jkes/spring/jpa/ContextSupport.java:40
public Object getBean(Class<?> requiredType) throws InterruptedException {
synchronized (lock) {
while(this.applicationContext == null)
lock.wait();
}
try {
return this.applicationContext.getBean(requiredType);
}catch (NoSuchBeanDefinitionException e) {
return null;
}
}
}