Top Description Fields Constructors Methods
org.springframework.context.annotation

public Class AutoProxyRegistrar

extends Object
implements ImportBeanDefinitionRegistrar
Class Inheritance
All Implemented Interfaces
org.springframework.context.annotation.ImportBeanDefinitionRegistrar
Imports
java.util.Set, org.apache.commons.logging.Log, .LogFactory, org.springframework.aop.config.AopConfigUtils, org.springframework.beans.factory.support.BeanDefinitionRegistry, org.springframework.core.annotation.AnnotationAttributes, org.springframework.core.type.AnnotationMetadata

Registers an auto proxy creator against the current BeanDefinitionRegistry as appropriate based on an @Enable* annotation having mode and proxyTargetClass attributes set to the correct values.
Author
Chris Beams
Since
3.1
See Also
org.springframework.cache.annotation.EnableCaching, org.springframework.transaction.annotation.EnableTransactionManagement

Field Summary

Modifier and TypeField and Description
private final Log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
registerBeanDefinitions(AnnotationMetadata
annotation metadata of the importing class
importingClassMetadata
,
BeanDefinitionRegistry
current bean definition registry
registry
)

Overrides default org.springframework.context.annotation.ImportBeanDefinitionRegistrar.registerBeanDefinitions.

Register, escalate, and configure the standard auto proxy creator (APC) against the given registry.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggerback to summary
private final Log logger

Constructor Detail

AutoProxyRegistrarback to summary
public AutoProxyRegistrar()

Method Detail

registerBeanDefinitionsback to summary
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry)

Overrides default org.springframework.context.annotation.ImportBeanDefinitionRegistrar.registerBeanDefinitions.

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.

Parameters
importingClassMetadata:AnnotationMetadata

Doc from org.springframework.context.annotation.ImportBeanDefinitionRegistrar.registerBeanDefinitions.

annotation metadata of the importing class

registry:BeanDefinitionRegistry

Doc from org.springframework.context.annotation.ImportBeanDefinitionRegistrar.registerBeanDefinitions.

current bean definition registry

Annotations
@Override