Class RemotePartitioningWorkerStepBuilder

java.lang.Object
org.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.StepBuilder>
org.springframework.batch.core.step.builder.StepBuilder
org.springframework.batch.integration.partition.RemotePartitioningWorkerStepBuilder

public class RemotePartitioningWorkerStepBuilder extends org.springframework.batch.core.step.builder.StepBuilder
Builder for a worker step in a remote partitioning setup. This builder creates an IntegrationFlow that:
  • listens to StepExecutionRequests coming from the manager on the input channel
  • invokes the StepExecutionRequestHandler to execute the worker step for each incoming request. The worker step is located using the provided StepLocator. If no StepLocator is provided, a BeanFactoryStepLocator configured with the current BeanFactory will be used
  • replies to the manager on the output channel (when the manager step is configured to aggregate replies from workers). If no output channel is provided, a NullChannel will be used (assuming the manager side is configured to poll the job repository for workers status)
Since:
4.1
Author:
Mahmoud Ben Hassine
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper

    org.springframework.batch.core.step.builder.StepBuilderHelper.CommonStepProperties
  • Field Summary

    Fields inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper

    properties
  • Constructor Summary

    Constructors
    Constructor
    Description
    RemotePartitioningWorkerStepBuilder(String name, org.springframework.batch.core.repository.JobRepository jobRepository)
    Initialize a step builder for a step with the given name.
  • Method Summary

    Modifier and Type
    Method
    Description
    allowStartIfComplete(boolean allowStartIfComplete)
     
    beanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
    Set the bean factory.
    <I,O> org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>
    chunk(int chunkSize, org.springframework.transaction.PlatformTransactionManager transactionManager)
     
    <I,O> org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>
    chunk(org.springframework.batch.infrastructure.repeat.CompletionPolicy completionPolicy, org.springframework.transaction.PlatformTransactionManager transactionManager)
    Deprecated, for removal: This API element is subject to removal in a future version.
    org.springframework.batch.core.step.builder.FlowStepBuilder
    flow(org.springframework.batch.core.job.flow.Flow flow)
     
    inputChannel(org.springframework.messaging.MessageChannel inputChannel)
    Set the input channel on which step execution requests sent by the manager are received.
    org.springframework.batch.core.step.builder.JobStepBuilder
    job(org.springframework.batch.core.job.Job job)
     
    listener(Object listener)
     
    listener(org.springframework.batch.core.listener.StepExecutionListener listener)
     
    outputChannel(org.springframework.messaging.MessageChannel outputChannel)
    Set the output channel on which replies will be sent to the manager step.
    org.springframework.batch.core.step.builder.PartitionStepBuilder
    partitioner(String stepName, org.springframework.batch.core.partition.Partitioner partitioner)
     
    org.springframework.batch.core.step.builder.PartitionStepBuilder
    partitioner(org.springframework.batch.core.step.Step step)
     
    startLimit(int startLimit)
     
    stepLocator(org.springframework.batch.core.step.StepLocator stepLocator)
    Set the step locator used to locate the worker step to execute.
    org.springframework.batch.core.step.builder.TaskletStepBuilder
    tasklet(org.springframework.batch.core.step.tasklet.Tasklet tasklet, org.springframework.transaction.PlatformTransactionManager transactionManager)
     

    Methods inherited from class org.springframework.batch.core.step.builder.StepBuilder

    chunk, self, tasklet

    Methods inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper

    enhance, getJobRepository, getName, isAllowStartIfComplete, observationRegistry

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RemotePartitioningWorkerStepBuilder

      public RemotePartitioningWorkerStepBuilder(String name, org.springframework.batch.core.repository.JobRepository jobRepository)
      Initialize a step builder for a step with the given name.
      Parameters:
      name - the name of the step
      jobRepository - the job repository to which the step should report to
      Since:
      5.0
  • Method Details

    • inputChannel

      public RemotePartitioningWorkerStepBuilder inputChannel(org.springframework.messaging.MessageChannel inputChannel)
      Set the input channel on which step execution requests sent by the manager are received.
      Parameters:
      inputChannel - the input channel
      Returns:
      this builder instance for fluent chaining
    • outputChannel

      public RemotePartitioningWorkerStepBuilder outputChannel(org.springframework.messaging.MessageChannel outputChannel)
      Set the output channel on which replies will be sent to the manager step.
      Parameters:
      outputChannel - the input channel
      Returns:
      this builder instance for fluent chaining
    • stepLocator

      public RemotePartitioningWorkerStepBuilder stepLocator(org.springframework.batch.core.step.StepLocator stepLocator)
      Set the step locator used to locate the worker step to execute.
      Parameters:
      stepLocator - the step locator to use
      Returns:
      this builder instance for fluent chaining
    • beanFactory

      public RemotePartitioningWorkerStepBuilder beanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
      Set the bean factory.
      Parameters:
      beanFactory - the bean factory
      Returns:
      this builder instance for fluent chaining
    • startLimit

      public RemotePartitioningWorkerStepBuilder startLimit(int startLimit)
      Overrides:
      startLimit in class org.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.StepBuilder>
    • listener

      public RemotePartitioningWorkerStepBuilder listener(Object listener)
      Overrides:
      listener in class org.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.StepBuilder>
    • listener

      public RemotePartitioningWorkerStepBuilder listener(org.springframework.batch.core.listener.StepExecutionListener listener)
      Overrides:
      listener in class org.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.StepBuilder>
    • allowStartIfComplete

      public RemotePartitioningWorkerStepBuilder allowStartIfComplete(boolean allowStartIfComplete)
      Overrides:
      allowStartIfComplete in class org.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.StepBuilder>
    • tasklet

      public org.springframework.batch.core.step.builder.TaskletStepBuilder tasklet(org.springframework.batch.core.step.tasklet.Tasklet tasklet, org.springframework.transaction.PlatformTransactionManager transactionManager)
      Overrides:
      tasklet in class org.springframework.batch.core.step.builder.StepBuilder
    • chunk

      public <I,O> org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O> chunk(int chunkSize, org.springframework.transaction.PlatformTransactionManager transactionManager)
      Overrides:
      chunk in class org.springframework.batch.core.step.builder.StepBuilder
    • chunk

      @Deprecated(since="6.0", forRemoval=true) public <I,O> org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O> chunk(org.springframework.batch.infrastructure.repeat.CompletionPolicy completionPolicy, org.springframework.transaction.PlatformTransactionManager transactionManager)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      chunk in class org.springframework.batch.core.step.builder.StepBuilder
    • partitioner

      public org.springframework.batch.core.step.builder.PartitionStepBuilder partitioner(String stepName, org.springframework.batch.core.partition.Partitioner partitioner)
      Overrides:
      partitioner in class org.springframework.batch.core.step.builder.StepBuilder
    • partitioner

      public org.springframework.batch.core.step.builder.PartitionStepBuilder partitioner(org.springframework.batch.core.step.Step step)
      Overrides:
      partitioner in class org.springframework.batch.core.step.builder.StepBuilder
    • job

      public org.springframework.batch.core.step.builder.JobStepBuilder job(org.springframework.batch.core.job.Job job)
      Overrides:
      job in class org.springframework.batch.core.step.builder.StepBuilder
    • flow

      public org.springframework.batch.core.step.builder.FlowStepBuilder flow(org.springframework.batch.core.job.flow.Flow flow)
      Overrides:
      flow in class org.springframework.batch.core.step.builder.StepBuilder