XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(
(BeanDefinitionRegistry) context.getBeanFactory());
xmlReader.setEnvironment(context.getEnvironment());
GroovyBeanDefinitionReader groovyReader = new GroovyBeanDefinitionReader(
(BeanDefinitionRegistry) context.getBeanFactory());
groovyReader.setEnvironment(context.getEnvironment());
for (String locationPattern : getLocations()) {
try {
Resource[] resources = resourceResolver.getResources(locationPattern);
logger.info("resolving resource location pattern {}", locationPattern);
for (Resource resource : resources) {
if (resource.getFilename() != null) {
if (resource.getFilename().endsWith(".xml")) {
logger.info("loading XD extensions from {}", resource.getFilename());
xmlReader.loadBeanDefinitions(resource);
}
else if (resource.getFilename().endsWith(".groovy")) {
groovyReader.loadBeanDefinitions(resource);
}
}
}
}
catch (IOException e) {