package org.springframework.beans.factory.config;

import org.springframework.beans.BeansException;

public interface BeanPostProcessor {

        
    Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException;


    Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException;

}

BeanPostProcessor

这个接口中就2个方法:其实这个类就是给bean进行额外添加东西,我们并不能说是增强,

postProcessBeforeInitialization 这个方法在类初始化前调用,比InitializaingBean 的 setPropertiesSet 和 xml文件中自定义的init-method方法执行都早

postProcessAfterInitialization  类初始话后调用,在InitializaingBean 的 setPropertiesSet 和 xml文件中自定义的init-method方法之后执行

相当于filtter一样的感觉

 

 

相关文章:

  • 2020-05-11
  • 2020-06-18
  • 2021-09-04
  • 2021-09-12
  • 2022-12-23
  • 2021-11-14
  • 2022-02-19
  • 2022-02-08
猜你喜欢
  • 2022-12-23
  • 2021-07-19
  • 2021-06-25
  • 2021-06-23
  • 2021-08-01
相关资源
相似解决方案