一:含义作用

==>BeanPostProcessor接口是众多Spring提供给开发者的bean生命周期内自定义逻辑拓展接口中的一个

 

二:接口定义

package org.springframework.beans.factory.config;

import org.springframework.beans.BeansException;

public interface BeanPostProcessor {

    /**
     *IOC容器中的bean实例化之前执行
     */
    Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException;

    /**
     *IOC容器中的bean实例化之后执行
     */
    Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException;

}
View Code

相关文章: