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 RetryPolicy
context
- the current retry statusRetryPolicy.canRetry(org.springframework.retry.RetryContext)
public void close(RetryContext context)
close
in interface RetryPolicy
context
- a retry status created by the
RetryPolicy.open(RetryContext)
method of this manager.RetryPolicy.close(org.springframework.retry.RetryContext)
public RetryContext open(RetryContext parent)
open
in interface RetryPolicy
parent
- the parent context if we are in a nested retry.RetryContext
object specific to this manager.RetryPolicy.open(RetryContext)
public void registerThrowable(RetryContext context, Throwable throwable)
registerThrowable
in interface RetryPolicy
context
- the current status object.RetryPolicy.registerThrowable(org.springframework.retry.RetryContext,
Throwable)
Copyright © 2014 SpringSource. All rights reserved.