public abstract class AbstractBeanFactoryAwareAdvisingPostProcessor extends AbstractAdvisingBeanPostProcessor implements org.springframework.beans.factory.BeanFactoryAware
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.AutoProxyUtils.shouldProxyTargetClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.lang.String),
AutoProxyUtils.determineTargetClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.lang.String),
Serialized Formadvisor, beforeExistingAdvisors| Constructor and Description |
|---|
AbstractBeanFactoryAwareAdvisingPostProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isEligible(Object bean,
String beanName)
Check whether the given bean is eligible for advising with this
post-processor's
Advisor. |
protected ProxyFactory |
prepareProxyFactory(Object bean,
String beanName)
Prepare a
ProxyFactory for the given bean. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
customizeProxyFactory, isEligible, postProcessAfterInitialization, postProcessBeforeInitialization, setBeforeExistingAdvisorsevaluateProxyInterfaces, getOrder, getProxyClassLoader, isConfigurationCallbackInterface, isInternalLanguageInterface, setBeanClassLoader, setOrder, setProxyClassLoadercopyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toStringpublic AbstractBeanFactoryAwareAdvisingPostProcessor()
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareprotected ProxyFactory prepareProxyFactory(Object bean, String beanName)
AbstractAdvisingBeanPostProcessorProxyFactory 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.
prepareProxyFactory in class AbstractAdvisingBeanPostProcessorbean - the bean instance to create a proxy forbeanName - the corresponding bean nameProxyConfig settings and the specified beanAbstractAdvisingBeanPostProcessor.customizeProxyFactory(org.springframework.aop.framework.ProxyFactory)protected boolean isEligible(Object bean, String beanName)
AbstractAdvisingBeanPostProcessorAdvisor.
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 Advised and allow for adding
the local Advisor to the existing proxy's Advisor chain.
For the latter, AbstractAdvisingBeanPostProcessor.isEligible(Class) is being called directly,
with the actual target class behind the existing proxy (as determined
by AopUtils.getTargetClass(Object)).
isEligible in class AbstractAdvisingBeanPostProcessorbean - the bean instancebeanName - the name of the beanAbstractAdvisingBeanPostProcessor.isEligible(Class)