org.springframework.transaction.config
Class AnnotationDrivenBeanDefinitionParser

java.lang.Object
  extended by org.springframework.transaction.config.AnnotationDrivenBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser

 class AnnotationDrivenBeanDefinitionParser
extends java.lang.Object
implements BeanDefinitionParser

BeanDefinitionParser implementation that allows users to easily configure all the infrastructure beans required to enable annotation-driven transaction demarcation.

By default, all proxies are created as JDK proxies. This may cause some problems if you are injecting objects as concrete classes rather than interfaces. To overcome this restriction you can set the 'proxy-target-class' attribute to 'true', which will result in class-based proxies being created.

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop

Nested Class Summary
private static class AnnotationDrivenBeanDefinitionParser.AopAutoProxyConfigurer
          Inner class to just introduce an AOP framework dependency when actually in proxy mode.
 
Field Summary
static java.lang.String TRANSACTION_ADVISOR_BEAN_NAME
          The bean name of the internally managed transaction advisor (mode="proxy").
static java.lang.String TRANSACTION_ASPECT_BEAN_NAME
          The bean name of the internally managed transaction aspect (mode="aspectj").
private static java.lang.String TRANSACTION_ASPECT_CLASS_NAME
           
 
Constructor Summary
AnnotationDrivenBeanDefinitionParser()
           
 
Method Summary
 BeanDefinition parse(org.w3c.dom.Element element, ParserContext parserContext)
          Parses the '<tx:annotation-driven/>' tag.
private  void registerTransactionAspect(org.w3c.dom.Element element, ParserContext parserContext)
           
private static void registerTransactionManager(org.w3c.dom.Element element, BeanDefinition def)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSACTION_ADVISOR_BEAN_NAME

public static final java.lang.String TRANSACTION_ADVISOR_BEAN_NAME
The bean name of the internally managed transaction advisor (mode="proxy").

See Also:
Constant Field Values

TRANSACTION_ASPECT_BEAN_NAME

public static final java.lang.String TRANSACTION_ASPECT_BEAN_NAME
The bean name of the internally managed transaction aspect (mode="aspectj").

See Also:
Constant Field Values

TRANSACTION_ASPECT_CLASS_NAME

private static final java.lang.String TRANSACTION_ASPECT_CLASS_NAME
See Also:
Constant Field Values
Constructor Detail

AnnotationDrivenBeanDefinitionParser

AnnotationDrivenBeanDefinitionParser()
Method Detail

parse

public BeanDefinition parse(org.w3c.dom.Element element,
                            ParserContext parserContext)
Parses the '<tx:annotation-driven/>' tag. Will register an AutoProxyCreator with the container as necessary.

Specified by:
parse in interface BeanDefinitionParser
Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the primary BeanDefinition

registerTransactionAspect

private void registerTransactionAspect(org.w3c.dom.Element element,
                                       ParserContext parserContext)

registerTransactionManager

private static void registerTransactionManager(org.w3c.dom.Element element,
                                               BeanDefinition def)