モジュール spring.retry

クラス AbstractMapRetryContextCache<V>

java.lang.ObjectSE
org.springframework.retry.policy.AbstractMapRetryContextCache<V>
実装済みのインターフェース一覧:
RetryContextCache
既知の直属サブクラス
MapRetryContextCacheSoftReferenceMapRetryContextCache

public abstract class AbstractMapRetryContextCache<V> extends ObjectSE implements RetryContextCache
エントリをメモリに格納する基本 RetryContextCache 実装。最大容量と LRU(最下位互換)削除ポリシーを設定可能。グローバル状態で使用されるキャッシュの場合、容量を増やそうとすると例外が発生します。ただし、通常のキャッシュには永続的なエントリがあってはならず、最も古いエントリを削除するのが妥当です。
導入:
1.3.5
作成者:
Stephane Nicoll
  • フィールドの詳細

    • DEFAULT_CAPACITY

      public static final int DEFAULT_CAPACITY
      キャッシュの最大容量のデフォルト値。ユーザーが不注意で矛盾したアイテムキーをキャッシュに入力することを避けるために、この値は適度に低い値 (4096) に設定されています。
      関連事項:
  • コンストラクターの詳細

    • AbstractMapRetryContextCache

      protected AbstractMapRetryContextCache(int capacity, boolean removeEldestEntries)
      指定された容量と、キャッシュが満杯になったときに適用するポリシーを持つインスタンスを作成します。
      パラメーター:
      capacity - キャッシュのサイズ
      removeEldestEntries - キャッシュがいっぱいになったときに、最も古いエントリを削除するかどうか
  • 方法の詳細

    • getMap

      protected final MapSE<ObjectSE,V> getMap()
    • setCapacity

      protected void setCapacity(int capacity)
      キャッシュの容量を更新します。
      パラメーター:
      capacity - 新しい容量
    • containsKey

      public boolean containsKey(ObjectSE key)
      次で指定:
      インターフェース RetryContextCache 内の containsKey 
    • get

      public RetryContext get(ObjectSE key)
      次で指定:
      インターフェース RetryContextCache 内の get 
    • put

      public void put(ObjectSE key, RetryContext context)
      次で指定:
      インターフェース RetryContextCache 内の put 
    • remove

      public void remove(ObjectSE key)
      次で指定:
      インターフェース RetryContextCache 内の remove 
    • toValue

      protected abstract V toValue(RetryContext context)
      キャッシュに保存する値を計算します。
      パラメーター:
      context - 保存する RetryContext
      戻り値:
      キャッシュ値
    • fromValue

      protected abstract RetryContext fromValue(V value)
      キャッシュ値から RetryContext を取得します。
      パラメーター:
      value - キャッシュ値
      戻り値:
      再試行コンテキスト