Example usage for org.springframework.batch.repeat RepeatCallback doInIteration

List of usage examples for org.springframework.batch.repeat RepeatCallback doInIteration

Introduction

In this page you can find the example usage for org.springframework.batch.repeat RepeatCallback doInIteration.

Prototype

RepeatStatus doInIteration(RepeatContext context) throws Exception;

Source Link

Document

Implementations return true if they can continue processing - e.g.

Usage

From source file:org.springframework.batch.repeat.support.RepeatTemplate.java

/**
 * Get the next completed result, possibly executing several callbacks until
 * one finally finishes. Normally a subclass would have to override both
 * this method and {@link #createInternalState(RepeatContext)} because the
 * implementation of this method would rely on the details of the internal
 * state.//from  w  w w.j a  va 2s .c  o  m
 * 
 * @param context current BatchContext.
 * @param callback the callback to execute.
 * @param state maintained by the implementation.
 * @return a finished result.
 * 
 * @see #isComplete(RepeatContext)
 * @see #createInternalState(RepeatContext)
 */
protected RepeatStatus getNextResult(RepeatContext context, RepeatCallback callback, RepeatInternalState state)
        throws Throwable {
    update(context);
    if (logger.isDebugEnabled()) {
        logger.debug("Repeat operation about to start at count=" + context.getStartedCount());
    }
    return callback.doInIteration(context);

}