Module spring.data.commons
Class CustomRepositoryImplementationDetector
java.lang.Object
org.springframework.data.repository.config.CustomRepositoryImplementationDetector
Detects the custom implementation for a
Repository instance. If
configured with a ImplementationDetectionConfiguration at construction time, the necessary component scan is
executed on first access, cached and its result is the filtered on every further implementation lookup according to
the given ImplementationDetectionConfiguration. If none is given initially, every invocation to
detectCustomImplementation(ImplementationLookupConfiguration) will issue a new component scan.- Author:
- Oliver Gierke, Mark Paluch, Christoph Strobl, Peter Rietzler, Jens Schauder, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionCustomRepositoryImplementationDetector(Environment environment, ResourceLoader resourceLoader) CustomRepositoryImplementationDetector(Environment environment, ResourceLoader resourceLoader, ImplementationDetectionConfiguration configuration) Creates a newCustomRepositoryImplementationDetectorwith the givenEnvironment,ResourceLoaderandImplementationDetectionConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionTries to detect a custom implementation for a repository bean by classpath scanning.
-
Constructor Details
-
CustomRepositoryImplementationDetector
public CustomRepositoryImplementationDetector(Environment environment, ResourceLoader resourceLoader, ImplementationDetectionConfiguration configuration) Creates a newCustomRepositoryImplementationDetectorwith the givenEnvironment,ResourceLoaderandImplementationDetectionConfiguration. The latter will be registered for a one-time component scan for implementation candidates that will the be used and filtered in all subsequent calls todetectCustomImplementation(ImplementationLookupConfiguration).- Parameters:
environment- must not be null.resourceLoader- must not be null.configuration- must not be null.
-
CustomRepositoryImplementationDetector
public CustomRepositoryImplementationDetector(Environment environment, ResourceLoader resourceLoader) Creates a newCustomRepositoryImplementationDetectorwith the givenEnvironmentandResourceLoader. Calls todetectCustomImplementation(ImplementationLookupConfiguration)will issue scans for- Parameters:
environment- must not be null.resourceLoader- must not be null.
-
-
Method Details
-
detectCustomImplementation
public Optional<AbstractBeanDefinition> detectCustomImplementation(ImplementationLookupConfiguration lookup) Tries to detect a custom implementation for a repository bean by classpath scanning.- Parameters:
lookup- must not be null.- Returns:
- the
AbstractBeanDefinitionof the custom implementation or null if none found.
-