public interface CacheErrorHandler
An interface for handling cache errors.
Modifier and Type | Method and Description |
---|---|
default boolean |
handleInvalidateError(Cache<?> cache,
java.lang.Object key,
java.lang.RuntimeException e)
Handles a cache
CacheInvalidate error. |
default boolean |
handleInvalidateError(Cache<?> cache,
java.lang.RuntimeException e)
Handles a cache
CacheInvalidate error. |
default boolean |
handleLoadError(Cache<?> cache,
java.lang.Object key,
java.lang.RuntimeException e)
Handles an error loading a value from the cache via
Cacheable . |
default boolean |
handlePutError(Cache<?> cache,
java.lang.Object key,
java.lang.Object result,
java.lang.RuntimeException e)
Handles a cache
CachePut error. |
default boolean handleInvalidateError(Cache<?> cache, java.lang.Object key, java.lang.RuntimeException e)
CacheInvalidate
error. Defaults to simply rethrowing the error.
By returning false cache invalidate errors will instead to be swallowed and ignored.cache
- The cachekey
- The keye
- The errordefault boolean handleInvalidateError(Cache<?> cache, java.lang.RuntimeException e)
CacheInvalidate
error. Defaults to simply rethrowing the error.
By returning false cache invalidate errors will instead to be swallowed and ignored.cache
- The cachee
- The errordefault boolean handlePutError(Cache<?> cache, java.lang.Object key, java.lang.Object result, java.lang.RuntimeException e)
CachePut
error. Defaults to simply rethrowing the error.
By returning false cache write errors will instead to be swallowed and ignored.cache
- The cachekey
- The key nameresult
- The resulte
- The errordefault boolean handleLoadError(Cache<?> cache, java.lang.Object key, java.lang.RuntimeException e)
Cacheable
. Note that
by returning false the behaviour can be customized such that cache related exceptions are ignored and
the original method invoked.cache
- The cachekey
- The keye
- The error