Class SimpleCommandLineArgsProvider

java.lang.Object
org.springframework.cloud.task.batch.partition.SimpleCommandLineArgsProvider
All Implemented Interfaces:
CommandLineArgsProvider, TaskExecutionListener

public class SimpleCommandLineArgsProvider extends Object implements CommandLineArgsProvider, TaskExecutionListener
Returns any command line arguments used with the TaskExecution provided appended with any additional arguments configured.
Since:
1.1.0
Author:
Michael Minella, Glenn Renfro
  • Constructor Details

    • SimpleCommandLineArgsProvider

      public SimpleCommandLineArgsProvider()
    • SimpleCommandLineArgsProvider

      public SimpleCommandLineArgsProvider(TaskExecution taskExecution)
      Parameters:
      taskExecution - task execution
  • Method Details

    • onTaskStartup

      public void onTaskStartup(TaskExecution taskExecution)
      Description copied from interface: TaskExecutionListener
      Invoked after the TaskExecution has been stored in the TaskRepository.
      Specified by:
      onTaskStartup in interface TaskExecutionListener
      Parameters:
      taskExecution - instance containing the information about the current task.
    • setAppendedArgs

      public void setAppendedArgs(List<String> appendedArgs)
      Additional command line args to be appended.
      Parameters:
      appendedArgs - list of arguments
      Since:
      1.2
    • getCommandLineArgs

      public List<String> getCommandLineArgs(org.springframework.batch.item.ExecutionContext executionContext)
      Description copied from interface: CommandLineArgsProvider
      Returns a unique list of command line arguements to be passed to the partition's worker for the specified ExecutionContext. Note: This method is called once per partition.
      Specified by:
      getCommandLineArgs in interface CommandLineArgsProvider
      Parameters:
      executionContext - the unique state for the step to be executed.
      Returns:
      a list of formatted command line arguments to be passed to the worker (the list will be joined via spaces).