类 LoggingCacheErrorHandler

java.lang.Object
cn.taketoday.cache.interceptor.LoggingCacheErrorHandler
所有已实现的接口:
CacheErrorHandler

public class LoggingCacheErrorHandler extends Object implements CacheErrorHandler
A CacheErrorHandler implementation that logs error message. Can be used when underlying cache errors should be ignored.
从以下版本开始:
4.0
作者:
Adam Ostrožlík, Stephane Nicoll
  • 构造器详细资料

    • LoggingCacheErrorHandler

      public LoggingCacheErrorHandler()
      Create an instance that does not log stack traces.
    • LoggingCacheErrorHandler

      public LoggingCacheErrorHandler(cn.taketoday.logging.Logger logger, boolean logStackTraces)
      Create an instance with the logger to use.
      参数:
      logger - the logger to use
      logStackTraces - whether to log stack trace
    • LoggingCacheErrorHandler

      public LoggingCacheErrorHandler(boolean logStackTraces)
      Create a LoggingCacheErrorHandler that uses the default logging category and the supplied logStackTraces flag.

      The default logging category is "cn.taketoday.cache.interceptor.LoggingCacheErrorHandler".

      参数:
      logStackTraces - whether to log stack traces
  • 方法详细资料

    • handleCacheGetError

      public void handleCacheGetError(RuntimeException exception, Cache cache, Object key)
      从接口复制的说明: CacheErrorHandler
      Handle the given runtime exception thrown by the cache provider when retrieving an item with the specified key, possibly rethrowing it as a fatal exception.
      指定者:
      handleCacheGetError 在接口中 CacheErrorHandler
      参数:
      exception - the exception thrown by the cache provider
      cache - the cache
      key - the key used to get the item
      另请参阅:
    • handleCachePutError

      public void handleCachePutError(RuntimeException exception, Cache cache, Object key, @Nullable Object value)
      从接口复制的说明: CacheErrorHandler
      Handle the given runtime exception thrown by the cache provider when updating an item with the specified key and value, possibly rethrowing it as a fatal exception.
      指定者:
      handleCachePutError 在接口中 CacheErrorHandler
      参数:
      exception - the exception thrown by the cache provider
      cache - the cache
      key - the key used to update the item
      value - the value to associate with the key
      另请参阅:
    • handleCacheEvictError

      public void handleCacheEvictError(RuntimeException exception, Cache cache, Object key)
      从接口复制的说明: CacheErrorHandler
      Handle the given runtime exception thrown by the cache provider when clearing an item with the specified key, possibly rethrowing it as a fatal exception.
      指定者:
      handleCacheEvictError 在接口中 CacheErrorHandler
      参数:
      exception - the exception thrown by the cache provider
      cache - the cache
      key - the key used to clear the item
    • handleCacheClearError

      public void handleCacheClearError(RuntimeException exception, Cache cache)
      从接口复制的说明: CacheErrorHandler
      Handle the given runtime exception thrown by the cache provider when clearing the specified Cache, possibly rethrowing it as a fatal exception.
      指定者:
      handleCacheClearError 在接口中 CacheErrorHandler
      参数:
      exception - the exception thrown by the cache provider
      cache - the cache to clear
    • getLogger

      protected final cn.taketoday.logging.Logger getLogger()
      Get the logger for this LoggingCacheErrorHandler.
      返回:
      the logger
    • isLogStackTraces

      protected final boolean isLogStackTraces()
      Get the logStackTraces flag for this LoggingCacheErrorHandler.
      返回:
      true if this LoggingCacheErrorHandler logs stack traces
    • doLogCacheError

      protected void doLogCacheError(cn.taketoday.logging.Logger logger, String message, RuntimeException ex)
      Log the specified message.
      参数:
      logger - the logger
      message - the message
      ex - the exception