org.springframework.transaction.annotation
Class AnnotationTransactionAttributeSource
java.lang.Object
org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
- All Implemented Interfaces:
- Serializable, TransactionAttributeSource
public class AnnotationTransactionAttributeSource
- extends AbstractFallbackTransactionAttributeSource
- implements Serializable
Implementation of TransactionAttributeSource for working with
transaction metadata in JDK 1.5+ annotation format.
This class reads the JDK 1.5+ Transactional annotation and
exposes corresponding transaction attributes to Spring's transaction infrastructure.
This is a direct alternative to AttributesTransactionAttributeSource,
which is able to read in source-level attributes via Commons Attributes.
- Since:
- 1.2
- Author:
- Colin Sampaleanu, Juergen Hoeller
- See Also:
Transactional,
TransactionAspectSupport.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource),
TransactionProxyFactoryBean.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource),
AttributesTransactionAttributeSource,
CommonsAttributes,
Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnnotationTransactionAttributeSource
public AnnotationTransactionAttributeSource()
findAllAttributes
protected Collection findAllAttributes(Method method)
- Returns all JDK 1.5+ annotations found for the given method.
- Specified by:
findAllAttributes in class AbstractFallbackTransactionAttributeSource
- Parameters:
method - the method to retrieve attributes for
- Returns:
- all attributes associated with this method (may be
null)
findAllAttributes
protected Collection findAllAttributes(Class clazz)
- Returns all JDK 1.5+ annotations found for the given class.
- Specified by:
findAllAttributes in class AbstractFallbackTransactionAttributeSource
- Parameters:
clazz - class to retrieve attributes for
- Returns:
- all attributes associated with this class (may be
null)
findTransactionAttribute
protected TransactionAttribute findTransactionAttribute(Collection atts)
- Return the transaction attribute, given this set of attributes
attached to a method or class. Overrides method from parent class.
This version actually converts JDK 5.0+ Annotations to the Spring
classes. Returns null if it's not transactional.
- Overrides:
findTransactionAttribute in class AbstractFallbackTransactionAttributeSource
- Parameters:
atts - attributes attached to a method or class. May
be null, in which case a null TransactionAttribute will be returned.
- Returns:
- TransactionAttribute configured transaction attribute,
or
null if none was found
Copyright (c) 2002-2007 The Spring Framework Project.