org.springframework.batch.core.jsr.partition

## Class JsrStepExecutionSplitter

- java.lang.Object
- - org.springframework.batch.core.partition.support.SimpleStepExecutionSplitter
  - - org.springframework.batch.core.jsr.partition.JsrStepExecutionSplitter

- All Implemented Interfaces:
    StepExecutionSplitter, org.springframework.beans.factory.InitializingBean

      public class JsrStepExecutionSplitter
      extends SimpleStepExecutionSplitter

  Provides JSR-352 specific behavior for the splitting of `StepExecution`s.
  Since:
    3.0
  Author:
    Michael Minella

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JsrStepExecutionSplitter(JobRepository jobRepository, boolean allowStartIfComplete, java.lang.String stepName, boolean restoreState)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getStepName()` The name of the step configuration that will be executed remotely.
    `java.util.Set<StepExecution>` | `split(StepExecution stepExecution, int gridSize)` Returns the same number of `StepExecution`s as the gridSize specifies.

    - ### Methods inherited from class org.springframework.batch.core.partition.support.SimpleStepExecutionSplitter

      `afterPropertiesSet, getStartable, setAllowStartIfComplete, setJobRepository, setPartitioner, setStepName`

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

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

- - ### Constructor Detail

    - #### JsrStepExecutionSplitter

          public JsrStepExecutionSplitter(JobRepository jobRepository,
                                          boolean allowStartIfComplete,
                                          java.lang.String stepName,
                                          boolean restoreState)

  - ### Method Detail

    - #### getStepName

          public java.lang.String getStepName()

      Description copied from interface: `StepExecutionSplitter`
      The name of the step configuration that will be executed remotely. Remote workers are going to execute a the same step for each execution context in the partition.
      Specified by:
        `getStepName` in interface `StepExecutionSplitter`
      Overrides:
        `getStepName` in class `SimpleStepExecutionSplitter`
      Returns:
        the name of the step that will execute the business logic
      See Also:
        `StepExecutionSplitter.getStepName()`

    - #### split

          public java.util.Set<StepExecution> split(StepExecution stepExecution,
                                                    int gridSize)
                                             throws JobExecutionException

      Returns the same number of `StepExecution`s as the gridSize specifies. Each of the child StepExecutions will not be available via the `JsrJobOperator` per JSR-352.
      Specified by:
        `split` in interface `StepExecutionSplitter`
      Overrides:
        `split` in class `SimpleStepExecutionSplitter`
      Parameters:
        `stepExecution` - the `StepExecution` to be partitioned.
        `gridSize` - a hint for the splitter if the size of the grid is known
      Returns:
        a set of `StepExecution` instances for remote processing
      Throws:
        `JobExecutionException` - if the split cannot be made
      See Also:
        https://java.net/projects/jbatch/lists/public/archive/2013-10/message/10