Class AutoProxyRegistrar
- java.lang.Object
- org.springframework.context.annotation.AutoProxyRegistrar
- All Implemented Interfaces:
ImportBeanDefinitionRegistrar
public class AutoProxyRegistrar extends Object implements ImportBeanDefinitionRegistrar
Registers an auto proxy creator against the currentBeanDefinitionRegistry
as appropriate based on an@Enable*
annotation havingmode
andproxyTargetClass
attributes set to the correct values.- Since:
- 3.1
- Author:
- Chris Beams
- See Also:
EnableCaching
,EnableTransactionManagement
Constructor Summary
Constructors Constructor Description AutoProxyRegistrar()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry)
Register, escalate, and configure the standard auto proxy creator (APC) against the given registry.
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 bothmode
andproxyTargetClass
attributes. Ifmode
is set toPROXY
, the APC is registered; ifproxyTargetClass
is set totrue
, then the APC is forced to use subclass (CGLIB) proxying.Several
@Enable*
annotations expose bothmode
andproxyTargetClass
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 rightmode
andproxyTargetClass
attributes, the APC can be registered and configured all the same.- Specified by:
registerBeanDefinitions
in interfaceImportBeanDefinitionRegistrar
- Parameters:
importingClassMetadata
- annotation metadata of the importing classregistry
- current bean definition registry