public class MapRetryContextCache extends java.lang.Object implements RetryContextCache
RetryContextCache. The map backing the
cache of contexts is synchronized.| Modifier and Type | Field and Description |
|---|---|
private int |
capacity |
static int |
DEFAULT_CAPACITY
Default value for maximum capacity of the cache.
|
private java.util.Map<java.lang.Object,RetryContext> |
map |
| Constructor and Description |
|---|
MapRetryContextCache()
Create a
MapRetryContextCache with default capacity. |
MapRetryContextCache(int defaultCapacity) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(java.lang.Object key) |
RetryContext |
get(java.lang.Object key) |
void |
put(java.lang.Object key,
RetryContext context) |
void |
remove(java.lang.Object key) |
void |
setCapacity(int capacity)
Public setter for the capacity.
|
public static final int DEFAULT_CAPACITY
private java.util.Map<java.lang.Object,RetryContext> map
private int capacity
public MapRetryContextCache()
MapRetryContextCache with default capacity.public MapRetryContextCache(int defaultCapacity)
defaultCapacity - public void setCapacity(int capacity)
capacity - the capacity to setpublic boolean containsKey(java.lang.Object key)
containsKey in interface RetryContextCachepublic RetryContext get(java.lang.Object key)
get in interface RetryContextCachepublic void put(java.lang.Object key,
RetryContext context)
put in interface RetryContextCachepublic void remove(java.lang.Object key)
remove in interface RetryContextCache