Class AbstractBeanFactoryAwareAdvisingPostProcessor
- java.lang.Object
- org.springframework.aop.framework.ProxyConfig
- org.springframework.aop.framework.ProxyProcessorSupport
- org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor
- org.springframework.aop.framework.autoproxy.AbstractBeanFactoryAwareAdvisingPostProcessor
- All Implemented Interfaces:
Serializable
,AopInfrastructureBean
,Aware
,BeanClassLoaderAware
,BeanFactoryAware
,BeanPostProcessor
,Ordered
- Direct Known Subclasses:
AsyncAnnotationBeanPostProcessor
,MethodValidationPostProcessor
,PersistenceExceptionTranslationPostProcessor
public abstract class AbstractBeanFactoryAwareAdvisingPostProcessor extends AbstractAdvisingBeanPostProcessor implements BeanFactoryAware
Extension ofAbstractAutoProxyCreator
which implementsBeanFactoryAware
, 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 withAbstractAutoProxyCreator
.- Since:
- 4.2.3
- Author:
- Juergen Hoeller
- See Also:
AutoProxyUtils.shouldProxyTargetClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.lang.String)
,AutoProxyUtils.determineTargetClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.lang.String)
, Serialized Form
Field Summary
Fields inherited from class org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor
advisor, beforeExistingAdvisors
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
Constructors Constructor Description AbstractBeanFactoryAwareAdvisingPostProcessor()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ProxyFactory
prepareProxyFactory(Object bean, String beanName)
Prepare aProxyFactory
for the given bean.void
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.Methods inherited from class org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor
customizeProxyFactory, isEligible, isEligible, postProcessAfterInitialization, postProcessBeforeInitialization, setBeforeExistingAdvisors
Methods inherited from class org.springframework.aop.framework.ProxyProcessorSupport
evaluateProxyInterfaces, getOrder, getProxyClassLoader, isConfigurationCallbackInterface, isInternalLanguageInterface, setBeanClassLoader, setOrder, setProxyClassLoader
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
Constructor Detail
AbstractBeanFactoryAwareAdvisingPostProcessor
public AbstractBeanFactoryAwareAdvisingPostProcessor()
Method Detail
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface:BeanFactoryAware
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.- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Parameters:
beanFactory
- owning BeanFactory (nevernull
). The bean can immediately call methods on the factory.- See Also:
BeanInitializationException
prepareProxyFactory
protected ProxyFactory prepareProxyFactory(Object bean, String beanName)
Description copied from class:AbstractAdvisingBeanPostProcessor
Prepare aProxyFactory
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;
AbstractAdvisingBeanPostProcessor.customizeProxyFactory(org.springframework.aop.framework.ProxyFactory)
allows for late customizations of those parts right before proxy creation.- Overrides:
prepareProxyFactory
in classAbstractAdvisingBeanPostProcessor
- Parameters:
bean
- the bean instance to create a proxy forbeanName
- the corresponding bean name- Returns:
- the ProxyFactory, initialized with this processor's
ProxyConfig
settings and the specified bean - See Also:
AbstractAdvisingBeanPostProcessor.customizeProxyFactory(org.springframework.aop.framework.ProxyFactory)