|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface InstantiationAwareBeanPostProcessor
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).
AbstractAutoProxyCreator.setCustomTargetSourceCreators(org.springframework.aop.framework.autoproxy.TargetSourceCreator[]),
AbstractPoolingTargetSourceCreator,
LazyInitTargetSourceCreator| Method Summary | |
|---|---|
Object |
postProcessBeforeInstantiation(Class beanClass,
String beanName)
Apply this BeanPostProcessor before the target bean gets instantiated. |
| Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor |
|---|
postProcessAfterInitialization, postProcessBeforeInitialization |
| Method Detail |
|---|
Object postProcessBeforeInstantiation(Class beanClass, String beanName) throws BeansException
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".
beanClass - the class of the bean to be instantiatedbeanName - the name of the bean
BeansException - in case of errorsAbstractBeanDefinition.hasBeanClass(),
AbstractBeanDefinition.getFactoryMethodName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||