文章目录
1. BeanPostProcessor官方解释
Factory hook that allows for custom modification of new bean instances, e.g. checking for marker interfaces or wrapping them with proxies.
允许对新建实例的定制修改,比如检查标记接口或用代理包装他们
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 this factory.
Typically, post-processors that populate beans via marker interfaces or the like will implement postProcessBeforeInitialization, while post-processors that wrap beans with proxies will normally implement postProcessAfterInitialization.
这里提到的重点是代理的创建是在 post-processors的postProcessAfterInitialization方法之后,即初始化之后。