|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- the type of the keys used to access data within the cacheV
- the type of the values held within the cachepublic interface ResilienceStrategy<K,V>
A strategy for providing cache resilience in the face of failure.
An implementation of this interface is used by a cache to decide how to recover after internal components of the cache fail. Implementations of these methods are expected to take suitable recovery steps. They can then choose between allowing the operation to terminate successfully, or throw an exception which will be propagated to the thread calling in to the cache.
Resilience in this context refers only to resilience against cache failures
and not to resilience against failures of any underlying
CacheLoaderWriter
. To this end writer or loader failures will only be
reported to the strategy in the context of a coincident cache failure.
Isolated writer and loader exceptions will be thrown directly.
Method Summary | |
---|---|
void |
clearFailure(CacheAccessException e)
Called when a Cache.clear() fails due to an underlying store
failure. |
boolean |
containsKeyFailure(K key,
CacheAccessException e)
Called when a Cache.containsKey(java.lang.Object) fails due to an
underlying store failure, and the resultant cache load operation also fails. |
java.util.Map<K,V> |
getAllFailure(java.lang.Iterable<? extends K> keys,
CacheAccessException e)
Called when a Cache.getAll(java.util.Set) fails on a cache
without a cache loader due to an underlying store failure. |
java.util.Map<K,V> |
getAllFailure(java.lang.Iterable<? extends K> keys,
CacheAccessException e,
BulkCacheLoadingException f)
Called when a Cache.getAll(java.util.Set) fails on a cache
with a cache loader due to an underlying store failure, and the associated
cache write operation also failed. |
java.util.Map<K,V> |
getAllFailure(java.lang.Iterable<? extends K> keys,
java.util.Map<K,V> loaded,
CacheAccessException e)
Called when a Cache.getAll(java.util.Set) fails on a cache
with a cache loader due to an underlying store failure. |
V |
getFailure(K key,
CacheAccessException e)
Called when a Cache.get(java.lang.Object) fails on a cache without
a cache loader due to an underlying store failure. |
V |
getFailure(K key,
CacheAccessException e,
CacheLoadingException f)
Called when a Cache.get(java.lang.Object) fails on a cache with a
cache loader due to an underlying store failure. |
V |
getFailure(K key,
V loaded,
CacheAccessException e)
Called when a Cache.get(java.lang.Object) fails on a cache with a
cache loader due to an underlying store failure. |
Cache.Entry<K,V> |
iteratorFailure(CacheAccessException e)
Called when a cache iterator advancement fails due to an underlying store failure. |
void |
putAllFailure(java.util.Map<? extends K,? extends V> entries,
CacheAccessException e)
Called when a Cache.putAll(java.util.Map) fails due to an
underlying store failure. |
void |
putAllFailure(java.util.Map<? extends K,? extends V> entries,
CacheAccessException e,
BulkCacheWritingException f)
Called when a Cache.putAll(java.util.Map) fails due to an
underlying store failure, and the associated cache write operation also
failed. |
void |
putFailure(K key,
V value,
CacheAccessException e)
Called when a Cache.put(java.lang.Object, java.lang.Object) fails
due to an underlying store failure. |
void |
putFailure(K key,
V value,
CacheAccessException e,
CacheWritingException f)
Called when a Cache.put(java.lang.Object, java.lang.Object) fails
due to an underlying store failure, and the associated cache write
operation also failed. |
V |
putIfAbsentFailure(K key,
V value,
CacheAccessException e,
boolean knownToBeAbsent)
Called when a Cache.putIfAbsent(java.lang.Object, java.lang.Object)
fails due to an underlying store failure. |
V |
putIfAbsentFailure(K key,
V value,
CacheAccessException e,
CacheLoadingException f)
Called when a Cache.putIfAbsent(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache load
operation also failed. |
V |
putIfAbsentFailure(K key,
V value,
CacheAccessException e,
CacheWritingException f)
Called when a Cache.putIfAbsent(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache write
operation also failed. |
java.util.Map<K,V> |
removeAllFailure(java.lang.Iterable<? extends K> keys,
CacheAccessException e)
Called when a Cache.removeAll(java.util.Set) fails due to an
underlying store failure. |
java.util.Map<K,V> |
removeAllFailure(java.lang.Iterable<? extends K> keys,
CacheAccessException e,
BulkCacheWritingException f)
Called when a Cache.removeAll(java.util.Set) fails
due to an underlying store failure, and the associated cache write
operation also failed. |
void |
removeFailure(K key,
CacheAccessException e)
Called when a Cache.remove(java.lang.Object) fails due to an
underlying store failure. |
void |
removeFailure(K key,
CacheAccessException e,
CacheWritingException f)
Called when a Cache.remove(java.lang.Object) fails
due to an underlying store failure, and the associated cache write
operation also failed. |
boolean |
removeFailure(K key,
V value,
CacheAccessException e,
boolean knownToBePresent)
Called when a Cache.remove(java.lang.Object, java.lang.Object)
fails due to an underlying store failure. |
boolean |
removeFailure(K key,
V value,
CacheAccessException e,
CacheLoadingException f)
Called when a Cache.remove(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache load
operation also failed. |
boolean |
removeFailure(K key,
V value,
CacheAccessException e,
CacheWritingException f)
Called when a Cache.remove(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache write
operation also failed. |
V |
replaceFailure(K key,
V value,
CacheAccessException e)
Called when a Cache.replace(java.lang.Object, java.lang.Object)
fails due to an underlying store failure. |
V |
replaceFailure(K key,
V value,
CacheAccessException e,
CacheLoadingException f)
Called when a Cache.replace(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache load
operation also failed. |
V |
replaceFailure(K key,
V value,
CacheAccessException e,
CacheWritingException f)
Called when a Cache.replace(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache write
operation also failed. |
boolean |
replaceFailure(K key,
V value,
V newValue,
CacheAccessException e,
boolean knownToMatch)
Called when a Cache.replace(java.lang.Object, java.lang.Object, java.lang.Object)
fails due to an underlying store failure. |
boolean |
replaceFailure(K key,
V value,
V newValue,
CacheAccessException e,
CacheLoadingException f)
Called when a Cache.replace(java.lang.Object, java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache load
operation also failed. |
boolean |
replaceFailure(K key,
V value,
V newValue,
CacheAccessException e,
CacheWritingException f)
Called when a Cache.replace(java.lang.Object, java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache write
operation also failed. |
Method Detail |
---|
V getFailure(K key, CacheAccessException e)
Cache.get(java.lang.Object)
fails on a cache without
a cache loader due to an underlying store failure.
key
- the key being retrievede
- the triggered failure
V getFailure(K key, V loaded, CacheAccessException e)
Cache.get(java.lang.Object)
fails on a cache with a
cache loader due to an underlying store failure.
key
- the key being retrievedloaded
- the value from the loadere
- the triggered failure
V getFailure(K key, CacheAccessException e, CacheLoadingException f)
Cache.get(java.lang.Object)
fails on a cache with a
cache loader due to an underlying store failure.
key
- the key being retrievede
- the cache failuref
- the loader failure
boolean containsKeyFailure(K key, CacheAccessException e)
Cache.containsKey(java.lang.Object)
fails due to an
underlying store failure, and the resultant cache load operation also fails.
key
- the key being queriede
- the triggered failure
void putFailure(K key, V value, CacheAccessException e)
Cache.put(java.lang.Object, java.lang.Object)
fails
due to an underlying store failure.
key
- the key being putvalue
- the value being pute
- the triggered failurevoid putFailure(K key, V value, CacheAccessException e, CacheWritingException f)
Cache.put(java.lang.Object, java.lang.Object)
fails
due to an underlying store failure, and the associated cache write
operation also failed.
key
- the key being putvalue
- the value being pute
- the cache failuref
- the writer failurevoid removeFailure(K key, CacheAccessException e)
Cache.remove(java.lang.Object)
fails due to an
underlying store failure.
key
- the key being removede
- the triggered failurevoid removeFailure(K key, CacheAccessException e, CacheWritingException f)
Cache.remove(java.lang.Object)
fails
due to an underlying store failure, and the associated cache write
operation also failed.
key
- the key being removede
- the cache failuref
- the writer failurevoid clearFailure(CacheAccessException e)
Cache.clear()
fails due to an underlying store
failure.
e
- the triggered failureCache.Entry<K,V> iteratorFailure(CacheAccessException e)
e
- the triggered failure
V putIfAbsentFailure(K key, V value, CacheAccessException e, boolean knownToBeAbsent)
Cache.putIfAbsent(java.lang.Object, java.lang.Object)
fails due to an underlying store failure.
If it is known at the time of calling that the key is absent from the cache
(and the writer if one is present) then knownToBeAbsent
will be
true
.
key
- the key being putvalue
- the value being pute
- the triggered failureknownToBeAbsent
- true
if the value is known to be absent
V putIfAbsentFailure(K key, V value, CacheAccessException e, CacheWritingException f)
Cache.putIfAbsent(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache write
operation also failed.
key
- the key being putvalue
- the value being pute
- the cache failuref
- the writer failure
V putIfAbsentFailure(K key, V value, CacheAccessException e, CacheLoadingException f)
Cache.putIfAbsent(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache load
operation also failed.
key
- the key being putvalue
- the value being pute
- the cache failuref
- the loader failure
boolean removeFailure(K key, V value, CacheAccessException e, boolean knownToBePresent)
Cache.remove(java.lang.Object, java.lang.Object)
fails due to an underlying store failure.
If it is known at the time of calling that the targeted mapping is present
in the cache (or the writer if one is present) then knownToBePresent
will be true
.
key
- the key being removedvalue
- the value being removede
- the triggered failureknownToBePresent
- true
if the value is known to be present
boolean removeFailure(K key, V value, CacheAccessException e, CacheWritingException f)
Cache.remove(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache write
operation also failed.
key
- the key being removedvalue
- the value being removede
- the cache failuref
- the writer failure
boolean removeFailure(K key, V value, CacheAccessException e, CacheLoadingException f)
Cache.remove(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache load
operation also failed.
key
- the key being removedvalue
- the value being removede
- the cache failuref
- the loader failure
V replaceFailure(K key, V value, CacheAccessException e)
Cache.replace(java.lang.Object, java.lang.Object)
fails due to an underlying store failure.
key
- the key being replacedvalue
- the value being replacede
- the triggered failure
V replaceFailure(K key, V value, CacheAccessException e, CacheWritingException f)
Cache.replace(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache write
operation also failed.
key
- the key being replacedvalue
- the value being replacede
- the cache failuref
- the writer failure
V replaceFailure(K key, V value, CacheAccessException e, CacheLoadingException f)
Cache.replace(java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache load
operation also failed.
key
- the key being replacedvalue
- the value being replacede
- the cache failuref
- the loader failure
boolean replaceFailure(K key, V value, V newValue, CacheAccessException e, boolean knownToMatch)
Cache.replace(java.lang.Object, java.lang.Object, java.lang.Object)
fails due to an underlying store failure.
If it is known at the time of calling that the target mapping is present
in the cache (or the writer if one is present) then knownToBeMatch
will be true
.
key
- the key being replacedvalue
- the expected valuenewValue
- the replacement valuee
- the triggered failureknownToMatch
- true
if the value is known to match
boolean replaceFailure(K key, V value, V newValue, CacheAccessException e, CacheWritingException f)
Cache.replace(java.lang.Object, java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache write
operation also failed.
key
- the key being replacedvalue
- the expected valuenewValue
- the replacement valuee
- the cache failuref
- the writer failure
boolean replaceFailure(K key, V value, V newValue, CacheAccessException e, CacheLoadingException f)
Cache.replace(java.lang.Object, java.lang.Object, java.lang.Object)
fails due to an underlying store failure, and the associated cache load
operation also failed.
key
- the key being replacedvalue
- the expected valuenewValue
- the replacement valuee
- the cache failuref
- the loader failure
java.util.Map<K,V> getAllFailure(java.lang.Iterable<? extends K> keys, CacheAccessException e)
Cache.getAll(java.util.Set)
fails on a cache
without a cache loader due to an underlying store failure.
keys
- the keys being retrievede
- the triggered failure
java.util.Map<K,V> getAllFailure(java.lang.Iterable<? extends K> keys, java.util.Map<K,V> loaded, CacheAccessException e)
Cache.getAll(java.util.Set)
fails on a cache
with a cache loader due to an underlying store failure.
keys
- the keys being retrievedloaded
- the values from the loadere
- the triggered failure
java.util.Map<K,V> getAllFailure(java.lang.Iterable<? extends K> keys, CacheAccessException e, BulkCacheLoadingException f)
Cache.getAll(java.util.Set)
fails on a cache
with a cache loader due to an underlying store failure, and the associated
cache write operation also failed.
keys
- the keys being retrievede
- the cache failuref
- the writer failure
void putAllFailure(java.util.Map<? extends K,? extends V> entries, CacheAccessException e)
Cache.putAll(java.util.Map)
fails due to an
underlying store failure.
entries
- the entries being pute
- the triggered failurevoid putAllFailure(java.util.Map<? extends K,? extends V> entries, CacheAccessException e, BulkCacheWritingException f)
Cache.putAll(java.util.Map)
fails due to an
underlying store failure, and the associated cache write operation also
failed.
entries
- the entries being pute
- the cache failuref
- the writer failurejava.util.Map<K,V> removeAllFailure(java.lang.Iterable<? extends K> keys, CacheAccessException e)
Cache.removeAll(java.util.Set)
fails due to an
underlying store failure.
keys
- the keys being removede
- the triggered failure
java.util.Map<K,V> removeAllFailure(java.lang.Iterable<? extends K> keys, CacheAccessException e, BulkCacheWritingException f)
Cache.removeAll(java.util.Set)
fails
due to an underlying store failure, and the associated cache write
operation also failed.
keys
- the keys being removede
- the cache failuref
- the writer failure
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |