Interface Step

All Known Subinterfaces:
StoppableStep
All Known Implementing Classes:
AbstractStep, ChunkOrientedStep, FlowStep, JobStep, PartitionStep, RemoteStep, TaskletStep
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Step
Batch domain interface representing the configuration of a step. As with a Job, a Step is meant to explicitly represent the configuration of a step by a developer but also the ability to execute the step.
Author:
Dave Syer, Mahmoud Ben Hassine
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The key to use when retrieving the batch step type.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(StepExecution stepExecution)
    Process the step and assign progress and status meta information to the StepExecution provided.
    default String
    The name of the step.
    default int
     
    default boolean
     
  • Field Details

    • STEP_TYPE_KEY

      static final String STEP_TYPE_KEY
      The key to use when retrieving the batch step type.
      See Also:
  • Method Details

    • getName

      default String getName()
      The name of the step. This is used to distinguish between different steps and must be unique within a job. If not explicitly set, the name will default to the fully qualified class name.
      Returns:
      the name of the step (never null)
    • isAllowStartIfComplete

      default boolean isAllowStartIfComplete()
      Returns:
      true if a step that is already marked as complete can be started again. Defaults to false.
    • getStartLimit

      default int getStartLimit()
      Returns:
      the number of times a step can be (re)started for the same job instance. Defaults to Integer.MAX_VALUE
    • execute

      void execute(StepExecution stepExecution) throws JobInterruptedException
      Process the step and assign progress and status meta information to the StepExecution provided. The Step is responsible for setting the meta information and also saving it, if required by the implementation.
      It is not safe to reuse an instance of Step to process multiple concurrent executions.
      Parameters:
      stepExecution - an entity representing the step to be executed.
      Throws:
      JobInterruptedException - if the step is interrupted externally.