接口 CacheErrorHandler
public interface CacheErrorHandler
A strategy for handling cache-related errors. In most cases, any
exception thrown by the provider should simply be thrown back at
the client but, in some circumstances, the infrastructure may need
to handle cache-provider exceptions in a different way.
Typically, failing to retrieve an object from the cache with a given id can be transparently managed as a cache miss by not throwing back such exception.
- 从以下版本开始:
- 4.0
- 作者:
- Stephane Nicoll
-
方法概要
修饰符和类型方法说明voidhandleCacheClearError(RuntimeException exception, Cache cache) Handle the given runtime exception thrown by the cache provider when clearing the specifiedCache, possibly rethrowing it as a fatal exception.voidhandleCacheEvictError(RuntimeException exception, Cache cache, Object key) Handle the given runtime exception thrown by the cache provider when clearing an item with the specifiedkey, possibly rethrowing it as a fatal exception.voidhandleCacheGetError(RuntimeException exception, Cache cache, Object key) Handle the given runtime exception thrown by the cache provider when retrieving an item with the specifiedkey, possibly rethrowing it as a fatal exception.voidhandleCachePutError(RuntimeException exception, Cache cache, Object key, Object value) Handle the given runtime exception thrown by the cache provider when updating an item with the specifiedkeyandvalue, possibly rethrowing it as a fatal exception.
-
方法详细资料
-
handleCacheGetError
Handle the given runtime exception thrown by the cache provider when retrieving an item with the specifiedkey, possibly rethrowing it as a fatal exception.- 参数:
exception- the exception thrown by the cache providercache- the cachekey- the key used to get the item- 另请参阅:
-
handleCachePutError
void handleCachePutError(RuntimeException exception, Cache cache, Object key, @Nullable Object value) Handle the given runtime exception thrown by the cache provider when updating an item with the specifiedkeyandvalue, possibly rethrowing it as a fatal exception.- 参数:
exception- the exception thrown by the cache providercache- the cachekey- the key used to update the itemvalue- the value to associate with the key- 另请参阅:
-
handleCacheEvictError
Handle the given runtime exception thrown by the cache provider when clearing an item with the specifiedkey, possibly rethrowing it as a fatal exception.- 参数:
exception- the exception thrown by the cache providercache- the cachekey- the key used to clear the item
-
handleCacheClearError
Handle the given runtime exception thrown by the cache provider when clearing the specifiedCache, possibly rethrowing it as a fatal exception.- 参数:
exception- the exception thrown by the cache providercache- the cache to clear
-