Class Ejb3TransactionAnnotationParser
- java.lang.Object
- org.springframework.transaction.annotation.Ejb3TransactionAnnotationParser
- All Implemented Interfaces:
Serializable,TransactionAnnotationParser
public class Ejb3TransactionAnnotationParser extends Object implements TransactionAnnotationParser, Serializable
Strategy implementation for parsing EJB3'sTransactionAttributeannotation.- Since:
- 2.5
- Author:
- Juergen Hoeller
- See Also:
- Serialized Form
Constructor Summary
Constructors Constructor Description Ejb3TransactionAnnotationParser()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)inthashCode()booleanisCandidateClass(Class<?> targetClass)Determine whether the given class is a candidate for transaction attributes in the annotation format of thisTransactionAnnotationParser.TransactionAttributeparseTransactionAnnotation(AnnotatedElement element)Parse the transaction attribute for the given method or class, based on an annotation type understood by this parser.TransactionAttributeparseTransactionAnnotation(TransactionAttribute ann)
Constructor Detail
Ejb3TransactionAnnotationParser
public Ejb3TransactionAnnotationParser()
Method Detail
isCandidateClass
public boolean isCandidateClass(Class<?> targetClass)
Description copied from interface:TransactionAnnotationParserDetermine whether the given class is a candidate for transaction attributes in the annotation format of thisTransactionAnnotationParser.If this method returns
false, the methods on the given class will not get traversed for#parseTransactionAnnotationintrospection. Returningfalseis therefore an optimization for non-affected classes, whereastruesimply means that the class needs to get fully introspected for each method on the given class individually.- Specified by:
isCandidateClassin interfaceTransactionAnnotationParser- Parameters:
targetClass- the class to introspect- Returns:
falseif the class is known to have no transaction annotations at class or method level;trueotherwise. The default implementation returnstrue, leading to regular introspection.
parseTransactionAnnotation
@Nullable public TransactionAttribute parseTransactionAnnotation(AnnotatedElement element)
Description copied from interface:TransactionAnnotationParserParse the transaction attribute for the given method or class, based on an annotation type understood by this parser.This essentially parses a known transaction annotation into Spring's metadata attribute class. Returns
nullif the method/class is not transactional.- Specified by:
parseTransactionAnnotationin interfaceTransactionAnnotationParser- Parameters:
element- the annotated method or class- Returns:
- the configured transaction attribute, or
nullif none found - See Also:
AnnotationTransactionAttributeSource.determineTransactionAttribute(java.lang.reflect.AnnotatedElement)
parseTransactionAnnotation
public TransactionAttribute parseTransactionAnnotation(TransactionAttribute ann)