Package io.micronaut.cache
Class AsyncCacheErrorHandler
java.lang.Object
io.micronaut.cache.AsyncCacheErrorHandler
- All Implemented Interfaces:
CacheErrorHandler
@Singleton
@Named("async")
public class AsyncCacheErrorHandler
extends Object
implements CacheErrorHandler
Async error handler that simply logs errors.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
handleInvalidateError
(Cache<?> cache, Object key, RuntimeException e) Handles a cacheCacheInvalidate
error.boolean
handleInvalidateError
(Cache<?> cache, RuntimeException e) Handles a cacheCacheInvalidate
error.boolean
handlePutError
(Cache<?> cache, Object key, Object result, RuntimeException e) Handles a cacheCachePut
error.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.cache.CacheErrorHandler
handleLoadError
-
Constructor Details
-
AsyncCacheErrorHandler
public AsyncCacheErrorHandler()
-
-
Method Details
-
handleInvalidateError
Description copied from interface:CacheErrorHandler
Handles a cacheCacheInvalidate
error. Defaults to simply rethrowing the error. By returningfalse
cache invalidate errors will instead to be swallowed and ignored.- Specified by:
handleInvalidateError
in interfaceCacheErrorHandler
- Parameters:
cache
- The cachekey
- The keye
- The error- Returns:
- Whether the exception should be swallowed or rethrown. A value of true will rethrow he exception.
-
handleInvalidateError
Description copied from interface:CacheErrorHandler
Handles a cacheCacheInvalidate
error. Defaults to simply rethrowing the error. By returningfalse
cache invalidate errors will instead to be swallowed and ignored.- Specified by:
handleInvalidateError
in interfaceCacheErrorHandler
- Parameters:
cache
- The cachee
- The error- Returns:
- Whether the exception should be swallowed or rethrown. A value of true will rethrow he exception.
-
handlePutError
Description copied from interface:CacheErrorHandler
Handles a cacheCachePut
error. Defaults to simply rethrowing the error. By returningfalse
cache write errors will instead to be swallowed and ignored.- Specified by:
handlePutError
in interfaceCacheErrorHandler
- Parameters:
cache
- The cachekey
- The key nameresult
- The resulte
- The error- Returns:
- Whether the exception should be swallowed or rethrown. A value of true will rethrow he exception.
-