DATACMNS-591 - RepositoryConfigurationDelegate now uses Environment and ResourceLoader everywhere.

We now also use the Environment and ResourceLoader for the component scan to detect whether multiple Spring Data modules are on the classpath.
This commit is contained in:
Oliver Gierke
2014-11-24 22:38:48 +01:00
parent e14ba802a7
commit 806214e332

View File

@@ -159,12 +159,13 @@ public class RepositoryConfigurationDelegate {
*/
private boolean multipleStoresDetected() {
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false,
environment);
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
scanner.setEnvironment(environment);
scanner.setResourceLoader(resourceLoader);
scanner.addIncludeFilter(new LenientAssignableTypeFilter(RepositoryFactorySupport.class));
int numberOfModulesFound = scanner.findCandidateComponents(MODULE_DETECTION_PACKAGE).size();
if (numberOfModulesFound > 1) {
if (scanner.findCandidateComponents(MODULE_DETECTION_PACKAGE).size() > 1) {
LOGGER.debug(MULTIPLE_MODULES);
return true;
}