Class RepositoryRegistrationAotProcessor
java.lang.Object
org.springframework.data.repository.config.RepositoryRegistrationAotProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.aot.BeanRegistrationAotProcessor
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanFactoryAware
public class RepositoryRegistrationAotProcessor
extends Object
implements org.springframework.beans.factory.aot.BeanRegistrationAotProcessor, org.springframework.beans.factory.BeanFactoryAware
BeanRegistrationAotProcessor
responsible processing and providing AOT configuration for repositories.
Processes repository factory beans
to provide generic type information to the
AOT tooling to allow deriving target type from the bean definition
. If generic types do
not match due to customization of the factory bean by the user, at least the target repository type is provided via
the FactoryBean.OBJECT_TYPE_ATTRIBUTE
.
With contribute(AotRepositoryContext, GenerationContext)
, stores can
provide custom logic for contributing additional (eg. reflection) configuration. By default, reflection configuration
will be added for types reachable from the repository declaration and query methods as well as all used
annotations
from the org.springframework.data namespace.
RepositoryConfigurationExtension.getRepositoryAotProcessor()
and
gets added by the RepositoryConfigurationDelegate
.- Since:
- 3.0
- Author:
- Christoph Strobl, John Blum
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
contribute
(AotRepositoryContext repositoryContext, org.springframework.aot.generate.GenerationContext generationContext) protected void
contributeType
(Class<?> type, org.springframework.aot.generate.GenerationContext generationContext) protected org.springframework.beans.factory.config.ConfigurableListableBeanFactory
protected org.apache.commons.logging.Log
protected RepositoryConfiguration<?>
getRepositoryMetadata
(org.springframework.beans.factory.support.RegisteredBean bean) protected void
protected void
protected RepositoryRegistrationAotContribution
newRepositoryRegistrationAotContribution
(org.springframework.beans.factory.support.RegisteredBean repositoryBean) org.springframework.beans.factory.aot.BeanRegistrationAotContribution
processAheadOfTime
(org.springframework.beans.factory.support.RegisteredBean bean) void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory) void
setConfigMap
(Map<String, RepositoryConfiguration<?>> configMap) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.aot.BeanRegistrationAotProcessor
isBeanExcludedFromAotProcessing
-
Constructor Details
-
RepositoryRegistrationAotProcessor
public RepositoryRegistrationAotProcessor()
-
-
Method Details
-
processAheadOfTime
@Nullable public org.springframework.beans.factory.aot.BeanRegistrationAotContribution processAheadOfTime(org.springframework.beans.factory.support.RegisteredBean bean) - Specified by:
processAheadOfTime
in interfaceorg.springframework.beans.factory.aot.BeanRegistrationAotProcessor
-
contribute
protected void contribute(AotRepositoryContext repositoryContext, org.springframework.aot.generate.GenerationContext generationContext) -
newRepositoryRegistrationAotContribution
protected RepositoryRegistrationAotContribution newRepositoryRegistrationAotContribution(org.springframework.beans.factory.support.RegisteredBean repositoryBean) -
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
- Throws:
org.springframework.beans.BeansException
-
getBeanFactory
protected org.springframework.beans.factory.config.ConfigurableListableBeanFactory getBeanFactory() -
setConfigMap
-
getConfigMap
-
getRepositoryMetadata
@Nullable protected RepositoryConfiguration<?> getRepositoryMetadata(org.springframework.beans.factory.support.RegisteredBean bean) -
getLogger
protected org.apache.commons.logging.Log getLogger() -
logDebug
-
logTrace
-
contributeType
protected void contributeType(Class<?> type, org.springframework.aot.generate.GenerationContext generationContext)
-