public interface TransactionAnnotationParser
AnnotationTransactionAttributeSource
は、Spring 自体の Transactional
、JTA 1.2 の Transactional
SE または EJB3 の TransactionAttribute
EE などの特定のアノテーション型をサポートするために、そのようなパーサーに委譲します。AnnotationTransactionAttributeSource
, SpringTransactionAnnotationParser
, Ejb3TransactionAnnotationParser
, JtaTransactionAnnotationParser
修飾子と型 | メソッドと説明 |
---|---|
default boolean | isCandidateClass(ClassSE<?> targetClass) 指定されたクラスが、この TransactionAnnotationParser のアノテーション形式のトランザクション属性の候補であるかどうかを判別します。 |
TransactionAttribute | parseTransactionAnnotation(AnnotatedElementSE element) このパーサーが理解できるアノテーション型に基づいて、指定されたメソッドまたはクラスのトランザクション属性を解析します。 |
default boolean isCandidateClass(ClassSE<?> targetClass)
TransactionAnnotationParser
のアノテーション形式のトランザクション属性の候補であるかどうかを判別します。 このメソッドが false
を返す場合、指定されたクラスのメソッドは #parseTransactionAnnotation
イントロスペクションのためにトラバースされません。false
を返すことは影響を受けないクラスの最適化ですが、true
は単に、クラスが特定のクラスの各メソッドに対して個別に完全にイントロスペクトされる必要があることを意味します。
targetClass
- 内省するクラス false
(クラスがクラスまたはメソッドレベルでトランザクションアノテーションを持たないことがわかっている場合)。それ以外の場合は true
。デフォルトの実装は true
を返し、通常のイントロスペクションが行われます。@Nullable TransactionAttribute parseTransactionAnnotation(AnnotatedElementSE element)
これは基本的に、既知のトランザクションアノテーションを Spring のメタデータ属性クラスに解析します。メソッド / クラスがトランザクションでない場合、null
を返します。
element
- アノテーション付きのメソッドまたはクラス null
AnnotationTransactionAttributeSource.determineTransactionAttribute(java.lang.reflect.AnnotatedElement)