Class AbstractInterceptorDrivenBeanDefinitionDecorator
- All Implemented Interfaces:
BeanDefinitionDecorator
BeanDefinitionDecorators
wishing to add an interceptor
to the resulting bean.
This base class controls the creation of the ProxyFactoryBean bean definition
and wraps the original as an inner-bean definition for the target property
of ProxyFactoryBean.
Chaining is correctly handled, ensuring that only one ProxyFactoryBean definition
is created. If a previous BeanDefinitionDecorator
already created the ProxyFactoryBean then the
interceptor is simply added to the existing definition.
Subclasses have only to create the BeanDefinition to the interceptor that
they wish to add.
- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BeanDefinitionSubclasses should implement this method to return theBeanDefinitionfor the interceptor they wish to apply to the bean being decorated.final BeanDefinitionHolderdecorate(Node node, BeanDefinitionHolder definitionHolder, ParserContext parserContext) Parse the specifiedNode(either an element or an attribute) and decorate the suppliedBeanDefinition, returning the decorated definition.protected StringgetInterceptorNameSuffix(BeanDefinition interceptorDefinition)
-
Constructor Details
-
AbstractInterceptorDrivenBeanDefinitionDecorator
public AbstractInterceptorDrivenBeanDefinitionDecorator()
-
-
Method Details
-
decorate
public final BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definitionHolder, ParserContext parserContext) Description copied from interface:BeanDefinitionDecoratorParse the specifiedNode(either an element or an attribute) and decorate the suppliedBeanDefinition, returning the decorated definition.Implementations may choose to return a completely new definition, which will replace the original definition in the resulting
BeanFactory.The supplied
ParserContextcan be used to register any additional beans needed to support the main definition.- Specified by:
decoratein interfaceBeanDefinitionDecorator
-
getInterceptorNameSuffix
-
createInterceptorDefinition
Subclasses should implement this method to return theBeanDefinitionfor the interceptor they wish to apply to the bean being decorated.
-