@Component
public class AllBeanPostProcessor implements BeanPostProcessor{
//对象属性设置方法完成后,init方法执行前执行
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
System.out.println("BeforeInit="+beanName);
return bean;
}
//init方法执行后执行
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
System.out.println("AfterInit="+beanName);
return bean;
}
}