クラス AnnotationTransactionAttributeSource
java.lang.ObjectSE
org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
- 実装されているすべてのインターフェース:
SerializableSE、Aware、EmbeddedValueResolverAware、TransactionAttributeSource
public class AnnotationTransactionAttributeSource
extends AbstractFallbackTransactionAttributeSource
implements SerializableSE
JDK 1.5 + アノテーション形式でトランザクションメタデータを操作するための
TransactionAttributeSource インターフェースの実装。 このクラスは、Spring の JDK 1.5 + Transactional アノテーションを読み取り、対応するトランザクション属性を Spring のトランザクションインフラストラクチャに公開します。JTA 1.2 の TransactionalEE および EJB3 の TransactionAttributeEE アノテーション(存在する場合)もサポートします。このクラスは、カスタム TransactionAttributeSource の基本クラスとして機能することも、TransactionAnnotationParser 戦略を通じてカスタマイズされることもあります。
- 導入:
- 1.2
- 作成者:
- Colin Sampaleanu, Juergen Hoeller
- 関連事項:
TransactionalTransactionAnnotationParserSpringTransactionAnnotationParserEjb3TransactionAnnotationParserTransactionAspectSupport.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource)TransactionProxyFactoryBean.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource)- 連載形式
フィールドのサマリー
クラス org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource から継承されたフィールド
loggerコンストラクターの概要
コンストラクターコンストラクター説明デフォルトの AnnotationTransactionAttributeSource を作成し、Transactionalアノテーションまたは EJB3TransactionAttributeEE アノテーションを運ぶ public メソッドをサポートします。AnnotationTransactionAttributeSource(boolean publicMethodsOnly) Transactionalアノテーションまたは EJB3TransactionAttributeEE アノテーションを運ぶ public メソッドをサポートするカスタム AnnotationTransactionAttributeSource を作成します。AnnotationTransactionAttributeSource(SetSE<TransactionAnnotationParser> annotationParsers) カスタム AnnotationTransactionAttributeSource を作成します。AnnotationTransactionAttributeSource(TransactionAnnotationParser annotationParser) カスタム AnnotationTransactionAttributeSource を作成します。AnnotationTransactionAttributeSource(TransactionAnnotationParser... annotationParsers) カスタム AnnotationTransactionAttributeSource を作成します。メソッドのサマリー
修飾子と型メソッド説明protected booleanデフォルトでは、public メソッドのみをトランザクション対応にすることができます。protected TransactionAttribute指定されたメソッドまたはクラスのトランザクション属性を決定します。booleanprotected TransactionAttributefindTransactionAttribute(ClassSE<?> clazz) サブクラスは、特定のクラスのトランザクション属性があれば、それを返すためにこれを実装する必要があります。protected TransactionAttributefindTransactionAttribute(MethodSE method) サブクラスは、指定されたメソッドのトランザクション属性があればそれを返すためにこれを実装する必要があります。inthashCode()booleanisCandidateClass(ClassSE<?> targetClass) 指定されたクラスが、このTransactionAttributeSourceのメタデータ形式のトランザクション属性の候補であるかどうかを判別します。クラス org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource から継承されたメソッド
computeTransactionAttribute, getCacheKey, getTransactionAttribute, setEmbeddedValueResolver
コンストラクターの詳細
AnnotationTransactionAttributeSource
public AnnotationTransactionAttributeSource()デフォルトの AnnotationTransactionAttributeSource を作成し、Transactionalアノテーションまたは EJB3TransactionAttributeEE アノテーションを運ぶ public メソッドをサポートします。AnnotationTransactionAttributeSource
public AnnotationTransactionAttributeSource(boolean publicMethodsOnly) Transactionalアノテーションまたは EJB3TransactionAttributeEE アノテーションを運ぶ public メソッドをサポートするカスタム AnnotationTransactionAttributeSource を作成します。- パラメーター:
publicMethodsOnly-Transactionalアノテーションのみを保持する public メソッド(通常はプロキシベースの AOP で使用)、または保護 / プライベートメソッドもサポートするかどうか (通常、AspectJ クラスのウィービングで使用されます)
AnnotationTransactionAttributeSource
カスタム AnnotationTransactionAttributeSource を作成します。- パラメーター:
annotationParser- 使用する TransactionAnnotationParser
AnnotationTransactionAttributeSource
カスタム AnnotationTransactionAttributeSource を作成します。- パラメーター:
annotationParsers- 使用する TransactionAnnotationParsers
AnnotationTransactionAttributeSource
カスタム AnnotationTransactionAttributeSource を作成します。- パラメーター:
annotationParsers- 使用する TransactionAnnotationParsers
メソッドの詳細
isCandidateClass
インターフェースからコピーされた説明:TransactionAttributeSource指定されたクラスが、このTransactionAttributeSourceのメタデータ形式のトランザクション属性の候補であるかどうかを判別します。このメソッドが
falseを返す場合、指定されたクラスのメソッドはTransactionAttributeSource.getTransactionAttribute(java.lang.reflect.Method, java.lang.Class<?>)イントロスペクションのために走査されません。falseを返すことは、影響を受けないクラスの最適化です。一方、trueは、クラスが特定のクラスの各メソッドに対して個別に完全にイントロスペクションする必要があることを意味します。- 次で指定:
- インターフェース
TransactionAttributeSourceのisCandidateClass - パラメーター:
targetClass- イントロスペクトするクラス- 戻り値:
- クラスまたはメソッドレベルでトランザクション属性を持たないことがクラスに知られている場合は
false。それ以外の場合はtrue。デフォルトの実装はtrueを返し、通常のイントロスペクションにつながります。
findTransactionAttribute
クラスからコピーされた説明:AbstractFallbackTransactionAttributeSourceサブクラスは、特定のクラスのトランザクション属性があれば、それを返すためにこれを実装する必要があります。- 次で指定:
- クラス
AbstractFallbackTransactionAttributeSourceのfindTransactionAttribute - パラメーター:
clazz- 属性を取得するクラス- 戻り値:
- このクラスに関連付けられているすべてのトランザクション属性、または存在しない場合は
null
findTransactionAttribute
クラスからコピーされた説明:AbstractFallbackTransactionAttributeSourceサブクラスは、指定されたメソッドのトランザクション属性があればそれを返すためにこれを実装する必要があります。- 次で指定:
- クラス
AbstractFallbackTransactionAttributeSourceのfindTransactionAttribute - パラメーター:
method- 属性を取得するメソッド- 戻り値:
- このメソッドに関連付けられたすべてのトランザクション属性。ない場合は
null
determineTransactionAttribute
指定されたメソッドまたはクラスのトランザクション属性を決定します。この実装は、既知のアノテーションを Spring のメタデータ属性クラスに解析するために、構成済みの
TransactionAnnotationParsersに委譲します。トランザクションでない場合、nullを返します。トランザクションメタデータを運ぶカスタムアノテーションをサポートするためにオーバーライドできます。
- パラメーター:
element- アノテーション付きのメソッドまたはクラス- 戻り値:
- 設定されたトランザクション属性、または何も見つからなかった場合は
null
allowPublicMethodsOnly
protected boolean allowPublicMethodsOnly()デフォルトでは、public メソッドのみをトランザクション対応にすることができます。- オーバーライド:
- クラス
AbstractFallbackTransactionAttributeSourceのallowPublicMethodsOnly
equals
hashCode
public int hashCode()