Class AutoProxyRegistrar
java.lang.Object
org.springframework.context.annotation.AutoProxyRegistrar
- All Implemented Interfaces:
ImportBeanDefinitionRegistrar
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.- Since:
- 3.1
- Author:
- Chris Beams
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidregisterBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) Register, escalate, and configure the standard auto proxy creator (APC) against the given registry.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ImportBeanDefinitionRegistrar
registerBeanDefinitions
-
Constructor Details
-
AutoProxyRegistrar
public AutoProxyRegistrar()
-
-
Method Details
-
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@Configurationclass that has bothmodeandproxyTargetClassattributes. Ifmodeis set toPROXY, the APC is registered; ifproxyTargetClassis set totrue, then the APC is forced to use subclass (CGLIB) proxying.Several
@Enable*annotations expose bothmodeandproxyTargetClassattributes. 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 rightmodeandproxyTargetClassattributes, the APC can be registered and configured all the same.- Specified by:
registerBeanDefinitionsin interfaceImportBeanDefinitionRegistrar- Parameters:
importingClassMetadata- annotation metadata of the importing classregistry- current bean definition registry
-