public class NeverRetryPolicy extends Object implements RetryPolicy
RetryPolicy that allows the first attempt but never permits a
retry. Also be used as a base class for other policies, e.g. for test
purposes as a stub.| Constructor and Description |
|---|
NeverRetryPolicy() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRetry(RetryContext context)
Returns false after the first exception.
|
void |
close(RetryContext context)
Do nothing.
|
RetryContext |
open(RetryContext parent)
Return a context that can respond to early termination requests, but does
nothing else.
|
void |
registerThrowable(RetryContext context,
Throwable throwable)
Make the throwable available for downstream use through the context.
|
public boolean canRetry(RetryContext context)
canRetry in interface RetryPolicycontext - the current retry statusRetryPolicy.canRetry(org.springframework.retry.RetryContext)public void close(RetryContext context)
close in interface RetryPolicycontext - a retry status created by the
RetryPolicy.open(RetryContext) method of this policy.RetryPolicy.close(org.springframework.retry.RetryContext)public RetryContext open(RetryContext parent)
open in interface RetryPolicyparent - the parent context if we are in a nested retry.RetryContext object specific to this policy.RetryPolicy.open(RetryContext)public void registerThrowable(RetryContext context, Throwable throwable)
registerThrowable in interface RetryPolicycontext - the current status object.throwable - the exception to throwRetryPolicy.registerThrowable(org.springframework.retry.RetryContext,
Throwable)Copyright © 2018 SpringSource. All rights reserved.