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 CacheErrorHandlerAsync 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 booleanhandleInvalidateError(Cache<?> cache, java.lang.Object key, java.lang.RuntimeException e)Handles a cacheCacheInvalidateerror.booleanhandleInvalidateError(Cache<?> cache, java.lang.RuntimeException e)Handles a cacheCacheInvalidateerror.booleanhandlePutError(Cache<?> cache, java.lang.Object key, java.lang.Object result, java.lang.RuntimeException e)Handles a cacheCachePuterror.-
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:CacheErrorHandlerHandles a cacheCacheInvalidateerror. Defaults to simply rethrowing the error. By returningfalsecache invalidate errors will instead to be swallowed and ignored.- Specified by:
handleInvalidateErrorin 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:CacheErrorHandlerHandles a cacheCacheInvalidateerror. Defaults to simply rethrowing the error. By returningfalsecache invalidate errors will instead to be swallowed and ignored.- Specified by:
handleInvalidateErrorin 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:CacheErrorHandlerHandles a cacheCachePuterror. Defaults to simply rethrowing the error. By returningfalsecache write errors will instead to be swallowed and ignored.- Specified by:
handlePutErrorin 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.
-
-