Class AotRepositoryContextSupport
java.lang.Object
org.springframework.data.repository.config.AotRepositoryContextSupport
- All Implemented Interfaces:
EnvironmentCapable, AotContext, AotRepositoryContext
Support class for
AotRepositoryContext implementations delegating to an underlying AotContext.- Since:
- 4.0
- Author:
- Mark Paluch
-
Nested Class Summary
Nested classes/interfaces inherited from interface AotContext
AotContext.IntrospectedBeanDefinition, AotContext.TypeIntrospector -
Field Summary
Fields inherited from interface AotContext
GENERATED_REPOSITORIES_ENABLED, GENERATED_REPOSITORIES_JSON_ENABLED -
Constructor Summary
ConstructorsConstructorDescriptionAotRepositoryContextSupport(AotContext aotContext) Create a newAotRepositoryContextSupportgiven theAotContext. -
Method Summary
Modifier and TypeMethodDescriptionvoidcontributeTypeConfigurations(GenerationContext generationContext) Contribute type configurations to the givenGenerationContext.Returns a reference to theConfigurableListableBeanFactorybacking thisAotContext.@Nullable ClassLoaderReturns a newTypeScannerused to scan fortypesthat will be contributed to the AOT processing infrastructure.booleanisGeneratedRepositoriesEnabled(@Nullable String moduleName) Checks if repository code generation is enabled for a given module by checking environment variables for general enablement (AotContext.GENERATED_REPOSITORIES_ENABLED) and store-specific ones following the pattern spring.aot.<module-name>.repositories.enabled.booleanChecks if repository metadata file writing is enabled by checking environment variables for general enablement (AotContext.GENERATED_REPOSITORIES_JSON_ENABLED)voidtypeConfiguration(Class<?> type, Consumer<AotTypeConfiguration> configurationConsumer) Obtain aAotTypeConfigurationfor the givenResolvableTypeto customize the AOT processing for the given type.voidtypeConfiguration(ResolvableType resolvableType, Consumer<AotTypeConfiguration> configurationConsumer) Obtain aAotTypeConfigurationfor the givenResolvableTypeto customize the AOT processing for the given type.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AotContext
introspectBeanDefinition, introspectBeanDefinition, introspectType, scanPackageForTypesMethods inherited from interface AotRepositoryContext
getBasePackages, getBeanName, getConfigurationSource, getIdentifyingAnnotations, getModuleName, getRepositoryInformation, getResolvedAnnotations, getResolvedTypes
-
Constructor Details
-
AotRepositoryContextSupport
Create a newAotRepositoryContextSupportgiven theAotContext.- Parameters:
aotContext-
-
-
Method Details
-
isGeneratedRepositoriesEnabled
Description copied from interface:AotContextChecks if repository code generation is enabled for a given module by checking environment variables for general enablement (AotContext.GENERATED_REPOSITORIES_ENABLED) and store-specific ones following the pattern spring.aot.<module-name>.repositories.enabled.AotContext.GENERATED_REPOSITORIES_ENABLEDacts as a main switch, if disabled, store specific flags have no effect.Unset properties are considered being true.
- Specified by:
isGeneratedRepositoriesEnabledin interfaceAotContext- Parameters:
moduleName- name of the module. Can be null or empty, in which case it will only check the generalAotContext.GENERATED_REPOSITORIES_ENABLEDflag.- Returns:
- indicator if repository code generation is enabled.
-
isGeneratedRepositoriesMetadataEnabled
public boolean isGeneratedRepositoriesMetadataEnabled()Description copied from interface:AotContextChecks if repository metadata file writing is enabled by checking environment variables for general enablement (AotContext.GENERATED_REPOSITORIES_JSON_ENABLED)Unset properties are considered being true.
- Specified by:
isGeneratedRepositoriesMetadataEnabledin interfaceAotContext- Returns:
- indicator if repository metadata should be written
-
getBeanFactory
Description copied from interface:AotContextReturns a reference to theConfigurableListableBeanFactorybacking thisAotContext.- Specified by:
getBeanFactoryin interfaceAotContext- Returns:
- a reference to the
ConfigurableListableBeanFactorybacking thisAotContext. - See Also:
-
getEnvironment
- Specified by:
getEnvironmentin interfaceEnvironmentCapable
-
getClassLoader
Description copied from interface:AotContextReturns theClassLoaderused by thisAotContextto resolvetypes. By default, this is the sameClassLoaderused by theBeanFactoryto resolvetypesdeclared in bean definitions.- Specified by:
getClassLoaderin interfaceAotContext- Returns:
- the
ClassLoaderused by thisAotContextto resolvetypes. - See Also:
-
getRequiredClassLoader
Description copied from interface:AotContextReturns the requiredClassLoaderused by thisAotContextto resolvetypes. By default, this is the sameClassLoaderused by theBeanFactoryto resolvetypesdeclared in bean definitions.- Specified by:
getRequiredClassLoaderin interfaceAotContext- Returns:
- the
ClassLoaderused by thisAotContextto resolvetypes.
-
getTypeScanner
Description copied from interface:AotContextReturns a newTypeScannerused to scan fortypesthat will be contributed to the AOT processing infrastructure.- Specified by:
getTypeScannerin interfaceAotContext- Returns:
- a
TypeScannerused to scan fortypesthat will be contributed to the AOT processing infrastructure. - See Also:
-
typeConfiguration
public void typeConfiguration(ResolvableType resolvableType, Consumer<AotTypeConfiguration> configurationConsumer) Description copied from interface:AotContextObtain aAotTypeConfigurationfor the givenResolvableTypeto customize the AOT processing for the given type. Repeated calls to the same type will result in merging the configuration.- Specified by:
typeConfigurationin interfaceAotContext- Parameters:
resolvableType- the resolvable type to configure.configurationConsumer- configuration consumer function.
-
typeConfiguration
Description copied from interface:AotContextObtain aAotTypeConfigurationfor the givenResolvableTypeto customize the AOT processing for the given type. Repeated calls to the same type will result in merging the configuration.- Specified by:
typeConfigurationin interfaceAotContext- Parameters:
type- the type to configure.configurationConsumer- configuration consumer function.
-
contributeTypeConfigurations
Description copied from interface:AotContextContribute type configurations to the givenGenerationContext. This method is called once perGenerationContextafter all type configurations have been registered.- Specified by:
contributeTypeConfigurationsin interfaceAotContext- Parameters:
generationContext- the context to contribute the type configurations to.
-