类 AbstractInterceptorDrivenBeanDefinitionDecorator
- java.lang.Object
- org.springframework.aop.config.AbstractInterceptorDrivenBeanDefinitionDecorator
- 所有已实现的接口:
BeanDefinitionDecorator
public abstract class AbstractInterceptorDrivenBeanDefinitionDecorator extends Object implements BeanDefinitionDecorator
Base implementation forBeanDefinitionDecorators
wishing to add aninterceptor
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 thetarget
property ofProxyFactoryBean
.Chaining is correctly handled, ensuring that only one
ProxyFactoryBean
definition is created. If a previousBeanDefinitionDecorator
already created theProxyFactoryBean
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.- 从以下版本开始:
- 2.0
- 作者:
- Rob Harrop, Juergen Hoeller
- 另请参阅:
MethodInterceptor
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected abstract BeanDefinition
createInterceptorDefinition(Node node)
Subclasses should implement this method to return theBeanDefinition
for the interceptor they wish to apply to the bean being decorated.BeanDefinitionHolder
decorate(Node node, BeanDefinitionHolder definitionHolder, ParserContext parserContext)
Parse the specifiedNode
(either an element or an attribute) and decorate the suppliedBeanDefinition
, returning the decorated definition.protected String
getInterceptorNameSuffix(BeanDefinition interceptorDefinition)
构造器详细资料
AbstractInterceptorDrivenBeanDefinitionDecorator
public AbstractInterceptorDrivenBeanDefinitionDecorator()
方法详细资料
decorate
public final BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definitionHolder, ParserContext parserContext)
从接口复制的说明:BeanDefinitionDecorator
Parse 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
ParserContext
can be used to register any additional beans needed to support the main definition.- 指定者:
decorate
在接口中BeanDefinitionDecorator
getInterceptorNameSuffix
protected String getInterceptorNameSuffix(BeanDefinition interceptorDefinition)
createInterceptorDefinition
protected abstract BeanDefinition createInterceptorDefinition(Node node)
Subclasses should implement this method to return theBeanDefinition
for the interceptor they wish to apply to the bean being decorated.