Package org.springframework.data.aot
Interface AotContext
- All Known Subinterfaces:
AotRepositoryContext
public interface AotContext
The context in which the AOT processing happens. Grants access to the
beanFactory and ClassLoader. Holds a few convenience methods to check if a type
is present and allows resolution of them through AotContext.TypeIntrospector
and AotContext.IntrospectedBeanDefinition.
Mainly for internal use within the framework.
- Since:
- 3.0
- Author:
- Christoph Strobl, John Blum, Mark Paluch
- See Also:
-
BeanFactory
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceInterface defining introspection methods for bean definitions.static interfaceType-based introspector to resolveClassfrom a type name and to introspect the bean factory for presence of beans. -
Method Summary
Modifier and TypeMethodDescriptionstatic AotContextfrom(org.springframework.beans.factory.BeanFactory beanFactory) Create anAotContextbacked by the givenBeanFactory.org.springframework.beans.factory.config.ConfigurableListableBeanFactoryReturns a reference to theConfigurableListableBeanFactorybacking thisAotContext.default ClassLoaderdefault ClassLoaderdefault TypeScannerReturns a newTypeScannerused to scan fortypesthat will be contributed to the AOT processing infrastructure.introspectBeanDefinition(String beanName) Returns aAotContext.IntrospectedBeanDefinitionto obtain further detail about the underlying bean definition.introspectBeanDefinition(org.springframework.beans.factory.config.BeanReference reference) Returns aAotContext.IntrospectedBeanDefinitionto obtain further detail about the underlying bean definition.introspectType(String typeName) Returns aAotContext.TypeIntrospectorto obtain further detail about atypegiven its fully-qualified type namescanPackageForTypes(Collection<Class<? extends Annotation>> identifyingAnnotations, Collection<String> packageNames) Scans fortypesin the givennamed packagesannotated with the store-specificidentifying annotations.
-
Method Details
-
from
Create anAotContextbacked by the givenBeanFactory.- Parameters:
beanFactory- reference to theBeanFactory; must not be null.- Returns:
- a new instance of
AotContext. - See Also:
-
BeanFactory
-
getBeanFactory
org.springframework.beans.factory.config.ConfigurableListableBeanFactory getBeanFactory()Returns a reference to theConfigurableListableBeanFactorybacking thisAotContext.- Returns:
- a reference to the
ConfigurableListableBeanFactorybacking thisAotContext. - See Also:
-
ConfigurableListableBeanFactory
-
getClassLoader
Returns theClassLoaderused by thisAotContextto resolvetypes. By default, this is the sameClassLoaderused by theBeanFactoryto resolvetypesdeclared in bean definitions.- Returns:
- the
ClassLoaderused by thisAotContextto resolvetypes. - See Also:
-
ConfigurableBeanFactory.getBeanClassLoader()
-
getRequiredClassLoader
Returns the requiredClassLoaderused by thisAotContextto resolvetypes. By default, this is the sameClassLoaderused by theBeanFactoryto resolvetypesdeclared in bean definitions.- Returns:
- the
ClassLoaderused by thisAotContextto resolvetypes. - Throws:
IllegalStateException- if noClassLoaderis available.
-
introspectType
Returns aAotContext.TypeIntrospectorto obtain further detail about atypegiven its fully-qualified type name -
getTypeScanner
Returns a newTypeScannerused to scan fortypesthat will be contributed to the AOT processing infrastructure.- Returns:
- a
TypeScannerused to scan fortypesthat will be contributed to the AOT processing infrastructure. - See Also:
-
scanPackageForTypes
default Set<Class<?>> scanPackageForTypes(Collection<Class<? extends Annotation>> identifyingAnnotations, Collection<String> packageNames) Scans fortypesin the givennamed packagesannotated with the store-specificidentifying annotations.- Parameters:
identifyingAnnotations-CollectionofAnnotationsidentifying store-specific modeltypes; must not be null.packageNames-Collectionofpackage namesto scan.- Returns:
- a
Setoftypesfound during the scan. - See Also:
-
introspectBeanDefinition
default AotContext.IntrospectedBeanDefinition introspectBeanDefinition(org.springframework.beans.factory.config.BeanReference reference) Returns aAotContext.IntrospectedBeanDefinitionto obtain further detail about the underlying bean definition. A introspected bean definition can also point to an absent bean definition.- Parameters:
reference-BeanReferenceto the managed bean.- Returns:
- the introspected bean definition.
-
introspectBeanDefinition
Returns aAotContext.IntrospectedBeanDefinitionto obtain further detail about the underlying bean definition. A introspected bean definition can also point to an absent bean definition.- Parameters:
beanName-Stringcontaining the name of the bean to evaluate; must not be null.- Returns:
- the introspected bean definition.
-