类 AbstractAdvisingBeanPostProcessor

所有已实现的接口:
AopInfrastructureBean, infra.beans.factory.Aware, infra.beans.factory.BeanClassLoaderAware, infra.beans.factory.config.BeanPostProcessor, infra.beans.factory.config.InstantiationAwareBeanPostProcessor, infra.beans.factory.config.SmartInstantiationAwareBeanPostProcessor, infra.beans.factory.InitializationBeanPostProcessor, infra.core.Ordered, Serializable
直接已知子类:
AbstractBeanFactoryAwareAdvisingPostProcessor

public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSupport implements infra.beans.factory.InitializationBeanPostProcessor, infra.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
Base class for BeanPostProcessor implementations that apply a AOP Advisor to specific beans.
从以下版本开始:
4.0
作者:
Juergen Hoeller, Harry Yang
另请参阅:
  • 字段详细资料

    • serialVersionUID

      private static final long serialVersionUID
      另请参阅:
    • advisor

      @Nullable protected Advisor advisor
    • beforeExistingAdvisors

      protected boolean beforeExistingAdvisors
    • eligibleBeans

      private final ConcurrentHashMap<Class<?>,Boolean> eligibleBeans
  • 构造器详细资料

    • AbstractAdvisingBeanPostProcessor

      public AbstractAdvisingBeanPostProcessor()
  • 方法详细资料

    • setBeforeExistingAdvisors

      public void setBeforeExistingAdvisors(boolean beforeExistingAdvisors)
      Set whether this post-processor's advisor is supposed to apply before existing advisors when encountering a pre-advised object.

      Default is "false", applying the advisor after existing advisors, i.e. as close as possible to the target method. Switch this to "true" in order for this post-processor's advisor to wrap existing advisors as well.

      Note: Check the concrete post-processor's javadoc whether it possibly changes this flag by default, depending on the nature of its advisor.

    • determineBeanType

      public Class<?> determineBeanType(Class<?> beanClass, String beanName)
      指定者:
      determineBeanType 在接口中 infra.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
    • postProcessAfterInitialization

      public Object postProcessAfterInitialization(Object bean, String beanName)
      指定者:
      postProcessAfterInitialization 在接口中 infra.beans.factory.InitializationBeanPostProcessor
    • isEligible

      protected boolean isEligible(Object bean, String beanName)
      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)).

      参数:
      bean - the bean instance
      beanName - the name of the bean
      另请参阅:
    • isEligible

      protected boolean isEligible(Class<?> targetClass)
      Check whether the given class is eligible for advising with this post-processor's Advisor.

      Implements caching of canApply results per bean target class.

      参数:
      targetClass - the class to check against
      另请参阅:
    • prepareProxyFactory

      protected ProxyFactory prepareProxyFactory(Object bean, String beanName)
      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(infra.aop.framework.ProxyFactory) allows for late customizations of those parts right before proxy creation.

      参数:
      bean - the bean instance to create a proxy for
      beanName - the corresponding bean name
      返回:
      the ProxyFactory, initialized with this processor's ProxyConfig settings and the specified bean
      另请参阅:
    • customizeProxyFactory

      protected void customizeProxyFactory(ProxyFactory proxyFactory)
      Subclasses may choose to implement this: for example, to change the interfaces exposed.

      The default implementation is empty.

      参数:
      proxyFactory - the ProxyFactory that is already configured with target, advisor and interfaces and will be used to create the proxy immediately after this method returns
      另请参阅: