This commit is contained in:
Stephane Nicoll 2022-10-07 11:42:35 +02:00
parent ca88eeb1ae
commit c74760540d
2 changed files with 25 additions and 18 deletions

View File

@ -24,15 +24,19 @@ import org.springframework.lang.Nullable;
* AOT processor that makes bean factory initialization contributions by * AOT processor that makes bean factory initialization contributions by
* processing {@link ConfigurableListableBeanFactory} instances. * processing {@link ConfigurableListableBeanFactory} instances.
* *
* <p>{@link BeanFactoryInitializationAotProcessor} implementations may be * <p>{@code BeanFactoryInitializationAotProcessor} implementations may be
* registered in a {@value AotServices#FACTORIES_RESOURCE_LOCATION} resource or * registered in a {@value AotServices#FACTORIES_RESOURCE_LOCATION} resource or
* as a bean. * as a bean.
* *
* <p>Note: Using this interface on a registered bean will cause the bean * <p>Using this interface on a registered bean will cause the bean <em>and</em>
* <em>and</em> all of its dependencies to be initialized during AOT processing. * all of its dependencies to be initialized during AOT processing. We generally
* We generally recommend that this interface is only used with infrastructure * recommend that this interface is only used with infrastructure beans such as
* beans such as {@link BeanFactoryPostProcessor} which have limited dependencies * {@link BeanFactoryPostProcessor} which have limited dependencies and are
* and are already initialized early in the bean factory lifecycle. * already initialized early in the bean factory lifecycle. If such a bean is
* registered using a factory method, make sure to make it {@code static} so
* that its enclosing class does not have to be initialized.
*
* <p>A component that implements this interface is not contributed.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Stephane Nicoll * @author Stephane Nicoll

View File

@ -22,21 +22,24 @@ import org.springframework.lang.Nullable;
/** /**
* AOT processor that makes bean registration contributions by processing * AOT processor that makes bean registration contributions by processing
* {@link RegisteredBean} instances. An AOT processor replaces its usual * {@link RegisteredBean} instances.
* runtime behavior by an optimized arrangement, usually in generated
* code. For that reason, a component that implements this interface is
* not contributed by default. If a component that implements this
* interface still needs to be invoked at runtime,
* {@link #isBeanExcludedFromAotProcessing} can be overridden.
* *
* <p>{@link BeanRegistrationAotProcessor} implementations may be registered in * <p>{@code BeanRegistrationAotProcessor} implementations may be registered in
* a {@value AotServices#FACTORIES_RESOURCE_LOCATION} resource or as a bean. * a {@value AotServices#FACTORIES_RESOURCE_LOCATION} resource or as a bean.
* *
* <p>Note: Using this interface on a registered bean will cause the bean * <p>Using this interface on a registered bean will cause the bean <em>and</em>
* <em>and</em> all of its dependencies to be initialized during AOT processing. * all of its dependencies to be initialized during AOT processing. We generally
* We generally recommend that interface is only used with infrastructure beans * recommend that this interface is only used with infrastructure beans such as
* such as {@link BeanPostProcessor} which have limited dependencies and are * {@link BeanPostProcessor} which have limited dependencies and are already
* already initialized early in the bean factory lifecycle. * initialized early in the bean factory lifecycle. If such a bean is registered
* using a factory method, make sure to make it {@code static} so that its
* enclosing class does not have to be initialized.
*
* <p>An AOT processor replaces its usual runtime behavior by an optimized
* arrangement, usually in generated code. For that reason, a component that
* implements this interface is not contributed by default. If a component that
* implements this interface still needs to be invoked at runtime,
* {@link #isBeanExcludedFromAotProcessing} can be overridden.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Stephane Nicoll * @author Stephane Nicoll