|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.repeat.policy.CompletionPolicySupport org.springframework.batch.repeat.policy.TimeoutTerminationPolicy
public class TimeoutTerminationPolicy
Termination policy that times out after a fixed period. Allows graceful exit
from a batch if the latest result comes in after the timeout expires (i.e.
does not throw a timeout exception).
N.B. It may often be the case that the batch governed by this policy will be
transactional, and the transaction might have its own timeout. In this case
the transaction might throw a timeout exception on commit if its timeout
threshold is lower than the termination policy.
Nested Class Summary | |
---|---|
protected class |
TimeoutTerminationPolicy.TimeoutBatchContext
|
Field Summary | |
---|---|
static long |
DEFAULT_TIMEOUT
Default timeout value in millisecs (the value equivalent to 30 seconds). |
Constructor Summary | |
---|---|
TimeoutTerminationPolicy()
Default constructor. |
|
TimeoutTerminationPolicy(long timeout)
Construct a TimeoutTerminationPolicy with the specified timeout
value (in milliseconds). |
Method Summary | |
---|---|
boolean |
isComplete(RepeatContext context)
Check the timeout and complete gracefully if it has expires. |
RepeatContext |
start(RepeatContext context)
Start the clock on the timeout. |
Methods inherited from class org.springframework.batch.repeat.policy.CompletionPolicySupport |
---|
isComplete, update |
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 TimeoutTerminationPolicy()
public TimeoutTerminationPolicy(long timeout)
TimeoutTerminationPolicy
with the specified timeout
value (in milliseconds).
timeout
- Method Detail |
---|
public boolean isComplete(RepeatContext context)
isComplete
in interface CompletionPolicy
isComplete
in class CompletionPolicySupport
context
- the current batch context.
CompletionPolicy.isComplete(org.springframework.batch.repeat.RepeatContext)
public RepeatContext start(RepeatContext context)
start
in interface CompletionPolicy
start
in class CompletionPolicySupport
context
- the current context if one is already in progress.
CompletionPolicy.start(RepeatContext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |