Top Description Fields Constructors Methods
org.springframework.aop.framework.autoproxy

public abstract Class AbstractBeanFactoryAwareAdvisingPostProcessor

extends AbstractAdvisingBeanPostProcessor
implements BeanFactoryAware
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.Aware
Annotations
@SuppressWarnings:serial
Imports
org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor, .ProxyFactory, org.springframework.beans.factory.BeanFactory, .BeanFactoryAware, org.springframework.beans.factory.config.ConfigurableListableBeanFactory, org.springframework.lang.Nullable

Extension of AbstractAutoProxyCreator which implements BeanFactoryAware, adds exposure of the original target class for each proxied bean (AutoProxyUtils#ORIGINAL_TARGET_CLASS_ATTRIBUTE), and participates in an externally enforced target-class mode for any given bean (AutoProxyUtils#PRESERVE_TARGET_CLASS_ATTRIBUTE). This post-processor is therefore aligned with AbstractAutoProxyCreator.
Author
Juergen Hoeller
Since
4.2.3
See Also
AutoProxyUtils#shouldProxyTargetClass, AutoProxyUtils#determineTargetClass

Field Summary

Modifier and TypeField and Description
private ConfigurableListableBeanFactory
Inherited from org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor:
advisorbeforeExistingAdvisors

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
isEligible(Object
the bean instance
bean
,
String
the name of the bean
beanName
)

Overrides org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor.isEligible.

Check whether the given bean is eligible for advising with this post-processor's Advisor.
protected ProxyFactory
prepareProxyFactory(Object
the bean instance to create a proxy for
bean
,
String
the corresponding bean name
beanName
)

Overrides org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor.prepareProxyFactory.

Prepare a ProxyFactory for the given bean.
public void
setBeanFactory(BeanFactory
owning BeanFactory (never null). The bean can immediately call methods on the factory.
beanFactory
)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Callback that supplies the owning factory to a bean instance.
Inherited from org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor:
customizeProxyFactorydetermineBeanTypeisEligiblepostProcessAfterInitializationsetBeforeExistingAdvisors

Field Detail

beanFactoryback to summary
private ConfigurableListableBeanFactory beanFactory
Annotations
@Nullable

Constructor Detail

AbstractBeanFactoryAwareAdvisingPostProcessorback to summary
public AbstractBeanFactoryAwareAdvisingPostProcessor()

Method Detail

isEligibleback to summary
protected boolean isEligible(Object bean, String beanName)

Overrides org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor.isEligible.

Doc from org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor.isEligible.

Check whether the given bean is eligible for advising with this post-processor's Advisor.

Delegates to isEligible(Class) for target class checking. Can be overridden e.g. to specifically exclude certain beans by name.

Note

Only called for regular bean instances but not for existing proxy instances which implement Advised and allow for adding the local Advisor to the existing proxy's Advisor chain. For the latter, isEligible(Class) is being called directly, with the actual target class behind the existing proxy (as determined by AopUtils#getTargetClass(Object)).

Parameters
bean:Object

the bean instance

beanName:String

the name of the bean

Annotations
@Override
prepareProxyFactoryback to summary
protected ProxyFactory prepareProxyFactory(Object bean, String beanName)

Overrides org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor.prepareProxyFactory.

Doc from org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor.prepareProxyFactory.

Prepare a ProxyFactory for the given bean.

Subclasses may customize the handling of the target instance and in particular the exposure of the target class. The default introspection of interfaces for non-target-class proxies and the configured advisor will be applied afterwards; customizeProxyFactory allows for late customizations of those parts right before proxy creation.

Parameters
bean:Object

the bean instance to create a proxy for

beanName:String

the corresponding bean name

Returns:ProxyFactory

the ProxyFactory, initialized with this processor's ProxyConfig settings and the specified bean

Annotations
@Override
setBeanFactoryback to summary
public void setBeanFactory(BeanFactory beanFactory)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Doc from org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean#afterPropertiesSet() or a custom init-method.

Parameters
beanFactory:BeanFactory

owning BeanFactory (never null). The bean can immediately call methods on the factory.

Annotations
@Override