public interface TransactionAttributeSourceTransactionInterceptor がメタデータの取得に使用する戦略インターフェース。実装は、構成、ソースレベルのメタデータ属性(アノテーションなど)、またはその他の場所からトランザクション属性を取得する方法を知っています。
TransactionAspectSupport.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource), TransactionProxyFactoryBean.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource), AnnotationTransactionAttributeSource| 修飾子と型 | メソッドと説明 |
|---|---|
TransactionAttribute | getTransactionAttribute(MethodSE method, ClassSE<?> targetClass) 指定されたメソッドのトランザクション属性を返します。メソッドが非トランザクションの場合は null を返します。 |
default boolean | isCandidateClass(ClassSE<?> targetClass) 指定されたクラスが、この TransactionAttributeSource のメタデータ形式のトランザクション属性の候補であるかどうかを判別します。 |
default boolean isCandidateClass(ClassSE<?> targetClass)
TransactionAttributeSource のメタデータ形式のトランザクション属性の候補であるかどうかを判別します。 このメソッドが false を返す場合、指定されたクラスのメソッドは getTransactionAttribute(java.lang.reflect.Method, java.lang.Class<?>) イントロスペクションのために走査されません。false を返すことは、影響を受けないクラスの最適化です。一方、true は、クラスが特定のクラスの各メソッドに対して個別に完全にイントロスペクションする必要があることを意味します。
targetClass - イントロスペクトするクラス false。それ以外の場合は true。デフォルトの実装は true を返し、通常のイントロスペクションにつながります。@Nullable TransactionAttribute getTransactionAttribute(MethodSE method, @Nullable ClassSE<?> targetClass)
null を返します。method - イントロスペクトする方法 targetClass - ターゲットクラス (null の場合があります。この場合、メソッドの宣言クラスを使用する必要があります)null