Class CompletionPolicySupport
- java.lang.Object
- org.springframework.batch.repeat.policy.CompletionPolicySupport
- All Implemented Interfaces:
CompletionPolicy
- Direct Known Subclasses:
DefaultResultCompletionPolicy,TimeoutTerminationPolicy
public class CompletionPolicySupport extends java.lang.Object implements CompletionPolicy
Very simple base class forCompletionPolicyimplementations.- Author:
- Dave Syer
Constructor Summary
Constructors Constructor Description CompletionPolicySupport()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisComplete(RepeatContext context)Always true.booleanisComplete(RepeatContext context, RepeatStatus result)If exit status is not continuable returntrue, otherwise delegate toisComplete(RepeatContext).RepeatContextstart(RepeatContext context)Build a newRepeatContextSupportand return it.voidupdate(RepeatContext context)Increment the context so the counter is up to date.
Method Detail
isComplete
public boolean isComplete(RepeatContext context, RepeatStatus result)
If exit status is not continuable returntrue, otherwise delegate toisComplete(RepeatContext).- Specified by:
isCompletein 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:
CompletionPolicy.isComplete(org.springframework.batch.repeat.RepeatContext, RepeatStatus)
isComplete
public boolean isComplete(RepeatContext context)
Always true.- Specified by:
isCompletein interfaceCompletionPolicy- Parameters:
context- the current batch context.- Returns:
- true if the batch should terminate.
- See Also:
CompletionPolicy.isComplete(org.springframework.batch.repeat.RepeatContext)
start
public RepeatContext start(RepeatContext context)
Build a newRepeatContextSupportand return it.- Specified by:
startin 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:
CompletionPolicy.start(RepeatContext)
update
public void update(RepeatContext context)
Increment the context so the counter is up to date. Do nothing else.- Specified by:
updatein interfaceCompletionPolicy- Parameters:
context- the value returned by start.- See Also:
CompletionPolicy.update(org.springframework.batch.repeat.RepeatContext)