Package org.springframework.batch.core.jsr.step

Examples of org.springframework.batch.core.jsr.step.BatchletStep


  public TaskletStep build() {
    registerStepListenerAsItemListener();
    registerAsStreamsAndListeners(getReader(), getProcessor(), getWriter());
    registerStepListenerAsChunkListener();

    BatchletStep step = new BatchletStep(getName(), batchPropertyContext);

    super.enhance(step);

    step.setChunkListeners(chunkListeners.toArray(new ChunkListener[0]));

    if (getTransactionAttribute() != null) {
      step.setTransactionAttribute(getTransactionAttribute());
    }

    if (getStepOperations() == null) {

      stepOperations(new RepeatTemplate());

      if (getTaskExecutor() != null) {
        TaskExecutorRepeatTemplate repeatTemplate = new TaskExecutorRepeatTemplate();
        repeatTemplate.setTaskExecutor(getTaskExecutor());
        repeatTemplate.setThrottleLimit(getThrottleLimit());
        stepOperations(repeatTemplate);
      }

      ((RepeatTemplate) getStepOperations()).setExceptionHandler(getExceptionHandler());

    }
    step.setStepOperations(getStepOperations());
    step.setTasklet(createTasklet());

    ItemStream[] streams = getStreams().toArray(new ItemStream[0]);
    step.setStreams(streams);

    try {
      step.afterPropertiesSet();
    }
    catch (Exception e) {
      throw new StepBuilderException(e);
    }
View Full Code Here


  @Override
  public TaskletStep build() {

    registerStepListenerAsChunkListener();

    BatchletStep step = new BatchletStep(getName(), batchPropertyContext);

    super.enhance(step);

    step.setChunkListeners(chunkListeners.toArray(new ChunkListener[0]));

    if (getTransactionAttribute() != null) {
      step.setTransactionAttribute(getTransactionAttribute());
    }

    if (getStepOperations() == null) {

      stepOperations(new RepeatTemplate());

      if (getTaskExecutor() != null) {
        TaskExecutorRepeatTemplate repeatTemplate = new TaskExecutorRepeatTemplate();
        repeatTemplate.setTaskExecutor(getTaskExecutor());
        repeatTemplate.setThrottleLimit(getThrottleLimit());
        stepOperations(repeatTemplate);
      }

      ((RepeatTemplate) getStepOperations()).setExceptionHandler(getExceptionHandler());

    }
    step.setStepOperations(getStepOperations());
    step.setTasklet(createTasklet());

    step.setStreams(getStreams().toArray(new ItemStream[0]));

    try {
      step.afterPropertiesSet();
    }
    catch (Exception e) {
      throw new StepBuilderException(e);
    }
View Full Code Here

    registerStepListenerAsSkipListener();
    registerAsStreamsAndListeners(getReader(), getProcessor(), getWriter());

    registerStepListenerAsChunkListener();

    BatchletStep step = new BatchletStep(getName(), batchPropertyContext);

    super.enhance(step);

    step.setChunkListeners(chunkListeners.toArray(new ChunkListener[0]));

    if (getTransactionAttribute() != null) {
      step.setTransactionAttribute(getTransactionAttribute());
    }

    if (getStepOperations() == null) {

      stepOperations(new RepeatTemplate());

      if (getTaskExecutor() != null) {
        TaskExecutorRepeatTemplate repeatTemplate = new TaskExecutorRepeatTemplate();
        repeatTemplate.setTaskExecutor(getTaskExecutor());
        repeatTemplate.setThrottleLimit(getThrottleLimit());
        stepOperations(repeatTemplate);
      }

      ((RepeatTemplate) getStepOperations()).setExceptionHandler(getExceptionHandler());

    }
    step.setStepOperations(getStepOperations());
    step.setTasklet(createTasklet());

    step.setStreams(getStreams().toArray(new ItemStream[0]));

    try {
      step.afterPropertiesSet();
    }
    catch (Exception e) {
      throw new StepBuilderException(e);
    }
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.jsr.step.BatchletStep

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.