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:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Interface defining introspection methods for bean definitions.static interface
Type-based introspector to resolveClass
from a type name and to introspect the bean factory for presence of beans. -
Method Summary
Modifier and TypeMethodDescriptionstatic AotContext
from
(BeanFactory beanFactory) Create anAotContext
backed by the givenBeanFactory
.Returns a reference to theConfigurableListableBeanFactory
backing thisAotContext
.default ClassLoader
default ClassLoader
default TypeScanner
Returns a newTypeScanner
used to scan fortypes
that will be contributed to the AOT processing infrastructure.introspectBeanDefinition
(String beanName) Returns aAotContext.IntrospectedBeanDefinition
to obtain further detail about the underlying bean definition.introspectBeanDefinition
(BeanReference reference) Returns aAotContext.IntrospectedBeanDefinition
to obtain further detail about the underlying bean definition.introspectType
(String typeName) Returns aAotContext.TypeIntrospector
to obtain further detail about atype
given its fully-qualified type namescanPackageForTypes
(Collection<Class<? extends Annotation>> identifyingAnnotations, Collection<String> packageNames) Scans fortypes
in the givennamed packages
annotated with the store-specificidentifying annotations
.
-
Method Details
-
from
Create anAotContext
backed by the givenBeanFactory
.- Parameters:
beanFactory
- reference to theBeanFactory
; must not be null.- Returns:
- a new instance of
AotContext
. - See Also:
-
getBeanFactory
ConfigurableListableBeanFactory getBeanFactory()Returns a reference to theConfigurableListableBeanFactory
backing thisAotContext
.- Returns:
- a reference to the
ConfigurableListableBeanFactory
backing thisAotContext
. - See Also:
-
getClassLoader
Returns theClassLoader
used by thisAotContext
to resolvetypes
. By default, this is the sameClassLoader
used by theBeanFactory
to resolvetypes
declared in bean definitions.- Returns:
- the
ClassLoader
used by thisAotContext
to resolvetypes
. - See Also:
-
getRequiredClassLoader
Returns the requiredClassLoader
used by thisAotContext
to resolvetypes
. By default, this is the sameClassLoader
used by theBeanFactory
to resolvetypes
declared in bean definitions.- Returns:
- the
ClassLoader
used by thisAotContext
to resolvetypes
. - Throws:
IllegalStateException
- if noClassLoader
is available.
-
introspectType
Returns aAotContext.TypeIntrospector
to obtain further detail about atype
given its fully-qualified type name -
getTypeScanner
Returns a newTypeScanner
used to scan fortypes
that will be contributed to the AOT processing infrastructure.- Returns:
- a
TypeScanner
used to scan fortypes
that will be contributed to the AOT processing infrastructure. - See Also:
-
scanPackageForTypes
default Set<Class<?>> scanPackageForTypes(Collection<Class<? extends Annotation>> identifyingAnnotations, Collection<String> packageNames) Scans fortypes
in the givennamed packages
annotated with the store-specificidentifying annotations
.- Parameters:
identifyingAnnotations
-Collection
ofAnnotations
identifying store-specific modeltypes
; must not be null.packageNames
-Collection
ofpackage names
to scan.- Returns:
- a
Set
oftypes
found during the scan. - See Also:
-
introspectBeanDefinition
Returns aAotContext.IntrospectedBeanDefinition
to obtain further detail about the underlying bean definition. A introspected bean definition can also point to an absent bean definition.- Parameters:
reference
-BeanReference
to the managed bean.- Returns:
- the introspected bean definition.
-
introspectBeanDefinition
Returns aAotContext.IntrospectedBeanDefinition
to obtain further detail about the underlying bean definition. A introspected bean definition can also point to an absent bean definition.- Parameters:
beanName
-String
containing the name of the bean to evaluate; must not be null.- Returns:
- the introspected bean definition.
-