public class MethodMapTransactionAttributeSource extends ObjectSE implements TransactionAttributeSource, BeanClassLoaderAware, InitializingBean
Map
SE のメソッドごとに属性を保存できる単純な TransactionAttributeSource
実装。isMatch(java.lang.String, java.lang.String)
, NameMatchTransactionAttributeSource
コンストラクターと説明 |
---|
MethodMapTransactionAttributeSource() |
修飾子と型 | メソッドと説明 |
---|---|
void | addTransactionalMethod(ClassSE<?> clazz, StringSE mappedName, TransactionAttribute attr) トランザクションメソッドの属性を追加します。 |
void | addTransactionalMethod(MethodSE method, TransactionAttribute attr) トランザクションメソッドの属性を追加します。 |
void | addTransactionalMethod(StringSE name, TransactionAttribute attr) トランザクションメソッドの属性を追加します。 |
void | afterPropertiesSet() 指定された "methodMap" があれば、それを積極的に初期化します。 |
boolean | equals(ObjectSE other) |
TransactionAttribute | getTransactionAttribute(MethodSE method, ClassSE<?> targetClass) 指定されたメソッドのトランザクション属性を返します。メソッドが非トランザクションの場合は null を返します。 |
int | hashCode() |
protected void | initMethodMap(MapSE<StringSE, TransactionAttribute> methodMap) 指定された "methodMap" を初期化します(存在する場合)。 |
protected boolean | isMatch(StringSE methodName, StringSE mappedName) 指定されたメソッド名がマッピング名と一致する場合に戻ります。 |
void | setBeanClassLoader(ClassLoaderSE beanClassLoader) Bean class loader SE を Bean インスタンスに提供するコールバック。 |
void | setMethodMap(MapSE<StringSE, TransactionAttribute> methodMap) "FQCN.method" メソッド名で構成される名前 / 属性マップを設定します(例: |
StringSE | toString() |
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
isCandidateClass
protected final Log logger
public void setMethodMap(MapSE<StringSE,TransactionAttribute> methodMap)
TransactionAttribute
インスタンス(または TransactionAttribute
インスタンスに変換される文字列)で構成される名前 / 属性マップを設定します。 通常、Spring Bean ファクトリ内での setter インジェクションによる構成を対象としています。afterPropertiesSet()
が後で呼び出されることに依存しています。
methodMap
- メソッド名から属性値までの Map
SETransactionAttribute
, TransactionAttributeEditor
public void setBeanClassLoader(ClassLoaderSE beanClassLoader)
BeanClassLoaderAware
class loader
SE を Bean インスタンスに提供するコールバック。 通常の Bean プロパティの設定後、ただし InitializingBean's
InitializingBean.afterPropertiesSet()
メソッドやカスタム init-method などの初期化コールバックの前に呼び出されます。
BeanClassLoaderAware
の setBeanClassLoader
beanClassLoader
- 所有クラスローダー public void afterPropertiesSet()
"methodMap"
があれば、それを積極的に初期化します。InitializingBean
の afterPropertiesSet
initMethodMap(java.util.Map)
protected void initMethodMap(@Nullable MapSE<StringSE,TransactionAttribute> methodMap)
"methodMap"
を初期化します(存在する場合)。methodMap
- メソッド名から TransactionAttribute
インスタンスへのマップ setMethodMap(java.util.Map<java.lang.String, org.springframework.transaction.interceptor.TransactionAttribute>)
public void addTransactionalMethod(StringSE name, TransactionAttribute attr)
メソッド名は、複数のメソッドを一致させるために "*" で終了または開始できます。
name
- ドットで区切られたクラスとメソッド名 attr
- メソッドに関連付けられた属性 IllegalArgumentExceptionSE
- 無効な名前の場合 public void addTransactionalMethod(ClassSE<?> clazz, StringSE mappedName, TransactionAttribute attr)
clazz
- ターゲットインターフェースまたはクラス mappedName
- マッピングされたメソッド名 attr
- メソッドに関連付けられた属性 public void addTransactionalMethod(MethodSE method, TransactionAttribute attr)
method
- メソッド attr
- メソッドに関連付けられた属性 protected boolean isMatch(StringSE methodName, StringSE mappedName)
デフォルトの実装では、"xxx*"、"*xxx"、"*xxx*" の一致、直接の同等性をチェックします。
methodName
- クラスのメソッド名 mappedName
- 記述子内の名前 PatternMatchUtils.simpleMatch(String, String)
@Nullable public TransactionAttribute getTransactionAttribute(MethodSE method, @Nullable ClassSE<?> targetClass)
TransactionAttributeSource
null
を返します。TransactionAttributeSource
の getTransactionAttribute
method
- イントロスペクトする方法 targetClass
- ターゲットクラス (null
の場合があります。この場合、メソッドの宣言クラスを使用する必要があります)null
public int hashCode()
ObjectSE
の hashCodeSE
public StringSE toString()
ObjectSE
の toStringSE