org.springframework.context.annotation

Class AutoProxyRegistrar

  • java.lang.Object
    • org.springframework.context.annotation.AutoProxyRegistrar
    • Constructor Detail

      • AutoProxyRegistrar

        public AutoProxyRegistrar()
    • Method Detail

      • registerBeanDefinitions

        public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata,
                                            BeanDefinitionRegistry registry)
        Register, escalate, and configure the standard auto proxy creator (APC) against the given registry. Works by finding the nearest annotation declared on the importing @Configuration class that has both mode and proxyTargetClass attributes. If mode is set to PROXY, the APC is registered; if proxyTargetClass is set to true, then the APC is forced to use subclass (CGLIB) proxying.

        Several @Enable* annotations expose both mode and proxyTargetClass attributes. It is important to note that most of these capabilities end up sharing a single APC. For this reason, this implementation doesn't "care" exactly which annotation it finds -- as long as it exposes the right mode and proxyTargetClass attributes, the APC can be registered and configured all the same.

        Specified by:
        registerBeanDefinitions in interface ImportBeanDefinitionRegistrar
        Parameters:
        importingClassMetadata - annotation metadata of the importing class
        registry - current bean definition registry