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 ofStepExecution
s.- Since:
- 3.0
- Author:
- Michael Minella
Constructor Summary
Constructors Constructor Description JsrStepExecutionSplitter(JobRepository jobRepository, boolean allowStartIfComplete, java.lang.String stepName, boolean restoreState)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 ofStepExecution
s as the gridSize specifies.Methods inherited from class org.springframework.batch.core.partition.support.SimpleStepExecutionSplitter
afterPropertiesSet, getStartable, isStartable, setAllowStartIfComplete, setJobRepository, setPartitioner, setStepName
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 interfaceStepExecutionSplitter
- Overrides:
getStepName
in classSimpleStepExecutionSplitter
- 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 ofStepExecution
s as the gridSize specifies. Each of the child StepExecutions will not be available via theJsrJobOperator
per JSR-352.- Specified by:
split
in interfaceStepExecutionSplitter
- Overrides:
split
in classSimpleStepExecutionSplitter
- Parameters:
stepExecution
- theStepExecution
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