クラス MethodMapTransactionAttributeSource

java.lang.ObjectSE
org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
実装されたすべてのインターフェース:
AwareBeanClassLoaderAwareInitializingBeanEmbeddedValueResolverAwareTransactionAttributeSource

public class MethodMapTransactionAttributeSource extends ObjectSE implements TransactionAttributeSource, EmbeddedValueResolverAware, BeanClassLoaderAware, InitializingBean
MapSE のメソッドごとに属性を保存できる単純な TransactionAttributeSource 実装。
導入:
24.04.2003
作成者:
Rod Johnson, Juergen Hoeller
関連事項:
  • フィールドの詳細

    • logger

      protected final Log logger
      サブクラスで利用可能なロガー。
  • コンストラクターの詳細

    • MethodMapTransactionAttributeSource

      public MethodMapTransactionAttributeSource()
  • メソッドの詳細

    • setMethodMap

      public void setMethodMap(MapSE<StringSE,TransactionAttribute> methodMap)
      "FQCN.method" メソッド名("com.mycompany.mycode.MyClass.myMethod" など)と TransactionAttribute インスタンス(または TransactionAttribute インスタンスに変換される文字列)で構成される名前 / 属性マップを設定します。

      通常、Spring Bean ファクトリ内での setter インジェクションによる構成を対象としています。afterPropertiesSet() が後で呼び出されることに依存しています。

      パラメーター:
      methodMap - メソッド名から属性値までの MapSE
      関連事項:
    • setEmbeddedValueResolver

      public void setEmbeddedValueResolver(StringValueResolver resolver)
      インターフェースからコピーされた説明: EmbeddedValueResolverAware
      StringValueResolver を設定して、埋め込まれた定義値の解決に使用します。
      次で指定:
      インターフェース EmbeddedValueResolverAwaresetEmbeddedValueResolver 
    • setBeanClassLoader

      public void setBeanClassLoader(ClassLoaderSE beanClassLoader)
      インターフェースからコピーされた説明: BeanClassLoaderAware
      Bean class loaderSE を Bean インスタンスに提供するコールバック。

      通常の Bean プロパティの設定、ただし InitializingBean's InitializingBean.afterPropertiesSet() メソッドやカスタム init-method などの初期化コールバックの前に呼び出さます。

      次で指定:
      インターフェース BeanClassLoaderAwaresetBeanClassLoader 
      パラメーター:
      beanClassLoader - 所有クラスローダー
    • afterPropertiesSet

      public void afterPropertiesSet()
      指定された "methodMap" があれば、それを積極的に初期化します。
      次で指定:
      インターフェース InitializingBeanafterPropertiesSet 
      関連事項:
    • initMethodMap

      protected void initMethodMap(@Nullable MapSE<StringSE,TransactionAttribute> methodMap)
      指定された "methodMap" を初期化します(存在する場合)。
      パラメーター:
      methodMap - メソッド名から TransactionAttribute インスタンスへのマップ
      関連事項:
    • addTransactionalMethod

      public void addTransactionalMethod(StringSE name, TransactionAttribute attr)
      トランザクションメソッドの属性を追加します。

      メソッド名は、複数のメソッドを一致させるために "*" で終了または開始できます。

      パラメーター:
      name - ドットで区切られたクラスとメソッド名
      attr - メソッドに関連付けられた属性
      例外:
      IllegalArgumentExceptionSE - 無効な名前の場合
    • addTransactionalMethod

      public void addTransactionalMethod(ClassSE<?> clazz, StringSE mappedName, TransactionAttribute attr)
      トランザクションメソッドの属性を追加します。メソッド名は、複数のメソッドを一致させるために "*" で終了または開始できます。
      パラメーター:
      clazz - ターゲットインターフェースまたはクラス
      mappedName - マッピングされたメソッド名
      attr - メソッドに関連付けられた属性
    • addTransactionalMethod

      public void addTransactionalMethod(MethodSE method, TransactionAttribute attr)
      トランザクションメソッドの属性を追加します。
      パラメーター:
      method - メソッド
      attr - メソッドに関連付けられた属性
    • isMatch

      protected boolean isMatch(StringSE methodName, StringSE mappedName)
      指定されたメソッド名がマッピング名と一致する場合に戻ります。

      デフォルトの実装では、"xxx*"、"*xxx"、"*xxx*" の一致、直接の同等性をチェックします。

      パラメーター:
      methodName - クラスのメソッド名
      mappedName - 記述子内の名前
      戻り値:
      名前が一致する場合
      関連事項:
    • getTransactionAttribute

      @Nullable public TransactionAttribute getTransactionAttribute(MethodSE method, @Nullable ClassSE<?> targetClass)
      インターフェースからコピーされた説明: TransactionAttributeSource
      指定されたメソッドのトランザクション属性を返します。メソッドが非トランザクションの場合は null を返します。
      次で指定:
      インターフェース TransactionAttributeSourcegetTransactionAttribute 
      パラメーター:
      method - 内省する方法
      targetClass - ターゲットクラス (null にすることもできます。この場合、メソッドの宣言クラスを使用する必要があります。)
      戻り値:
      一致するトランザクション属性。見つからない場合は null 
    • equals

      public boolean equals(@Nullable ObjectSE other)
      オーバーライド:
      クラス ObjectSEequalsSE 
    • hashCode

      public int hashCode()
      オーバーライド:
      クラス ObjectSEhashCode 
    • toString

      public StringSE toString()
      オーバーライド:
      クラス ObjectSEtoString