クラス 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 の Transactional
EE および EJB3 の TransactionAttribute
EE アノテーション(存在する場合)もサポートします。このクラスは、カスタム TransactionAttributeSource の基本クラスとして機能することも、TransactionAnnotationParser
戦略を通じてカスタマイズされることもあります。
- 導入:
- 1.2
- 作成者:
- Colin Sampaleanu, Juergen Hoeller
- 関連事項:
Transactional
TransactionAnnotationParser
SpringTransactionAnnotationParser
Ejb3TransactionAnnotationParser
TransactionAspectSupport.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource)
TransactionProxyFactoryBean.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource)
- 直列化された形式
フィールドサマリー
クラス org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource から継承されたフィールド
logger
コンストラクターのサマリー
コンストラクターコンストラクター説明デフォルトの AnnotationTransactionAttributeSource を作成し、Transactional
アノテーションまたは EJB3TransactionAttribute
EE アノテーションを運ぶ public メソッドをサポートします。AnnotationTransactionAttributeSource
(boolean publicMethodsOnly) Transactional
アノテーションまたは EJB3TransactionAttribute
EE アノテーションを運ぶ public メソッドをサポートするカスタム AnnotationTransactionAttributeSource を作成します。AnnotationTransactionAttributeSource
(SetSE<TransactionAnnotationParser> annotationParsers) カスタム AnnotationTransactionAttributeSource を作成します。AnnotationTransactionAttributeSource
(TransactionAnnotationParser annotationParser) カスタム AnnotationTransactionAttributeSource を作成します。AnnotationTransactionAttributeSource
(TransactionAnnotationParser... annotationParsers) カスタム AnnotationTransactionAttributeSource を作成します。メソッドのサマリー
修飾子と型メソッド説明protected boolean
デフォルトでは、public メソッドのみをトランザクション対応にすることができます。protected TransactionAttribute
指定されたメソッドまたはクラスのトランザクション属性を決定します。boolean
protected TransactionAttribute
findTransactionAttribute
(ClassSE<?> clazz) サブクラスは、特定のクラスのトランザクション属性があれば、それを返すためにこれを実装する必要があります。protected TransactionAttribute
findTransactionAttribute
(MethodSE method) サブクラスは、指定されたメソッドのトランザクション属性があればそれを返すためにこれを実装する必要があります。int
hashCode()
boolean
isCandidateClass
(ClassSE<?> targetClass) 指定されたクラスが、このTransactionAttributeSource
のメタデータ形式のトランザクション属性の候補であるかどうかを判別します。クラス org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource から継承されたメソッド
computeTransactionAttribute, getCacheKey, getTransactionAttribute, setEmbeddedValueResolver
コンストラクターの詳細
AnnotationTransactionAttributeSource
public AnnotationTransactionAttributeSource()デフォルトの AnnotationTransactionAttributeSource を作成し、Transactional
アノテーションまたは EJB3TransactionAttribute
EE アノテーションを運ぶ public メソッドをサポートします。AnnotationTransactionAttributeSource
public AnnotationTransactionAttributeSource(boolean publicMethodsOnly) Transactional
アノテーションまたは EJB3TransactionAttribute
EE アノテーションを運ぶ 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()