Browse Source

Clarify the scope of AotContributingBeanPostProcessor

This commit updates AotContributingBeanPostProcessor so that it
explicitly extends from PriorityOrdered. This makes it more apparent
that AOT contributing bean post processors are meant to be invoked
early with the regular runtime, and shouldn't be post-processed
themselves.

See gh-28047
pull/28170/head
Stephane Nicoll 4 years ago
parent
commit
ea19b92deb
  1. 10
      spring-beans/src/main/java/org/springframework/beans/factory/generator/AotContributingBeanPostProcessor.java

10
spring-beans/src/main/java/org/springframework/beans/factory/generator/AotContributingBeanPostProcessor.java

@ -18,12 +18,13 @@ package org.springframework.beans.factory.generator; @@ -18,12 +18,13 @@ package org.springframework.beans.factory.generator;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.core.PriorityOrdered;
import org.springframework.lang.Nullable;
/**
* Specialization of {@link BeanPostProcessor} that contributes to bean
* instantiation ahead of time, providing generated code that is equivalent to
* its runtime behavior.
* Specialization of a priority ordered {@link BeanPostProcessor} that
* contributes to bean instantiation ahead of time, providing generated code
* that is equivalent to its runtime behavior.
*
* <p>Contrary to other bean post processors, implementations of this interface
* are instantiated at build-time and should not rely on other beans in the
@ -32,8 +33,7 @@ import org.springframework.lang.Nullable; @@ -32,8 +33,7 @@ import org.springframework.lang.Nullable;
* @author Stephane Nicoll
* @since 6.0
*/
@FunctionalInterface
public interface AotContributingBeanPostProcessor extends BeanPostProcessor {
public interface AotContributingBeanPostProcessor extends BeanPostProcessor, PriorityOrdered {
/**
* Contribute a {@link BeanInstantiationContribution} for the given bean definition,

Loading…
Cancel
Save