上一节讲到bean初始化方法initializeBean方法的第一步,invokeAwareMethods。
这节将初始化bean的第二步,applyBeanPostProcessorsBeforeInitialization方法
看代码实现:
遍历beanFactory里面的beanPostProcessor,执行postProcessBeforeInitialization方法,
/**
* factory的回调,允许用户自定义bean
* Factory hook that allows for custom modification of new bean instances,
* e.g. checking for marker interfaces or wrapping them with proxies.
* applicationContext 可以自己注入新的beanPostProcessor用来改造bean
* <p>ApplicationContexts can autodetect BeanPostProcessor beans in their
* bean definitions and apply them to any beans subsequently created.
* Plain bean factories allow for programmatic registration of post-processors,
* applying to all beans created through th