类 LoggingCacheErrorHandler
java.lang.Object
cn.taketoday.cache.interceptor.LoggingCacheErrorHandler
- 所有已实现的接口:
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
-
构造器概要
构造器构造器说明Create an instance that does not log stack traces.LoggingCacheErrorHandler(boolean logStackTraces) Create aLoggingCacheErrorHandlerthat uses the default logging category and the suppliedlogStackTracesflag.LoggingCacheErrorHandler(cn.taketoday.logging.Logger logger, boolean logStackTraces) Create an instance with theloggerto use. -
方法概要
修饰符和类型方法说明protected voiddoLogCacheError(cn.taketoday.logging.Logger logger, String message, RuntimeException ex) Log the specified message.protected final cn.taketoday.logging.LoggerGet the logger for thisLoggingCacheErrorHandler.voidhandleCacheClearError(RuntimeException exception, Cache cache) Handle the given runtime exception thrown by the cache provider when clearing the specifiedCache, possibly rethrowing it as a fatal exception.voidhandleCacheEvictError(RuntimeException exception, Cache cache, Object key) Handle the given runtime exception thrown by the cache provider when clearing an item with the specifiedkey, possibly rethrowing it as a fatal exception.voidhandleCacheGetError(RuntimeException exception, Cache cache, Object key) Handle the given runtime exception thrown by the cache provider when retrieving an item with the specifiedkey, possibly rethrowing it as a fatal exception.voidhandleCachePutError(RuntimeException exception, Cache cache, Object key, Object value) Handle the given runtime exception thrown by the cache provider when updating an item with the specifiedkeyandvalue, possibly rethrowing it as a fatal exception.protected final booleanGet thelogStackTracesflag for thisLoggingCacheErrorHandler.
-
构造器详细资料
-
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 theloggerto use.- 参数:
logger- the logger to uselogStackTraces- whether to log stack trace
-
LoggingCacheErrorHandler
public LoggingCacheErrorHandler(boolean logStackTraces) Create aLoggingCacheErrorHandlerthat uses the default logging category and the suppliedlogStackTracesflag.The default logging category is "
cn.taketoday.cache.interceptor.LoggingCacheErrorHandler".- 参数:
logStackTraces- whether to log stack traces
-
-
方法详细资料
-
handleCacheGetError
从接口复制的说明:CacheErrorHandlerHandle the given runtime exception thrown by the cache provider when retrieving an item with the specifiedkey, possibly rethrowing it as a fatal exception.- 指定者:
handleCacheGetError在接口中CacheErrorHandler- 参数:
exception- the exception thrown by the cache providercache- the cachekey- the key used to get the item- 另请参阅:
-
handleCachePutError
public void handleCachePutError(RuntimeException exception, Cache cache, Object key, @Nullable Object value) 从接口复制的说明:CacheErrorHandlerHandle the given runtime exception thrown by the cache provider when updating an item with the specifiedkeyandvalue, possibly rethrowing it as a fatal exception.- 指定者:
handleCachePutError在接口中CacheErrorHandler- 参数:
exception- the exception thrown by the cache providercache- the cachekey- the key used to update the itemvalue- the value to associate with the key- 另请参阅:
-
handleCacheEvictError
从接口复制的说明:CacheErrorHandlerHandle the given runtime exception thrown by the cache provider when clearing an item with the specifiedkey, possibly rethrowing it as a fatal exception.- 指定者:
handleCacheEvictError在接口中CacheErrorHandler- 参数:
exception- the exception thrown by the cache providercache- the cachekey- the key used to clear the item
-
handleCacheClearError
从接口复制的说明:CacheErrorHandlerHandle the given runtime exception thrown by the cache provider when clearing the specifiedCache, possibly rethrowing it as a fatal exception.- 指定者:
handleCacheClearError在接口中CacheErrorHandler- 参数:
exception- the exception thrown by the cache providercache- the cache to clear
-
getLogger
protected final cn.taketoday.logging.Logger getLogger()Get the logger for thisLoggingCacheErrorHandler.- 返回:
- the logger
-
isLogStackTraces
protected final boolean isLogStackTraces()Get thelogStackTracesflag for thisLoggingCacheErrorHandler.- 返回:
trueif thisLoggingCacheErrorHandlerlogs stack traces
-
doLogCacheError
protected void doLogCacheError(cn.taketoday.logging.Logger logger, String message, RuntimeException ex) Log the specified message.- 参数:
logger- the loggermessage- the messageex- the exception
-