Top Description Methods
org.springframework.beans.factory.aot

public Interface BeanFactoryInitializationAotProcessor

Known Direct Implementers
org.springframework.beans.factory.aot.BeanRegistrationsAotProcessor
Annotations
@FunctionalInterface
Imports
org.springframework.beans.factory.config.BeanFactoryPostProcessor, .ConfigurableListableBeanFactory, org.springframework.lang.Nullable

AOT processor that makes bean factory initialization contributions by processing ConfigurableListableBeanFactory instances.

BeanFactoryInitializationAotProcessor implementations may be registered in a META-INF/spring/aot.factories resource or as a bean.

Using this interface on a registered bean will cause the bean and all of its dependencies to be initialized during AOT processing. We generally recommend that this interface is only used with infrastructure beans such as BeanFactoryPostProcessor which have limited dependencies and are already initialized early in the bean factory lifecycle. If such a bean is registered using a factory method, make sure to make it static so that its enclosing class does not have to be initialized.

A component that implements this interface is not contributed.

Authors
Phillip Webb, Stephane Nicoll
Since
6.0
See Also
BeanFactoryInitializationAotContribution

Method Summary

Modifier and TypeMethod and Description
public BeanFactoryInitializationAotContribution
processAheadOfTime(ConfigurableListableBeanFactory
the bean factory to process
beanFactory
)

Process the given ConfigurableListableBeanFactory instance ahead-of-time and return a contribution or null.

Method Detail

processAheadOfTimeback to summary
public BeanFactoryInitializationAotContribution processAheadOfTime(ConfigurableListableBeanFactory beanFactory)

Process the given ConfigurableListableBeanFactory instance ahead-of-time and return a contribution or null.

Processors are free to use any techniques they like to analyze the given bean factory. Most typically use reflection to find fields or methods to use in the contribution. Contributions typically generate source code or resource files that can be used when the AOT optimized application runs.

If the given bean factory does not contain anything that is relevant to the processor, this method should return a null contribution.

Parameters
beanFactory:ConfigurableListableBeanFactory

the bean factory to process

Returns:BeanFactoryInitializationAotContribution

a BeanFactoryInitializationAotContribution or null

Annotations
@Nullable