Class PackageAutoProxyCreator

  • All Implemented Interfaces:
    Serializable, org.springframework.aop.framework.AopInfrastructureBean, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor, org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered

    public class PackageAutoProxyCreator
    extends org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
    implements org.springframework.beans.factory.InitializingBean
    a proxy creator that applies the specified advisors to the classes defined in the base package. The default advisors are AuthenticationAdvice, RunAsAdvice and TransactionalAdvice however your own might be added and the default could be skipped by setting skipDefaultInterceptos to true
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String[] DEFAULT_INTERCEPTORS  
      • Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator

        DO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterPropertiesSet()  
      protected Object[] getAdvicesAndAdvisorsForBean​(Class<?> beanClass, String beanName, org.springframework.aop.TargetSource targetSource)
      Identify as bean to proxy if the bean name is in the configured base package.
      void setBasePackage​(String basePackage)  
      void setInterceptorNames​(String... interceptorNames)  
      void setSkipDefaultInterceptos​(boolean skipDefaultInterceptos)  
      • Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator

        advisorsPreFiltered, buildAdvisors, createProxy, customizeProxyFactory, determineCandidateConstructors, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, isFrozen, isInfrastructureClass, postProcessAfterInitialization, postProcessBeforeInstantiation, postProcessProperties, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setBeanFactory, setCustomTargetSourceCreators, setFrozen, shouldProxyTargetClass, shouldSkip, wrapIfNecessary
      • 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, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
      • Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor

        postProcessBeforeInitialization
      • Methods inherited from interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor

        postProcessAfterInstantiation, postProcessPropertyValues
    • Field Detail

      • DEFAULT_INTERCEPTORS

        public static final String[] DEFAULT_INTERCEPTORS
    • Constructor Detail

      • PackageAutoProxyCreator

        public PackageAutoProxyCreator()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • getAdvicesAndAdvisorsForBean

        protected Object[] getAdvicesAndAdvisorsForBean​(Class<?> beanClass,
                                                        String beanName,
                                                        org.springframework.aop.TargetSource targetSource)
        Identify as bean to proxy if the bean name is in the configured base package.
        Specified by:
        getAdvicesAndAdvisorsForBean in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
      • setInterceptorNames

        public void setInterceptorNames​(String... interceptorNames)
        Overrides:
        setInterceptorNames in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
      • setBasePackage

        public void setBasePackage​(String basePackage)
      • setSkipDefaultInterceptos

        public void setSkipDefaultInterceptos​(boolean skipDefaultInterceptos)