类 LogOrRethrowExceptionHandler
- java.lang.Object
- org.springframework.batch.repeat.exception.LogOrRethrowExceptionHandler
- 所有已实现的接口:
ExceptionHandler
public class LogOrRethrowExceptionHandler extends java.lang.Object implements ExceptionHandler
Implementation ofExceptionHandler
based on anClassifier
. The classifier determines whether to log the exception or rethrow it. The keys in the classifier must be the same as the static enum in this class.- 作者:
- Dave Syer
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
LogOrRethrowExceptionHandler.Level
Logging levels for the handler.
字段概要
字段 修饰符和类型 字段 说明 protected org.apache.commons.logging.Log
logger
构造器概要
构造器 构造器 说明 LogOrRethrowExceptionHandler()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
handleException(RepeatContext context, java.lang.Throwable throwable)
Classify the throwables and decide whether to rethrow based on the result.void
setExceptionClassifier(org.springframework.classify.Classifier<java.lang.Throwable,LogOrRethrowExceptionHandler.Level> exceptionClassifier)
Setter for theClassifier
used by this handler.
字段详细资料
logger
protected final org.apache.commons.logging.Log logger
构造器详细资料
LogOrRethrowExceptionHandler
public LogOrRethrowExceptionHandler()
方法详细资料
setExceptionClassifier
public void setExceptionClassifier(org.springframework.classify.Classifier<java.lang.Throwable,LogOrRethrowExceptionHandler.Level> exceptionClassifier)
Setter for theClassifier
used by this handler. The default is to map all throwable instances toLogOrRethrowExceptionHandler.Level.RETHROW
.- 参数:
exceptionClassifier
- the ExceptionClassifier to use
handleException
public void handleException(RepeatContext context, java.lang.Throwable throwable) throws java.lang.Throwable
Classify the throwables and decide whether to rethrow based on the result. The context is not used.- 指定者:
handleException
在接口中ExceptionHandler
- 参数:
context
- the currentRepeatContext
. Can be used to store state (via attributes), for example to count the number of occurrences of a particular exception type and implement a threshold policy.throwable
- an exception.- 抛出:
java.lang.Throwable
- thrown ifexceptionClassifier
is classified asLogOrRethrowExceptionHandler.Level.RETHROW
.- 另请参阅:
ExceptionHandler.handleException(RepeatContext, Throwable)