org.springframework.beans.factory.config
Interface InstantiationAwareBeanPostProcessor

public interface InstantiationAwareBeanPostProcessor
extends BeanPostProcessor
Subinterface of BeanPostProcessor that adds a before-instantiation callback.

Typically used to suppress default instantiation for specific target beans, for example to create proxies with special TargetSources (pooling targets, lazily initializing targets, etc).

Since1.2
VersionNot specified.
AuthorJuergen Hoeller
Wiki javadoc Use textile entry format.
Add your comments here.
Method Summary
Object postProcessBeforeInstantiation( Class beanClass, String beanName )
Apply this BeanPostProcessor before the target bean gets instantiated.
postProcessBeforeInstantiation
public Object postProcessBeforeInstantiation ( Class beanClass, String beanName )
Apply this BeanPostProcessor before the target bean gets instantiated. The returned bean object may be a proxy to use instead of the target bean, effectively suppressing default instantiation of the target bean.

If a non-null object is returned by this method, the bean creation process will be short-circuited. The returned bean object will not be processed any further; in particular, no further BeanPostProcessor callbacks will be applied to it. This mechanism is mainly intended for exposing a proxy instead of an actual target bean.

This callback will only be applied to bean definitions with a bean class. In particular, it will not be applied to beans with a "factory-method".

Parameters
TypeNameDescription
Class beanClass the class of the bean to be instantiated
String beanName the name of the bean
Exceptions
BeansException in case of errors
Wiki javadoc Use textile entry format.
Add your comments here.