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 Details

    • AsyncCacheErrorHandler

      public AsyncCacheErrorHandler()
  • Method Details

    • handleInvalidateError

      public boolean handleInvalidateError(Cache<?> cache, Object key, RuntimeException e)
      Description copied from interface: CacheErrorHandler
      Handles a cache CacheInvalidate error. Defaults to simply rethrowing the error. By returning false cache invalidate errors will instead to be swallowed and ignored.
      Specified by:
      handleInvalidateError in interface CacheErrorHandler
      Parameters:
      cache - The cache
      key - The key
      e - 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, RuntimeException e)
      Description copied from interface: CacheErrorHandler
      Handles a cache CacheInvalidate error. Defaults to simply rethrowing the error. By returning false cache invalidate errors will instead to be swallowed and ignored.
      Specified by:
      handleInvalidateError in interface CacheErrorHandler
      Parameters:
      cache - The cache
      e - 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, Object key, Object result, RuntimeException e)
      Description copied from interface: CacheErrorHandler
      Handles a cache CachePut error. Defaults to simply rethrowing the error. By returning false cache write errors will instead to be swallowed and ignored.
      Specified by:
      handlePutError in interface CacheErrorHandler
      Parameters:
      cache - The cache
      key - The key name
      result - The result
      e - The error
      Returns:
      Whether the exception should be swallowed or rethrown. A value of true will rethrow he exception.