SpringSource Spring Framework tutorials and examples. Focusing on Spring 3 and above.
In the last post, we create a class AnsiConvertor that implements the BeanPostProcessor interface. Now if we want to use this class in our application is running within a bean factory, we need to programmatically register the BeanPostProcessor using the factory’s addBeanPostProcessor() method: Java Code: BeanPostProcessor convertAnsi = new ConvertAnsi();
Or if you decide to use an application context, you’ll need to register the
BeanPostProcessor convertAnsi = new ConvertAnsi();
In the previous tip we talked about special beans in Spring. One of the Spring’s special beans that I had mentioned was using the BeanPostProcessor interface in order to cut into the bean’s life cycle and review or alter its configuration. In this tip, I will show you how to wire one. As mentioned in the previous tip I mentioned that the BeanPostProcessor provides two methods to alter the bean after it has been created and wired: Java Code: Object postProcessBeforeInitialization(Object bean,
Object postProcessBeforeInitialization(Object bean,