Top Description Methods
org.springframework.cache.interceptor

public Interface CacheErrorHandler

Known Direct Implementers
org.springframework.cache.interceptor.LoggingCacheErrorHandler, org.springframework.cache.interceptor.SimpleCacheErrorHandler
Imports
org.springframework.cache.Cache, org.springframework.lang.Nullable

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.

Author
Stephane Nicoll
Since
4.1

Method Summary

Modifier and TypeMethod and Description
public void
handleCacheClearError(RuntimeException
the exception thrown by the cache provider
exception
,
Cache
the cache to clear
cache
)

Handle the given runtime exception thrown by the cache provider when clearing the specified Cache, possibly rethrowing it as a fatal exception.

public void
handleCacheEvictError(RuntimeException
the exception thrown by the cache provider
exception
,
Cache
the cache
cache
,
Object
the key used to clear the item
key
)

Handle the given runtime exception thrown by the cache provider when clearing an item with the specified key, possibly rethrowing it as a fatal exception.

public void
handleCacheGetError(RuntimeException
the exception thrown by the cache provider
exception
,
Cache
the cache
cache
,
Object
the key used to get the item
key
)

Handle the given runtime exception thrown by the cache provider when retrieving an item with the specified key, possibly rethrowing it as a fatal exception.

public void
handleCachePutError(RuntimeException
the exception thrown by the cache provider
exception
,
Cache
the cache
cache
,
Object
the key used to update the item
key
,
Object
the value to associate with the key
value
)

Handle the given runtime exception thrown by the cache provider when updating an item with the specified key and value, possibly rethrowing it as a fatal exception.

Method Detail

handleCacheClearErrorback to summary
public void handleCacheClearError(RuntimeException exception, Cache cache)

Handle the given runtime exception thrown by the cache provider when clearing the specified Cache, possibly rethrowing it as a fatal exception.

Parameters
exception:RuntimeException

the exception thrown by the cache provider

cache:Cache

the cache to clear

handleCacheEvictErrorback to summary
public void handleCacheEvictError(RuntimeException exception, Cache cache, Object key)

Handle the given runtime exception thrown by the cache provider when clearing an item with the specified key, possibly rethrowing it as a fatal exception.

Parameters
exception:RuntimeException

the exception thrown by the cache provider

cache:Cache

the cache

key:Object

the key used to clear the item

handleCacheGetErrorback to summary
public void handleCacheGetError(RuntimeException exception, Cache cache, Object key)

Handle the given runtime exception thrown by the cache provider when retrieving an item with the specified key, possibly rethrowing it as a fatal exception.

Parameters
exception:RuntimeException

the exception thrown by the cache provider

cache:Cache

the cache

key:Object

the key used to get the item

See Also
Cache#get(Object)
handleCachePutErrorback to summary
public void handleCachePutError(RuntimeException exception, Cache cache, Object key, Object value)

Handle the given runtime exception thrown by the cache provider when updating an item with the specified key and value, possibly rethrowing it as a fatal exception.

Parameters
exception:RuntimeException

the exception thrown by the cache provider

cache:Cache

the cache

key:Object

the key used to update the item

value:Object

the value to associate with the key

See Also
Cache#put(Object, Object)