Bean Post Processors in Spring
by, 07-07-2012 at 06:19 PM (1975 Views)
The callback methods are defined by the Bean Post Processor interface and it can be implemented to provide your instatiation logic and dependency resolution logic. When the instantiating, initializating and configuring of a bean is finished by the Spring container, some custom logic implementation can be done by you by integrating Bean Post Processor implementations.
More than one Bean Post Processor interfaces are allowed to use and configure and also it is possible to control the execution sequence of these Bean Processor interfaces with the help of setting the order property. This property is provided by the Bean Post Processor which implements the Ordered interface.
The Bean Post Processors operate on bean or object in following order:
• A bean instance is instantiated by the Spring IoC
• The Bean Post Processor interfaces perform their operation
All the beans which are defined using the Bean Post Processor interface are detected by the ApplicationContext and these beans are registered and called appropriately as post processors upon bean creation by the container.