public class SoftReferenceMapRetryContextCache extends Object implements RetryContextCache
RetryContextCache
. The map backing the
cache of contexts is synchronized and its entries are soft-referenced, so may
be garbage collected under pressure.for non-soft referenced version
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CAPACITY
Default value for maximum capacity of the cache.
|
Constructor and Description |
---|
SoftReferenceMapRetryContextCache()
Create a
SoftReferenceMapRetryContextCache with default capacity. |
SoftReferenceMapRetryContextCache(int defaultCapacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(Object key) |
RetryContext |
get(Object key) |
void |
put(Object key,
RetryContext context) |
void |
remove(Object key) |
void |
setCapacity(int capacity)
Public setter for the capacity.
|
public static final int DEFAULT_CAPACITY
public SoftReferenceMapRetryContextCache()
SoftReferenceMapRetryContextCache
with default capacity.public SoftReferenceMapRetryContextCache(int defaultCapacity)
defaultCapacity
- the default capacitypublic void setCapacity(int capacity)
capacity
- the capacity to setpublic boolean containsKey(Object key)
containsKey
in interface RetryContextCache
public RetryContext get(Object key)
get
in interface RetryContextCache
public void put(Object key, RetryContext context)
put
in interface RetryContextCache
public void remove(Object key)
remove
in interface RetryContextCache
Copyright © 2018 SpringSource. All rights reserved.