ApplicationContext appContext = ((SpringConfigExtension) cfg).getAppContext();
log.debug("Loading bean : " + beanName + " from Spring configuration named : " + configName);
Object o = appContext.getBean(beanName);
if (o != null && Mediator.class.isAssignableFrom(o.getClass())) {
Mediator m = (Mediator) o;
return m.mediate(synCtx);
} else {
handleException("Could not find the bean named : " + beanName +
" from the Spring configuration named : " + configName);
}
} else {
handleException("Could not get a reference to a valid Spring configuration named : " + configName);
}
} else if (appContext != null) {
log.debug("Loading bean : " + beanName + " from inline Spring configuration");
Object o = appContext.getBean(beanName);
if (o != null && Mediator.class.isAssignableFrom(o.getClass())) {
Mediator m = (Mediator) o;
return m.mediate(synCtx);
} else {
handleException("Could not find the bean named : " + beanName +
" from the inline Spring configuration");
}