Example usage for org.springframework.batch.core.step AbstractStep setStartLimit

List of usage examples for org.springframework.batch.core.step AbstractStep setStartLimit

Introduction

In this page you can find the example usage for org.springframework.batch.core.step AbstractStep setStartLimit.

Prototype

public void setStartLimit(int startLimit) 

Source Link

Document

Public setter for the startLimit.

Usage

From source file:org.springframework.batch.core.configuration.xml.StepParserStepFactoryBean.java

private void configureAbstractStep(AbstractStep ts) {
    if (name != null) {
        ts.setName(name);//from   ww  w. ja v a2 s  .c o  m
    }
    if (allowStartIfComplete != null) {
        ts.setAllowStartIfComplete(allowStartIfComplete);
    }
    if (jobRepository != null) {
        ts.setJobRepository(jobRepository);
    }
    if (startLimit != null) {
        ts.setStartLimit(startLimit);
    }
    if (listeners != null) {
        List<StepExecutionListener> newListeners = new ArrayList<StepExecutionListener>();
        for (StepListener listener : listeners) {
            if (listener instanceof StepExecutionListener) {
                newListeners.add((StepExecutionListener) listener);
            }
        }
        ts.setStepExecutionListeners(newListeners.toArray(new StepExecutionListener[0]));
    }
}

From source file:org.springframework.batch.core.step.builder.StepBuilderHelper.java

protected void enhance(Step target) {

    if (target instanceof AbstractStep) {

        AbstractStep step = (AbstractStep) target;
        step.setJobRepository(properties.getJobRepository());

        Boolean allowStartIfComplete = properties.allowStartIfComplete;
        if (allowStartIfComplete != null) {
            step.setAllowStartIfComplete(allowStartIfComplete);
        }/*from   ww  w  .j  a  va  2  s.  com*/

        step.setStartLimit(properties.startLimit);

        List<StepExecutionListener> listeners = properties.stepExecutionListeners;
        if (!listeners.isEmpty()) {
            step.setStepExecutionListeners(listeners.toArray(new StepExecutionListener[0]));
        }

    }

    if (target instanceof TaskletStep) {
        TaskletStep step = (TaskletStep) target;
        step.setTransactionManager(properties.transactionManager);
    }

}