You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Spring, constructor dependency injection is only available by means of inject-by-type. If BeanFactoryPostProcessor implementations is created via constructor, it will make Spring invoke BeanFactoryUtils.beanNamesForTypeIncludingAncestors to find all suitable candidates. And because of that, bean type unknown unless initialized will be created way early (invokeBeanFactoryPostProcessors phase), e.g., FactoryBean.
Thus we should abandon the usage of creating BeanFactoryPostProcessor implementations via constructor:
SofaModuleBeanFactoryPostProcessor
RuntimeContextBeanFactoryPostProcessor
ServiceBeanFactoryPostProcessor
The text was updated successfully, but these errors were encountered:
alaneuler
changed the title
BeanFactoryPostProcessor implementations should not be instantiated via constructor.BeanFactoryPostProcessor implementations should not be instantiated via constructor dependency injection.
Mar 2, 2022
In Spring, constructor dependency injection is only available by means of inject-by-type. If
BeanFactoryPostProcessor
implementations is created via constructor, it will make Spring invokeBeanFactoryUtils.beanNamesForTypeIncludingAncestors
to find all suitable candidates. And because of that, bean type unknown unless initialized will be created way early (invokeBeanFactoryPostProcessors
phase), e.g.,FactoryBean
.Thus we should abandon the usage of creating
BeanFactoryPostProcessor
implementations via constructor:SofaModuleBeanFactoryPostProcessor
RuntimeContextBeanFactoryPostProcessor
ServiceBeanFactoryPostProcessor
The text was updated successfully, but these errors were encountered: