public interface TransactionAnnotationParser
AnnotationTransactionAttributeSource delegates to such
parsers for supporting specific annotation types such as Spring's own
Transactional, JTA 1.2's Transactional
or EJB3's TransactionAttribute.AnnotationTransactionAttributeSource,
SpringTransactionAnnotationParser,
Ejb3TransactionAnnotationParser,
JtaTransactionAnnotationParser| Modifier and Type | Method and Description |
|---|---|
default boolean |
isCandidateClass(Class<?> targetClass)
Determine whether the given class is a candidate for transaction attributes
in the annotation format of this
TransactionAnnotationParser. |
TransactionAttribute |
parseTransactionAnnotation(AnnotatedElement element)
Parse the transaction attribute for the given method or class,
based on an annotation type understood by this parser.
|
default boolean isCandidateClass(Class<?> targetClass)
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.
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 TransactionAttribute parseTransactionAnnotation(AnnotatedElement element)
This essentially parses a known transaction annotation into Spring's metadata
attribute class. Returns null if the method/class is not transactional.
element - the annotated method or classnull if none foundAnnotationTransactionAttributeSource.determineTransactionAttribute(java.lang.reflect.AnnotatedElement)