Class AbstractBeanFactoryAwareAdvisingPostProcessor
- All Implemented Interfaces:
Serializable,AopInfrastructureBean,Aware,BeanClassLoaderAware,BeanFactoryAware,BeanPostProcessor,Ordered
- Direct Known Subclasses:
AsyncAnnotationBeanPostProcessor,MethodValidationPostProcessor,PersistenceExceptionTranslationPostProcessor
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.- Since:
- 4.2.3
- Author:
- Juergen Hoeller
- See Also:
-
Field Summary
Fields inherited from class org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor
advisor, beforeExistingAdvisorsFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisEligible(Object bean, String beanName) Check whether the given bean is eligible for advising with this post-processor'sAdvisor.protected ProxyFactoryprepareProxyFactory(Object bean, String beanName) Prepare aProxyFactoryfor the given bean.voidsetBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.Methods inherited from class org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor
customizeProxyFactory, isEligible, postProcessAfterInitialization, postProcessBeforeInitialization, setBeforeExistingAdvisorsMethods inherited from class org.springframework.aop.framework.ProxyProcessorSupport
evaluateProxyInterfaces, getOrder, getProxyClassLoader, isConfigurationCallbackInterface, isInternalLanguageInterface, setBeanClassLoader, setOrder, setProxyClassLoaderMethods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
-
Constructor Details
-
AbstractBeanFactoryAwareAdvisingPostProcessor
public AbstractBeanFactoryAwareAdvisingPostProcessor()
-
-
Method Details
-
setBeanFactory
Description copied from interface:BeanFactoryAwareCallback 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:
setBeanFactoryin interfaceBeanFactoryAware- Parameters:
beanFactory- owning BeanFactory (nevernull). The bean can immediately call methods on the factory.- See Also:
-
prepareProxyFactory
Description copied from class:AbstractAdvisingBeanPostProcessorPrepare aProxyFactoryfor 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:
prepareProxyFactoryin classAbstractAdvisingBeanPostProcessor- Parameters:
bean- the bean instance to create a proxy forbeanName- the corresponding bean name- Returns:
- the ProxyFactory, initialized with this processor's
ProxyConfigsettings and the specified bean - See Also:
-
isEligible
Description copied from class:AbstractAdvisingBeanPostProcessorCheck whether the given bean is eligible for advising with this post-processor'sAdvisor.Delegates to
AbstractAdvisingBeanPostProcessor.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
Advisedand allow for adding the localAdvisorto the existing proxy'sAdvisorchain. For the latter,AbstractAdvisingBeanPostProcessor.isEligible(Class)is being called directly, with the actual target class behind the existing proxy (as determined byAopUtils.getTargetClass(Object)).- Overrides:
isEligiblein classAbstractAdvisingBeanPostProcessor- Parameters:
bean- the bean instancebeanName- the name of the bean- See Also:
-