|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.retry.policy.AbstractStatelessRetryPolicy org.springframework.batch.retry.policy.TimeoutRetryPolicy
public class TimeoutRetryPolicy
A RetryPolicy
that allows a retry only if it hasn't timed out. The
clock is started on a call to open(RetryCallback, RetryContext)
.
Field Summary | |
---|---|
static long |
DEFAULT_TIMEOUT
Default value for timeout (milliseconds). |
Constructor Summary | |
---|---|
TimeoutRetryPolicy()
|
Method Summary | |
---|---|
boolean |
canRetry(RetryContext context)
Only permits a retry if the timeout has not expired. |
void |
close(RetryContext context)
|
RetryContext |
open(RetryCallback callback,
RetryContext parent)
Acquire resources needed for the retry operation. |
void |
registerThrowable(RetryContext context,
Throwable throwable)
Called once per retry attempt, after the callback fails. |
void |
setTimeout(long timeout)
Setter for timeout. |
Methods inherited from class org.springframework.batch.retry.policy.AbstractStatelessRetryPolicy |
---|
handleRetryExhausted, shouldRethrow |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_TIMEOUT
Constructor Detail |
---|
public TimeoutRetryPolicy()
Method Detail |
---|
public void setTimeout(long timeout)
DEFAULT_TIMEOUT
.
timeout
- public boolean canRetry(RetryContext context)
context
- the current retry status
RetryPolicy.canRetry(org.springframework.batch.retry.RetryContext)
public void close(RetryContext context)
context
- a retry status created by the RetryPolicy.open(RetryCallback, RetryContext)
method of this manager.public RetryContext open(RetryCallback callback, RetryContext parent)
RetryPolicy
callback
- the RetryCallback
that will execute the unit of
work for this retry.parent
- the parent context if we are in a nested retry.
RetryContext
object specific to this manager.public void registerThrowable(RetryContext context, Throwable throwable) throws TerminatedRetryException
RetryPolicy
context
- the current status object.
TerminatedRetryException
- if the status is set to terminate only.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |