org.springframework.batch.repeat.callback

## Class NestedRepeatCallback

- java.lang.Object
- - org.springframework.batch.repeat.callback.NestedRepeatCallback

- All Implemented Interfaces:
    RepeatCallback

      public class NestedRepeatCallback
      extends java.lang.Object
      implements RepeatCallback

  Callback that delegates to another callback, via a `RepeatOperations` instance. Useful when nesting or composing batches in one another, e.g. for breaking a batch down into chunks.
  Author:
    Dave Syer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NestedRepeatCallback(RepeatOperations template, RepeatCallback callback)` Constructor setting mandatory fields.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `RepeatStatus` | `doInIteration(RepeatContext context)` Simply calls template.execute(callback).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NestedRepeatCallback

          public NestedRepeatCallback(RepeatOperations template,
                                      RepeatCallback callback)

      Constructor setting mandatory fields.
      Parameters:
        `template` - the `RepeatOperations` to use when calling the delegate callback
        `callback` - the `RepeatCallback` delegate

  - ### Method Detail

    - #### doInIteration

          public RepeatStatus doInIteration(RepeatContext context)
                                     throws java.lang.Exception

      Simply calls template.execute(callback). Clients can use this to repeat a batch process, or to break a process up into smaller chunks (e.g. to change the transaction boundaries).
      Specified by:
        `doInIteration` in interface `RepeatCallback`
      Parameters:
        `context` - the current context passed in by the caller.
      Returns:
        an `RepeatStatus` which is continuable if there is (or may be) more data to process.
      Throws:
        `java.lang.Exception` - if there is a problem with the processing.
      See Also:
        `RepeatCallback.doInIteration(RepeatContext)`