类 RethrowOnThresholdExceptionHandler

    • 字段概要

      字段 
      修饰符和类型字段说明
      protected org.apache.commons.logging.Loglogger 
      protected static org.springframework.batch.repeat.exception.RethrowOnThresholdExceptionHandler.IntegerHolderZERO 
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      voidhandleException​(RepeatContext context, java.lang.Throwable throwable)
      Classify the throwables and decide whether to re-throw based on the result.
      voidsetThresholds​(java.util.Map<java.lang.Class<? extends java.lang.Throwable>,​java.lang.Integer> thresholds)
      A map from exception classes to a threshold value of type Integer.
      voidsetUseParent​(boolean useParent)
      Flag to indicate the the exception counters should be shared between sibling contexts in a nested batch.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • ZERO

        protected static final org.springframework.batch.repeat.exception.RethrowOnThresholdExceptionHandler.IntegerHolder ZERO
      • logger

        protected final org.apache.commons.logging.Log logger
    • 构造器详细资料

      • RethrowOnThresholdExceptionHandler

        public RethrowOnThresholdExceptionHandler()
        Set up the exception handler. Creates a default exception handler and threshold that maps all exceptions to a threshold of 0 - all exceptions are rethrown by default.
    • 方法详细资料

      • setUseParent

        public void setUseParent​(boolean useParent)
        Flag to indicate the the exception counters should be shared between sibling contexts in a nested batch. Default is false.
        参数:
        useParent - true if the parent context should be used to store the counters.
      • setThresholds

        public void setThresholds​(java.util.Map<java.lang.Class<? extends java.lang.Throwable>,​java.lang.Integer> thresholds)
        A map from exception classes to a threshold value of type Integer.
        参数:
        thresholds - the threshold value map.
      • handleException

        public void handleException​(RepeatContext context,
                                    java.lang.Throwable throwable)
                             throws java.lang.Throwable
        Classify the throwables and decide whether to re-throw based on the result. The context is used to accumulate the number of exceptions of the same type according to the classifier.
        指定者:
        handleException 在接口中 ExceptionHandler
        参数:
        context - the current RepeatContext. 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 - is thrown if number of exceptions exceeds threshold.
        另请参阅:
        ExceptionHandler.handleException(RepeatContext, Throwable)