All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.springframework.biz.aop.InjectBeanSelfProcessor Maven / Gradle / Ivy

There is a newer version: 3.3.x.20241003.RELEASE
Show newest version
package org.springframework.biz.aop;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.biz.aop.aware.BeanSelfAware;

public class InjectBeanSelfProcessor implements BeanPostProcessor {

	 public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {  
        if(bean instanceof BeanSelfAware){  
            BeanSelfAware myBean = (BeanSelfAware)bean;  
            myBean.setSelf(bean);  
            return myBean;  
        }  
        return bean;  
    }  
   
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {  
        return bean;  
    }  

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy