Top Description Constructors Methods
org.springframework.aop.config

public abstract Class AbstractInterceptorDrivenBeanDefinitionDecorator

extends Object
implements BeanDefinitionDecorator
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.xml.BeanDefinitionDecorator
Imports
java.util.List, org.w3c.dom.Node, org.springframework.aop.framework.ProxyFactoryBean, org.springframework.beans.factory.config.BeanDefinition, .BeanDefinitionHolder, org.springframework.beans.factory.support.AbstractBeanDefinition, .BeanDefinitionReaderUtils, .BeanDefinitionRegistry, .ManagedList, .RootBeanDefinition, org.springframework.beans.factory.xml.BeanDefinitionDecorator, .ParserContext, org.springframework.util.Assert, .ClassUtils, .StringUtils

Base implementation for 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 org.springframework.beans.factory.xml.BeanDefinitionDecorator already created the org.springframework.aop.framework.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.

Authors
Rob Harrop, Juergen Hoeller
Since
2.0
See Also
org.aopalliance.intercept.MethodInterceptor

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addInterceptorNameToList(String interceptorName, BeanDefinition beanDefinition)

protected abstract BeanDefinition
createInterceptorDefinition(Node node)

Subclasses should implement this method to return the BeanDefinition for the interceptor they wish to apply to the bean being decorated.

public final BeanDefinitionHolder
decorate(Node node, BeanDefinitionHolder definitionHolder, ParserContext parserContext)

Implements org.springframework.beans.factory.xml.BeanDefinitionDecorator.decorate.

Parse the specified Node (either an element or an attribute) and decorate the supplied org.springframework.beans.factory.config.BeanDefinition, returning the decorated definition.
protected String
private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AbstractInterceptorDrivenBeanDefinitionDecoratorback to summary
public AbstractInterceptorDrivenBeanDefinitionDecorator()

Method Detail

addInterceptorNameToListback to summary
private void addInterceptorNameToList(String interceptorName, BeanDefinition beanDefinition)
Annotations
@SuppressWarnings:unchecked
createInterceptorDefinitionback to summary
protected abstract BeanDefinition createInterceptorDefinition(Node node)

Subclasses should implement this method to return the BeanDefinition for the interceptor they wish to apply to the bean being decorated.

decorateback to summary
public final BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definitionHolder, ParserContext parserContext)

Implements org.springframework.beans.factory.xml.BeanDefinitionDecorator.decorate.

Doc from org.springframework.beans.factory.xml.BeanDefinitionDecorator.decorate.

Parse the specified Node (either an element or an attribute) and decorate the supplied org.springframework.beans.factory.config.BeanDefinition, returning the decorated definition.

Implementations may choose to return a completely new definition, which will replace the original definition in the resulting org.springframework.beans.factory.BeanFactory.

The supplied ParserContext can be used to register any additional beans needed to support the main definition.

Annotations
@Override
getInterceptorNameSuffixback to summary
protected String getInterceptorNameSuffix(BeanDefinition interceptorDefinition)
isProxyFactoryBeanDefinitionback to summary
private boolean isProxyFactoryBeanDefinition(BeanDefinition existingDefinition)