Class 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 Detail

      • AsyncCacheErrorHandler

        public AsyncCacheErrorHandler()
    • Method Detail

      • handleInvalidateError

        public boolean handleInvalidateError​(Cache<?> cache,
                                             java.lang.Object key,
                                             java.lang.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,
                                             java.lang.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,
                                      java.lang.Object key,
                                      java.lang.Object result,
                                      java.lang.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.