org.springframework.aop.framework.autoproxy

Class AutoProxyUtils

  • java.lang.Object
    • org.springframework.aop.framework.autoproxy.AutoProxyUtils


  • public abstract class AutoProxyUtils
    extends java.lang.Object
    Utilities for auto-proxy aware components. Mainly for internal use within the framework.
    Since:
    2.0.3
    Author:
    Juergen Hoeller
    See Also:
    AbstractAutoProxyCreator
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String ORIGINAL_TARGET_CLASS_ATTRIBUTE
      Bean definition attribute that indicates the original target class of an auto-proxied bean, e.g.
      static java.lang.String PRESERVE_TARGET_CLASS_ATTRIBUTE
      Bean definition attribute that may indicate whether a given bean is supposed to be proxied with its target class (in case of it getting proxied in the first place).
    • Constructor Summary

      Constructors 
      Constructor and Description
      AutoProxyUtils() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.Class<?> determineTargetClass(ConfigurableListableBeanFactory beanFactory, java.lang.String beanName)
      Determine the original target class for the specified bean, if possible, otherwise falling back to a regular getType lookup.
      static boolean shouldProxyTargetClass(ConfigurableListableBeanFactory beanFactory, java.lang.String beanName)
      Determine whether the given bean should be proxied with its target class rather than its interfaces.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AutoProxyUtils

        public AutoProxyUtils()
    • Method Detail

      • shouldProxyTargetClass

        public static boolean shouldProxyTargetClass(ConfigurableListableBeanFactory beanFactory,
                                                     @Nullable
                                                     java.lang.String beanName)
        Determine whether the given bean should be proxied with its target class rather than its interfaces. Checks the "preserveTargetClass" attribute of the corresponding bean definition.
        Parameters:
        beanFactory - the containing ConfigurableListableBeanFactory
        beanName - the name of the bean
        Returns:
        whether the given bean should be proxied with its target class
      • determineTargetClass

        @Nullable
        public static java.lang.Class<?> determineTargetClass(ConfigurableListableBeanFactory beanFactory,
                                                                        @Nullable
                                                                        java.lang.String beanName)
        Determine the original target class for the specified bean, if possible, otherwise falling back to a regular getType lookup.
        Parameters:
        beanFactory - the containing ConfigurableListableBeanFactory
        beanName - the name of the bean
        Returns:
        the original target class as stored in the bean definition, if any
        Since:
        4.2.3
        See Also:
        BeanFactory.getType(String)