Package org.springframework.batch.core.partition.support

Examples of org.springframework.batch.core.partition.support.PartitionStep


    this.aggregator = aggregator;
    return this;
  }

  public Step build() {
    PartitionStep step = new PartitionStep();
    step.setName(getName());
    super.enhance(step);

    if (partitionHandler != null) {
      step.setPartitionHandler(partitionHandler);
    }
    else {
      TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler();
      partitionHandler.setStep(this.step);
      if (taskExecutor == null) {
        taskExecutor = new SyncTaskExecutor();
      }
      partitionHandler.setGridSize(gridSize);
      partitionHandler.setTaskExecutor(taskExecutor);
      step.setPartitionHandler(partitionHandler);
    }

    if (splitter != null) {
      step.setStepExecutionSplitter(splitter);
    }
    else {

      boolean allowStartIfComplete = isAllowStartIfComplete();
      String name = stepName;
      if (this.step != null) {
        try {
          allowStartIfComplete = this.step.isAllowStartIfComplete();
          name = this.step.getName();
        }
        catch (Exception e) {
          logger.info("Ignored exception from step asking for name and allowStartIfComplete flag. "
              + "Using default from enclosing PartitionStep (" + name + "," + allowStartIfComplete + ").");
        }
      }
      SimpleStepExecutionSplitter splitter = new SimpleStepExecutionSplitter();
      splitter.setPartitioner(partitioner);
      splitter.setJobRepository(getJobRepository());
      splitter.setAllowStartIfComplete(allowStartIfComplete);
      splitter.setStepName(name);
      this.splitter = splitter;
      step.setStepExecutionSplitter(splitter);

    }

    if (aggregator != null) {
      step.setStepExecutionAggregator(aggregator);
    }

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


    for (StepExecution se : jobExecution.getStepExecutions()) {
      String stepExecutionName = se.getStepName();
      // the partitioned step
      if (stepExecutionName.equalsIgnoreCase("j3s1")) {
        PartitionStep partitionStep = (PartitionStep) this.applicationContext.getBean(stepExecutionName);
        // prove that the reference in the {@link
        // TaskExecutorPartitionHandler} is the step configured inline
        TaskExecutorPartitionHandler taskExecutorPartitionHandler = accessPrivateField(partitionStep,
            "partitionHandler");
        TaskletStep taskletStep = accessPrivateField(taskExecutorPartitionHandler, "step");
View Full Code Here

    for (StepExecution se : jobExecution.getStepExecutions()) {
      String stepExecutionName = se.getStepName();
      if (stepExecutionName.equalsIgnoreCase("j4s1")) { // the partitioned
        // step
        PartitionStep partitionStep = (PartitionStep) this.applicationContext.getBean(stepExecutionName);

        // prove that the reference in the {@link
        // TaskExecutorPartitionHandler} is the step configured inline
        TaskExecutorPartitionHandler taskExecutorPartitionHandler = accessPrivateField(partitionStep,
            "partitionHandler");
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.partition.support.PartitionStep

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.