クラス NameMatchTransactionAttributeSource

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

public class NameMatchTransactionAttributeSource extends ObjectSE implements TransactionAttributeSource, EmbeddedValueResolverAware, InitializingBean, SerializableSE
登録された名前で属性を照合できる単純な TransactionAttributeSource 実装。
導入:
21.08.2003
作成者:
Juergen Hoeller
関連事項:
  • フィールドの詳細

    • logger

      protected static final Log logger
      サブクラスで利用可能なロガー。

      最適な直列化のための静的。

  • コンストラクターの詳細

    • NameMatchTransactionAttributeSource

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

    • setNameMap

      public void setNameMap(MapSE<StringSE,TransactionAttribute> nameMap)
      メソッド名( "myMethod" など)と TransactionAttribute インスタンスで構成される名前 / 属性マップを設定します。
      関連事項:
    • setProperties

      public void setProperties(PropertiesSE transactionAttributes)
      指定されたプロパティを名前 / 属性マップに解析します。

      メソッド名をキーとして、文字列属性の定義を値として想定し、TransactionAttributeEditor を介して TransactionAttribute インスタンスに解析可能です。

      関連事項:
    • addTransactionalMethod

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

      メソッド名は完全一致にすることも、複数のメソッドに一致させる場合はパターン "xxx*"、"*xxx"、"*xxx*" にすることもできます。

      パラメーター:
      methodName - メソッドの名前
      attr - メソッドに関連付けられた属性
    • setEmbeddedValueResolver

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

      public void afterPropertiesSet()
      インターフェースからコピーされた説明: InitializingBean
      すべての Bean プロパティを設定し、BeanFactoryAwareApplicationContextAware などを満たした後、包含 BeanFactory によって呼び出されます。

      このメソッドにより、Bean インスタンスは、すべての Bean プロパティが設定されたときに、その全体的な構成の検証と最終的な初期化を実行できます。

      次で指定:
      インターフェース InitializingBeanafterPropertiesSet 
    • getTransactionAttribute

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

      protected boolean isMatch(StringSE methodName, StringSE mappedName)
      指定されたメソッド名がマップされた名前と一致するかどうかを判別します。

      デフォルトの実装では、"xxx*"、"*xxx"、"*xxx*" の一致、直接の同等性がチェックされます。サブクラスでオーバーライドできます。

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

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

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

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