org.springframework.batch.repeat.policy

## 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 for `CompletionPolicy` implementations.
  Author:
    Dave Syer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompletionPolicySupport()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isComplete(RepeatContext context)` Always true.
    `boolean` | `isComplete(RepeatContext context, RepeatStatus result)` If exit status is not continuable return `true`, 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,
                                    RepeatStatus result)

      If exit status is not continuable return `true`, 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, RepeatStatus)`

    - #### 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)`