ImportConfiguration[] importConfigurations = loadImportConfigurations(contextId);
for (int i = 0; i < importConfigurations.length; i++) {
ImportConfiguration importConfiguration = importConfigurations[i];
BeanDefinitionReader reader = createBeanDefinitionReader(
importConfiguration.readerClass, getRegistry());
if (reader == null) {
if (log.isDebugEnabled()) {
log.debug("creating default reader: [class="
+ XmlBeanDefinitionReader.class.getName() + "]");
}
reader = new XmlBeanDefinitionReader(getRegistry());
}
initReader(reader, importConfiguration.classLoader);
URL[] resourceURLs = importConfiguration.resources;
List resources = new ArrayList();
for (int j = 0; j < resourceURLs.length; j++) {
resources.add(new UrlResource(resourceURLs[j]));
}
count += reader.loadBeanDefinitions((Resource[]) resources
.toArray(new Resource[resources.size()]));
}
if (log.isDebugEnabled()) {
log.debug("loaded beans count: [" + count + "]");