クラス NameMatchTransactionAttributeSource
java.lang.ObjectSE
org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
- 実装されているすべてのインターフェース:
SerializableSE、Aware、InitializingBean、EmbeddedValueResolverAware、TransactionAttributeSource
public class NameMatchTransactionAttributeSource
extends ObjectSE
implements TransactionAttributeSource, EmbeddedValueResolverAware, InitializingBean, SerializableSE
登録された名前で属性を照合できる単純な
TransactionAttributeSource 実装。- 導入:
- 21.08.2003
- 作成者:
- Juergen Hoeller
- 関連事項:
フィールドのサマリー
フィールドコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明voidaddTransactionalMethod(StringSE methodName, TransactionAttribute attr) トランザクションメソッドの属性を追加します。voidbooleangetTransactionAttribute(MethodSE method, ClassSE<?> targetClass) 指定されたメソッドのトランザクション属性を返します。メソッドが非トランザクションの場合はnullを返します。inthashCode()protected boolean指定されたメソッド名がマップされた名前と一致するかどうかを判別します。voidsetEmbeddedValueResolver(StringValueResolver resolver) StringValueResolver を設定して、埋め込まれた定義値の解決に使用します。voidsetNameMap(MapSE<StringSE, TransactionAttribute> nameMap) メソッド名 (たとえば、"myMethod" ) とTransactionAttributeインスタンスで構成される名前 / 属性マップを設定します。voidsetProperties(PropertiesSE transactionAttributes) 指定されたプロパティを名前 / 属性マップに解析します。toString()クラス java.lang.ObjectSE から継承されたメソッド
clone, finalize, getClass, notify, notifyAll, wait, waitSE, waitSEインターフェース org.springframework.transaction.interceptor.TransactionAttributeSource から継承されたメソッド
hasTransactionAttribute, isCandidateClass
フィールドの詳細
logger
サブクラスで利用可能なロガー。最適な直列化のための静的。
コンストラクターの詳細
NameMatchTransactionAttributeSource
public NameMatchTransactionAttributeSource()
メソッドの詳細
setNameMap
メソッド名 (たとえば、"myMethod" ) とTransactionAttributeインスタンスで構成される名前 / 属性マップを設定します。setProperties
指定されたプロパティを名前 / 属性マップに解析します。メソッド名をキーとして、文字列属性の定義を値として想定し、
TransactionAttributeEditorを介してTransactionAttributeインスタンスに解析可能です。addTransactionalMethod
トランザクションメソッドの属性を追加します。メソッド名は完全一致にすることも、複数のメソッドに一致させる場合はパターン "xxx*"、"*xxx"、"*xxx*" にすることもできます。
- パラメーター:
methodName- メソッドの名前attr- メソッドに関連付けられた属性
setEmbeddedValueResolver
インターフェースからコピーされた説明:EmbeddedValueResolverAwareStringValueResolver を設定して、埋め込まれた定義値の解決に使用します。- 次で指定:
- インターフェース
EmbeddedValueResolverAwareのsetEmbeddedValueResolver
afterPropertiesSet
public void afterPropertiesSet()インターフェースからコピーされた説明:InitializingBeanすべての Bean プロパティを設定し、BeanFactoryAware、ApplicationContextAwareなどを満たした後、包含BeanFactoryによって呼び出されます。このメソッドにより、Bean インスタンスは、すべての Bean プロパティが設定されたときに、その全体的な構成の検証と最終的な初期化を実行できます。
- 次で指定:
- インターフェース
InitializingBeanのafterPropertiesSet
getTransactionAttribute
@Nullable public TransactionAttribute getTransactionAttribute(MethodSE method, @Nullable ClassSE<?> targetClass) インターフェースからコピーされた説明:TransactionAttributeSource指定されたメソッドのトランザクション属性を返します。メソッドが非トランザクションの場合はnullを返します。- 次で指定:
- インターフェース
TransactionAttributeSourceのgetTransactionAttribute - パラメーター:
method- イントロスペクトする方法targetClass- ターゲットクラス (nullにすることもできます。この場合、メソッドの宣言クラスを使用する必要があります。)- 戻り値:
- 一致するトランザクション属性。見つからない場合は
null
isMatch
指定されたメソッド名がマップされた名前と一致するかどうかを判別します。デフォルトの実装では、"xxx*"、"*xxx"、"*xxx*" の一致、直接の同等性がチェックされます。サブクラスでオーバーライドできます。
- パラメーター:
methodName- クラスのメソッド名mappedName- 記述子内の名前- 戻り値:
- 名前が一致する場合は
true - 関連事項:
equals
hashCode
public int hashCode()toString