File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -4510,6 +4510,14 @@ configuration metadata which implement the `BeanPostProcessor` interface. The
4510
4510
later upon bean creation. Bean post-processors can be deployed in the container just
4511
4511
like any other beans.
4512
4512
4513
+ Note that when declaring a ++BeanPostProcessor++ using an `@Bean` factory method on a
4514
+ configuration class, the return type of the factory method should be the implementation
4515
+ class itself or at least the `org.springframework.beans.factory.config.BeanPostProcessor`
4516
+ interface, clearly indicating the post-processor nature of that bean. Otherwise, the
4517
+ `ApplicationContext` won't be able to autodetect it by type before fully creating it.
4518
+ Since a ++BeanPostProcessor++ needs to be instantiated early in order to apply to the
4519
+ initialization of other beans in the context, this early type detection is critical.
4520
+
4513
4521
[NOTE]
4514
4522
====
4515
4523
You can’t perform that action at this time.
0 commit comments