public class TimeoutTerminationPolicy extends CompletionPolicySupport
Modifier and Type | Class and Description |
---|---|
protected class |
TimeoutTerminationPolicy.TimeoutBatchContext |
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_TIMEOUT
Default timeout value in milliseconds (the value equivalent to 30 seconds).
|
Constructor and Description |
---|
TimeoutTerminationPolicy()
Default constructor.
|
TimeoutTerminationPolicy(long timeout)
Construct a
TimeoutTerminationPolicy with the specified timeout
value (in milliseconds). |
Modifier and Type | Method and Description |
---|---|
boolean |
isComplete(RepeatContext context)
Check the timeout and complete gracefully if it has expires.
|
RepeatContext |
start(RepeatContext context)
Start the clock on the timeout.
|
isComplete, update
public static final long DEFAULT_TIMEOUT
public TimeoutTerminationPolicy()
public TimeoutTerminationPolicy(long timeout)
TimeoutTerminationPolicy
with the specified timeout
value (in milliseconds).timeout
- 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)