public class JtaTransactionAnnotationParser extends java.lang.Object implements TransactionAnnotationParser, java.io.Serializable
javax.transaction.Transactional
annotation.Constructor and Description |
---|
JtaTransactionAnnotationParser() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
boolean |
isCandidateClass(java.lang.Class<?> targetClass)
Determine whether the given class is a candidate for transaction attributes
in the annotation format of this
TransactionAnnotationParser . |
TransactionAttribute |
parseTransactionAnnotation(java.lang.reflect.AnnotatedElement element)
Parse the transaction attribute for the given method or class,
based on an annotation type understood by this parser.
|
TransactionAttribute |
parseTransactionAnnotation(javax.transaction.Transactional ann)
Parse the transaction attribute for the given method or class,
based on an annotation type understood by this parser.
|
public boolean isCandidateClass(java.lang.Class<?> targetClass)
TransactionAnnotationParser
TransactionAnnotationParser
.
If this method returns false
, the methods on the given class
will not get traversed for #parseTransactionAnnotation
introspection.
Returning false
is therefore an optimization for non-affected
classes, whereas true
simply means that the class needs to get
fully introspected for each method on the given class individually.
isCandidateClass
in interface TransactionAnnotationParser
targetClass
- the class to introspectfalse
if the class is known to have no transaction
annotations at class or method level; true
otherwise. The default
implementation returns true
, leading to regular introspection.@Nullable public TransactionAttribute parseTransactionAnnotation(java.lang.reflect.AnnotatedElement element)
TransactionAnnotationParser
This essentially parses a known transaction annotation into Spring's metadata
attribute class. Returns null
if the method/class is not transactional.
parseTransactionAnnotation
in interface TransactionAnnotationParser
element
- the annotated method or classnull
if none foundAnnotationTransactionAttributeSource.determineTransactionAttribute(java.lang.reflect.AnnotatedElement)
public TransactionAttribute parseTransactionAnnotation(javax.transaction.Transactional ann)
TransactionAnnotationParser
This essentially parses a known transaction annotation into Spring's metadata
attribute class. Returns null
if the method/class is not transactional.
parseTransactionAnnotation
in interface TransactionAnnotationParser
ann
- the annotated method or classnull
if none foundAnnotationTransactionAttributeSource.determineTransactionAttribute(java.lang.reflect.AnnotatedElement)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object