private void loadBeanDefinitionsFromImportedResources(final Map<String, Class<? extends BeanDefinitionReader>> importedResources) {

    final Map<Class<?>, BeanDefinitionReader> readerInstanceCache = new HashMap<Class<?>, BeanDefinitionReader>();
    for (final Map.Entry<String, Class<? extends BeanDefinitionReader>> entry : importedResources.entrySet()) {
      final String resource = entry.getKey();
      final Class<? extends BeanDefinitionReader> readerClass = entry.getValue();
      if (!readerInstanceCache.containsKey(readerClass)) {
        try {
          // Instantiate the specified BeanDefinitionReader
          final BeanDefinitionReader readerInstance = readerClass.getConstructor(BeanDefinitionRegistry.class).newInstance(this.registry);
          // Delegate the current ResourceLoader to it if possible
          if (readerInstance instanceof AbstractBeanDefinitionReader) {
            final AbstractBeanDefinitionReader abdr = ((AbstractBeanDefinitionReader) readerInstance);
            abdr.setResourceLoader(this.resourceLoader);
            abdr.setEnvironment(this.environment);
          }
          readerInstanceCache.put(readerClass, readerInstance);
        } catch (final Exception ex) {
          throw new IllegalStateException("Could not instantiate BeanDefinitionReader class [" + readerClass.getName() + "]");
        }
      }
      final BeanDefinitionReader reader = readerInstanceCache.get(readerClass);
      // TODO SPR-6310: qualify relative path locations as done in AbstractContextLoader.modifyLocations
      reader.loadBeanDefinitions(resource);
    }
  }