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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCommandLineArgs
(org.springframework.batch.item.ExecutionContext executionContext) Returns a unique list of command line arguements to be passed to the partition's worker for the specifiedExecutionContext
.void
onTaskStartup
(TaskExecution taskExecution) Invoked after theTaskExecution
has been stored in theTaskRepository
.void
setAppendedArgs
(List<String> appendedArgs) Additional command line args to be appended.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.cloud.task.listener.TaskExecutionListener
onTaskEnd, onTaskFailed
-
Constructor Details
-
SimpleCommandLineArgsProvider
public SimpleCommandLineArgsProvider() -
SimpleCommandLineArgsProvider
- Parameters:
taskExecution
- task execution
-
-
Method Details
-
onTaskStartup
Description copied from interface:TaskExecutionListener
Invoked after theTaskExecution
has been stored in theTaskRepository
.- Specified by:
onTaskStartup
in interfaceTaskExecutionListener
- Parameters:
taskExecution
- instance containing the information about the current task.
-
setAppendedArgs
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 specifiedExecutionContext
. Note: This method is called once per partition.- Specified by:
getCommandLineArgs
in interfaceCommandLineArgsProvider
- 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).
-