Example usage for org.springframework.beans.factory.config BeanPostProcessor postProcessAfterInitialization

List of usage examples for org.springframework.beans.factory.config BeanPostProcessor postProcessAfterInitialization

Introduction

In this page you can find the example usage for org.springframework.beans.factory.config BeanPostProcessor postProcessAfterInitialization.

Prototype

@Nullable
default Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException 

Source Link

Document

Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).

Usage

From source file:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.java

@Override
public Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)
        throws BeansException {

    Object result = existingBean;
    for (BeanPostProcessor processor : getBeanPostProcessors()) {
        Object current = processor.postProcessAfterInitialization(result, beanName);
        if (current == null) {
            return result;
        }//from   w  ww  .  j a v a 2  s .c  o m
        result = current;
    }
    return result;
}