springResources = patternResolver.getResource(resourceName);
}
if (springResources != null && springResources.exists()) {
if (LOG.isDebugEnabled()) LOG.debug("[RuntimeConfiguration] Configuring additional beans from " + springResources.getURL());
DefaultListableBeanFactory xmlBf = new OptimizedAutowireCapableBeanFactory();
new XmlBeanDefinitionReader(xmlBf).loadBeanDefinitions(springResources);
xmlBf.setBeanClassLoader(classLoader);
String[] beanNames = xmlBf.getBeanDefinitionNames();
if (LOG.isDebugEnabled()) LOG.debug("[RuntimeConfiguration] Found [" + beanNames.length + "] beans to configure");
for (String beanName : beanNames) {
BeanDefinition bd = xmlBf.getBeanDefinition(beanName);
final String beanClassName = bd.getBeanClassName();
Class<?> beanClass = beanClassName == null ? null : ClassUtils.forName(beanClassName, classLoader);
springConfig.addBeanDefinition(beanName, bd);
String[] aliases = xmlBf.getAliases(beanName);
for (String alias : aliases) {
springConfig.addAlias(alias, beanName);
}
if (beanClass != null) {
if (BeanFactoryPostProcessor.class.isAssignableFrom(beanClass)) {
((ConfigurableApplicationContext) springConfig.getUnrefreshedApplicationContext())
.addBeanFactoryPostProcessor((BeanFactoryPostProcessor) xmlBf.getBean(beanName));
}
}
}
}
else if (LOG.isDebugEnabled()) {