List of usage examples for org.springframework.context.annotation ClassPathScanningCandidateComponentProvider setEnvironment
public void setEnvironment(Environment environment)
From source file:org.agilemicroservices.autoconfigure.orm.RepositoryConfigurationDelegate.java
/** * Scans {@code repository.support} packages for implementations of {@link RepositoryFactorySupport}. Finding more * than a single type is considered a multi-store configuration scenario which will trigger stricter repository * scanning.// w ww . jav a 2s .c o m * * @return */ private boolean multipleStoresDetected() { ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider( false); scanner.setEnvironment(environment); scanner.setResourceLoader(resourceLoader); scanner.addIncludeFilter(new LenientAssignableTypeFilter(RepositoryFactorySupport.class)); if (scanner.findCandidateComponents(MODULE_DETECTION_PACKAGE).size() > 1) { LOGGER.debug(MULTIPLE_MODULES); return true; } return false; }