类 SimpleRetryExceptionHandler
- java.lang.Object
- org.springframework.retry.listener.RetryListenerSupport
- org.springframework.batch.core.step.item.SimpleRetryExceptionHandler
- 所有已实现的接口:
ExceptionHandler
,org.springframework.retry.RetryListener
public class SimpleRetryExceptionHandler extends org.springframework.retry.listener.RetryListenerSupport implements ExceptionHandler
AnExceptionHandler
that is aware of the retry context so that it can distinguish between a fatal exception and one that can be retried. Delegates the actual exception handling to anotherExceptionHandler
.- 作者:
- Dave Syer
构造器概要
构造器 构造器 说明 SimpleRetryExceptionHandler(org.springframework.retry.RetryPolicy retryPolicy, ExceptionHandler exceptionHandler, java.util.Collection<java.lang.Class<? extends java.lang.Throwable>> fatalExceptionClasses)
Create an exception handler from its mandatory properties.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 <T,E extends java.lang.Throwable>
voidclose(org.springframework.retry.RetryContext context, org.springframework.retry.RetryCallback<T,E> callback, java.lang.Throwable throwable)
If retry is exhausted set up some state in the context that can be used to signal that the exception should be handled.void
handleException(RepeatContext context, java.lang.Throwable throwable)
Check if the exception is going to be retried, and veto the handling if it is.
构造器详细资料
SimpleRetryExceptionHandler
public SimpleRetryExceptionHandler(org.springframework.retry.RetryPolicy retryPolicy, ExceptionHandler exceptionHandler, java.util.Collection<java.lang.Class<? extends java.lang.Throwable>> fatalExceptionClasses)
Create an exception handler from its mandatory properties.- 参数:
retryPolicy
- the retry policy that will be under effect when an exception is encounteredexceptionHandler
- the delegate to use if an exception actually needs to be handledfatalExceptionClasses
- exceptions
方法详细资料
handleException
public void handleException(RepeatContext context, java.lang.Throwable throwable) throws java.lang.Throwable
Check if the exception is going to be retried, and veto the handling if it is. If retry is exhausted or the exception is on the fatal list, then handle using the delegate.- 指定者:
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
- implementations are free to re-throw the exception- 另请参阅:
ExceptionHandler.handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)
close
public <T,E extends java.lang.Throwable> void close(org.springframework.retry.RetryContext context, org.springframework.retry.RetryCallback<T,E> callback, java.lang.Throwable throwable)
If retry is exhausted set up some state in the context that can be used to signal that the exception should be handled.- 指定者:
close
在接口中org.springframework.retry.RetryListener
- 覆盖:
close
在类中org.springframework.retry.listener.RetryListenerSupport
- 另请参阅:
RetryListener.close(org.springframework.retry.RetryContext, org.springframework.retry.RetryCallback, java.lang.Throwable)