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
Constructors -
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.voidonTaskStartup(TaskExecution taskExecution) Invoked after theTaskExecutionhas been stored in theTaskRepository.voidsetAppendedArgs(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, waitMethods 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:TaskExecutionListenerInvoked after theTaskExecutionhas been stored in theTaskRepository.- Specified by:
onTaskStartupin 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:CommandLineArgsProviderReturns 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:
getCommandLineArgsin 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).
-