java.lang.ObjectSE
org.springframework.retry.policy.AbstractMapRetryContextCache<SoftReferenceSE<RetryContext>>
org.springframework.retry.policy.SoftReferenceMapRetryContextCache
- 実装済みのインターフェース一覧:
RetryContextCache
public class SoftReferenceMapRetryContextCache
extends AbstractMapRetryContextCache<SoftReferenceSE<RetryContext>>
RetryContextCache のマップベースの実装。コンテキストのキャッシュをバックアップするマップは同期され、そのエントリはソフト参照されるため、負荷がかかるとガベージコレクションされる可能性があります。- 作成者:
- Dave Syer
- 関連事項:
フィールド概要
クラス org.springframework.retry.policy.AbstractMapRetryContextCache から継承されたフィールド
DEFAULT_CAPACITYコンストラクター概要
コンストラクターコンストラクター説明the default capacityでインスタンスを作成しますSoftReferenceMapRetryContextCache(int capacity) 指定された容量でインスタンスを作成し、キャッシュがいっぱいになったら最も古いエントリを削除します。SoftReferenceMapRetryContextCache(int capacity, boolean removeEldestEntries) 指定された容量と、キャッシュが満杯になったときに適用するポリシーを持つインスタンスを作成します。方法の概要
修飾子と型メソッド説明booleancontainsKey(ObjectSE key) protected RetryContextfromValue(SoftReferenceSE<RetryContext> value) キャッシュ値からRetryContextを取得します。voidsetCapacity(int capacity) このキャッシュの容量を更新してください。protected SoftReferenceSE<RetryContext>toValue(RetryContext context) キャッシュに保存する値を計算します。クラス org.springframework.retry.policy.AbstractMapRetryContextCache から継承されたメソッド
get, getMap, put, remove
コンストラクターの詳細
SoftReferenceMapRetryContextCache
public SoftReferenceMapRetryContextCache()the default capacityでインスタンスを作成しますSoftReferenceMapRetryContextCache
public SoftReferenceMapRetryContextCache(int capacity) 指定された容量でインスタンスを作成し、キャッシュがいっぱいになったら最も古いエントリを削除します。- パラメーター:
capacity- キャッシュの初期容量
SoftReferenceMapRetryContextCache
public SoftReferenceMapRetryContextCache(int capacity, boolean removeEldestEntries) 指定された容量と、キャッシュが満杯になったときに適用するポリシーを持つインスタンスを作成します。- パラメーター:
capacity- キャッシュのサイズremoveEldestEntries- キャッシュがいっぱいになったときに、最も古いエントリを削除するかどうか- 導入:
- 1.3.5
方法の詳細
setCapacity
public void setCapacity(int capacity) このキャッシュの容量を更新します。失敗したアイテムが誤って識別され、同一のアイテムへの 2 つの参照が実際には同じキーを持たない場合に、キャッシュが際限なく増大するのを防ぎます。これは、たとえばユーザーが可変フィールドに基づいて equals と hashCode を実装する場合に発生する可能性があります。- オーバーライド:
- クラス
AbstractMapRetryContextCache<SoftReferenceSE<RetryContext>>のsetCapacity - パラメーター:
capacity- 設定する機能
containsKey
- 次で指定:
- インターフェース
RetryContextCache内のcontainsKey - オーバーライド:
- クラス
AbstractMapRetryContextCache<SoftReferenceSE<RetryContext>>のcontainsKey
toValue
クラスからコピーされた説明:AbstractMapRetryContextCacheキャッシュに保存する値を計算します。- 次で指定:
- クラス
AbstractMapRetryContextCache<SoftReferenceSE<RetryContext>>のtoValue - パラメーター:
context- 保存するRetryContext- 戻り値:
- キャッシュ値
fromValue
クラスからコピーされた説明:AbstractMapRetryContextCacheキャッシュ値からRetryContextを取得します。- 次で指定:
- クラス
AbstractMapRetryContextCache<SoftReferenceSE<RetryContext>>のfromValue - パラメーター:
value- キャッシュ値- 戻り値:
- 再試行コンテキスト