Back Forum Reply New

BeanFactoryPostProcessor and BeanPostProcessor conflicts

(This is a rehash of: showthread.php?t=15456)

Why is it that the BeanFactoryPostProcessors are executed prior to the BeanPostProcessors being registered? If a BeanFactoryPostProcessors needs to process actual beans, they will be created without the BeanPostProcessors ever being invoked.

Something I noticed in AbstractApplicationContext, the method comment for registerBeanPostProcessors says  quot;Instantiate and invoke all registered BeanPostProcessor beans...quot;.

But the post-processers are not invoked here. They are invoked when the bean is created. (Which, in the scenario above, may have been long ago.)

BTW, I have completely sidestepped this issue by triggering my post-processing (ie, registering listeners) on a ContextRefreshedEvent.

But I would still like to understand the rational behind the current logic.
¥
Back Forum Reply New