Class JobParameterExecutionContextCopyListener
java.lang.Object
org.springframework.batch.core.listener.JobParameterExecutionContextCopyListener
- All Implemented Interfaces:
StepExecutionListener,StepListener
public class JobParameterExecutionContextCopyListener
extends Object
implements StepExecutionListener
This class can be used to automatically copy items from the
JobParameters to
the Step ExecutionContext. A list of keys should be provided that
correspond to the items in the Step ExecutionContext that should be
copied.- Since:
- 2.0
- Author:
- Dave Syer, Mahmoud Ben Hassine
-
Constructor Details
-
JobParameterExecutionContextCopyListener
public JobParameterExecutionContextCopyListener()
-
-
Method Details
-
setKeys
- Parameters:
keys- A list of keys corresponding to items in theJobParametersthat should be copied.
-
beforeStep
Copy attributes from theJobParametersto theStepExecutionContext, if not already present. The key is already present we assume that a restart is in operation and the previous value is needed. If the provided keys are empty defaults to copy all keys in theJobParameters.- Specified by:
beforeStepin interfaceStepExecutionListener- Parameters:
stepExecution- instance ofStepExecution.
-