CacheErrorHandler implementation that logs error messages.
Can be used when underlying cache errors should be ignored.
| Modifier and Type | Field and Description |
|---|---|
| private final Log | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | LoggingCacheErrorHandler()
Create a |
| public | LoggingCacheErrorHandler(boolean
whether to log stack traces logStackTraces)Create a |
| public | LoggingCacheErrorHandler(Log
the logger to use logger, boolean whether to log stack traces logStackTraces)Create a |
| public | LoggingCacheErrorHandler(String
the name of the logger to use. The name will be passed
to the underlying logger implementation through Commons Logging, getting
interpreted as log category according to the logger's configuration. loggerName, boolean whether to log stack traces logStackTraces)Create a |
| Modifier and Type | Method and Description |
|---|---|
| protected final Log | |
| public void | handleCacheClearError(RuntimeException
the exception thrown by the cache provider exception, Cache the cache to clear cache)Implements org. Cache, possibly rethrowing it as a
fatal exception.
|
| public void | handleCacheEvictError(RuntimeException
the exception thrown by the cache provider exception, Cache the cache cache, Object the key used to clear the item key)Implements org. key, possibly rethrowing
it as a fatal exception.
|
| public void | handleCacheGetError(RuntimeException
the exception thrown by the cache provider exception, Cache the cache cache, Object the key used to get the item key)Implements org. key, possibly
rethrowing it as a fatal exception.
|
| public void | handleCachePutError(RuntimeException
the exception thrown by the cache provider exception, Cache the cache cache, Object the key used to update the item key, Object the value to associate with the key value)Implements org. key and value,
possibly rethrowing it as a fatal exception.
|
| protected final boolean | Returns: true if this LoggingCacheErrorHandler logs stack tracesGet the |
| protected void | logCacheError(Supplier<String>
the message supplier messageSupplier, RuntimeException the exception thrown by the cache provider exception)Log the cache error message in the given supplier. |
| logger | back to summary |
|---|---|
| private final Log logger | |
| logStackTraces | back to summary |
|---|---|
| private final boolean logStackTraces | |
| LoggingCacheErrorHandler | back to summary |
|---|---|
| public LoggingCacheErrorHandler() Create a The default logging category is
" | |
| LoggingCacheErrorHandler | back to summary |
|---|---|
| public LoggingCacheErrorHandler(boolean logStackTraces) Create a The default logging category is
"
| |
| LoggingCacheErrorHandler | back to summary |
|---|---|
| public LoggingCacheErrorHandler(Log logger, boolean logStackTraces) Create a
| |
| LoggingCacheErrorHandler | back to summary |
|---|---|
| public LoggingCacheErrorHandler(String loggerName, boolean logStackTraces) Create a
| |
| getLogger | back to summary |
|---|---|
| protected final Log getLogger() Get the logger for this
| |
| handleCacheClearError | back to summary |
|---|---|
| public void handleCacheClearError(RuntimeException exception, Cache cache) Implements org. Doc from org. Handle the given runtime exception thrown by the cache provider when
clearing the specified
| |
| handleCacheEvictError | back to summary |
|---|---|
| public void handleCacheEvictError(RuntimeException exception, Cache cache, Object key) Implements org. Doc from org. Handle the given runtime exception thrown by the cache provider when
clearing an item with the specified
| |
| handleCacheGetError | back to summary |
|---|---|
| public void handleCacheGetError(RuntimeException exception, Cache cache, Object key) Implements org. Doc from org. Handle the given runtime exception thrown by the cache provider when
retrieving an item with the specified
| |
| handleCachePutError | back to summary |
|---|---|
| public void handleCachePutError(RuntimeException exception, Cache cache, Object key, Object value) Implements org. Doc from org. Handle the given runtime exception thrown by the cache provider when
updating an item with the specified
| |
| isLogStackTraces | back to summary |
|---|---|
| protected final boolean isLogStackTraces() Get the
| |
| logCacheError | back to summary |
|---|---|
| protected void logCacheError(Supplier<String> messageSupplier, RuntimeException exception) Log the cache error message in the given supplier. If The default implementation logs the message as a warning.
| |