org.springframework.batch.repeat.policy
Class CompletionPolicySupport

java.lang.Object
  extended by org.springframework.batch.repeat.policy.CompletionPolicySupport
All Implemented Interfaces:
CompletionPolicy
Direct Known Subclasses:
DefaultResultCompletionPolicy, TimeoutTerminationPolicy

public class CompletionPolicySupport
extends Object
implements CompletionPolicy

Very simple base class for CompletionPolicy implementations.

Author:
Dave Syer

Constructor Summary
CompletionPolicySupport()
           
 
Method Summary
 boolean isComplete(RepeatContext context)
          Always true.
 boolean isComplete(RepeatContext context, ExitStatus result)
          Return true if exit status is not continuable, otherwise delegate to isComplete(RepeatContext).
 RepeatContext start(RepeatContext context)
          Build a new RepeatContextSupport and return it.
 void update(RepeatContext context)
          Increment the context so the counter is up to date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompletionPolicySupport

public CompletionPolicySupport()
Method Detail

isComplete

public boolean isComplete(RepeatContext context,
                          ExitStatus result)
Return true if exit status is not continuable, otherwise delegate to isComplete(RepeatContext).

Specified by:
isComplete in interface CompletionPolicy
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, ExitStatus)

isComplete

public boolean isComplete(RepeatContext context)
Always true.

Specified by:
isComplete in interface CompletionPolicy
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 new RepeatContextSupport and return it.

Specified by:
start in interface CompletionPolicy
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:
update in interface CompletionPolicy
Parameters:
context - the value returned by start.
See Also:
CompletionPolicy.update(org.springframework.batch.repeat.RepeatContext)


Copyright © 2009 SpringSource. All Rights Reserved.