Class CompletionPolicySupport
java.lang.Object
org.springframework.batch.repeat.policy.CompletionPolicySupport
- All Implemented Interfaces:
CompletionPolicy
- Direct Known Subclasses:
DefaultResultCompletionPolicy
,TimeoutTerminationPolicy
Very simple base class for
CompletionPolicy
implementations.- Author:
- Dave Syer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isComplete
(RepeatContext context) Always true.boolean
isComplete
(RepeatContext context, RepeatStatus result) If exit status is not continuable returntrue
, otherwise delegate toisComplete(RepeatContext)
.start
(RepeatContext context) Build a newRepeatContextSupport
and return it.void
update
(RepeatContext context) Increment the context so the counter is up to date.
-
Constructor Details
-
CompletionPolicySupport
public CompletionPolicySupport()
-
-
Method Details
-
isComplete
If exit status is not continuable returntrue
, otherwise delegate toisComplete(RepeatContext)
.- Specified by:
isComplete
in interfaceCompletionPolicy
- Parameters:
context
- the current batch context.result
- the result of the latest batch item processing.- Returns:
- true if the batch should terminate.
- See Also:
-
isComplete
Always true.- Specified by:
isComplete
in interfaceCompletionPolicy
- Parameters:
context
- the current batch context.- Returns:
- true if the batch should terminate.
- See Also:
-
start
Build a newRepeatContextSupport
and return it.- Specified by:
start
in interfaceCompletionPolicy
- Parameters:
context
- the current context if one is already in progress.- Returns:
- a context object that can be used by the implementation to store internal state for a batch.
- See Also:
-
update
Increment the context so the counter is up to date. Do nothing else.- Specified by:
update
in interfaceCompletionPolicy
- Parameters:
context
- the value returned by start.- See Also:
-