クラス MethodMapTransactionAttributeSource
java.lang.ObjectSE
org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
- 実装されているすべてのインターフェース:
Aware、BeanClassLoaderAware、InitializingBean、EmbeddedValueResolverAware、TransactionAttributeSource
public class MethodMapTransactionAttributeSource
extends ObjectSE
implements TransactionAttributeSource, EmbeddedValueResolverAware, BeanClassLoaderAware, InitializingBean
MapSE のメソッドごとに属性を保存できる単純な TransactionAttributeSource 実装。- 導入:
- 24.04.2003
- 作成者:
- Rod Johnson, Juergen Hoeller
- 関連事項:
フィールドのサマリー
フィールドコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明voidaddTransactionalMethod(ClassSE<?> clazz, StringSE mappedName, TransactionAttribute attr) トランザクションメソッドの属性を追加します。voidaddTransactionalMethod(MethodSE method, TransactionAttribute attr) トランザクションメソッドの属性を追加します。voidaddTransactionalMethod(StringSE name, TransactionAttribute attr) トランザクションメソッドの属性を追加します。void指定された"methodMap"があれば、それを積極的に初期化します。booleangetTransactionAttribute(MethodSE method, ClassSE<?> targetClass) 指定されたメソッドのトランザクション属性を返します。メソッドが非トランザクションの場合はnullを返します。inthashCode()protected voidinitMethodMap(MapSE<StringSE, TransactionAttribute> methodMap) 指定された"methodMap"を初期化します(存在する場合)。protected boolean指定されたメソッド名がマッピング名と一致する場合に戻ります。voidsetBeanClassLoader(ClassLoaderSE beanClassLoader) Beanclass loaderSE を Bean インスタンスに提供するコールバック。voidsetEmbeddedValueResolver(StringValueResolver resolver) StringValueResolver を設定して、埋め込まれた定義値の解決に使用します。voidsetMethodMap(MapSE<StringSE, TransactionAttribute> methodMap) "FQCN.method" メソッド名で構成される名前 / 属性マップを設定します(例:toString()クラス java.lang.ObjectSE から継承されたメソッド
clone, finalize, getClass, notify, notifyAll, wait, waitSE, waitSEインターフェース org.springframework.transaction.interceptor.TransactionAttributeSource から継承されたメソッド
isCandidateClass
フィールドの詳細
logger
サブクラスで利用可能なロガー。
コンストラクターの詳細
MethodMapTransactionAttributeSource
public MethodMapTransactionAttributeSource()
メソッドの詳細
setMethodMap
"FQCN.method" メソッド名("com.mycompany.mycode.MyClass.myMethod" など)とTransactionAttributeインスタンス(またはTransactionAttributeインスタンスに変換される文字列)で構成される名前 / 属性マップを設定します。通常、Spring Bean ファクトリ内での setter インジェクションによる構成を対象としています。
afterPropertiesSet()が後で呼び出されることに依存しています。- パラメーター:
methodMap- メソッド名から属性値までのMapSE- 関連事項:
setEmbeddedValueResolver
インターフェースからコピーされた説明:EmbeddedValueResolverAwareStringValueResolver を設定して、埋め込まれた定義値の解決に使用します。- 次で指定:
- インターフェース
EmbeddedValueResolverAwareのsetEmbeddedValueResolver
setBeanClassLoader
インターフェースからコピーされた説明:BeanClassLoaderAwareBeanclass loaderSE を Bean インスタンスに提供するコールバック。通常の Bean プロパティの設定後、ただし
InitializingBean'sInitializingBean.afterPropertiesSet()メソッドやカスタム init-method などの初期化コールバックの前に呼び出されます。- 次で指定:
- インターフェース
BeanClassLoaderAwareのsetBeanClassLoader - パラメーター:
beanClassLoader- 所有クラスローダー
afterPropertiesSet
public void afterPropertiesSet()指定された"methodMap"があれば、それを積極的に初期化します。- 次で指定:
- インターフェース
InitializingBeanのafterPropertiesSet - 関連事項:
initMethodMap
指定された"methodMap"を初期化します(存在する場合)。- パラメーター:
methodMap- メソッド名からTransactionAttributeインスタンスへのマップ- 関連事項:
addTransactionalMethod
トランザクションメソッドの属性を追加します。メソッド名は、複数のメソッドを一致させるために "*" で終了または開始できます。
- パラメーター:
name- ドットで区切られたクラスとメソッド名attr- メソッドに関連付けられた属性- 例外:
IllegalArgumentExceptionSE- 無効な名前の場合
addTransactionalMethod
public void addTransactionalMethod(ClassSE<?> clazz, StringSE mappedName, TransactionAttribute attr) トランザクションメソッドの属性を追加します。メソッド名は、複数のメソッドを一致させるために "*" で終了または開始できます。- パラメーター:
clazz- ターゲットインターフェースまたはクラスmappedName- マッピングされたメソッド名attr- メソッドに関連付けられた属性
addTransactionalMethod
トランザクションメソッドの属性を追加します。- パラメーター:
method- メソッドattr- メソッドに関連付けられた属性
isMatch
指定されたメソッド名がマッピング名と一致する場合に戻ります。デフォルトの実装では、"xxx*"、"*xxx"、"*xxx*" の一致、直接の同等性をチェックします。
- パラメーター:
methodName- クラスのメソッド名mappedName- 記述子内の名前- 戻り値:
- 名前が一致する場合
- 関連事項:
getTransactionAttribute
@Nullable public TransactionAttribute getTransactionAttribute(MethodSE method, @Nullable ClassSE<?> targetClass) インターフェースからコピーされた説明:TransactionAttributeSource指定されたメソッドのトランザクション属性を返します。メソッドが非トランザクションの場合はnullを返します。- 次で指定:
- インターフェース
TransactionAttributeSourceのgetTransactionAttribute - パラメーター:
method- イントロスペクトする方法targetClass- ターゲットクラス (nullにすることもできます。この場合、メソッドの宣言クラスを使用する必要があります。)- 戻り値:
- 一致するトランザクション属性。見つからない場合は
null
equals
hashCode
public int hashCode()toString