Package io.micronaut.cache
Class AsyncCacheErrorHandler
- java.lang.Object
-
- io.micronaut.cache.AsyncCacheErrorHandler
-
- All Implemented Interfaces:
CacheErrorHandler
@Singleton @Named("async") public class AsyncCacheErrorHandler extends java.lang.Object implements CacheErrorHandler
Async error handler that simply logs errors.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description AsyncCacheErrorHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
handleInvalidateError(Cache<?> cache, java.lang.Object key, java.lang.RuntimeException e)
Handles a cacheCacheInvalidate
error.boolean
handleInvalidateError(Cache<?> cache, java.lang.RuntimeException e)
Handles a cacheCacheInvalidate
error.boolean
handlePutError(Cache<?> cache, java.lang.Object key, java.lang.Object result, java.lang.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
-
-
-
-
Method Detail
-
handleInvalidateError
public boolean handleInvalidateError(Cache<?> cache, java.lang.Object key, java.lang.RuntimeException e)
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
public boolean handleInvalidateError(Cache<?> cache, java.lang.RuntimeException e)
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
public boolean handlePutError(Cache<?> cache, java.lang.Object key, java.lang.Object result, java.lang.RuntimeException e)
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.
-
-