class JobParameterExecutionContextCopyListener implements StepExecutionListener {

	private Collection<String> keys = null;

	/**
	 * @param keys A list of keys corresponding to items in the {@link JobParameters} that
	 * should be copied.
	 */
	public void setKeys(String[] keys) {
		this.keys = Arrays.asList(keys);
	}

	/**
	 * Copy attributes from the {@link JobParameters} to the {@link Step}
	 * {@link ExecutionContext}, 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 the {@link JobParameters}.
	 */
	@Override
	public void beforeStep(StepExecution stepExecution) {<FILL_FUNCTION_BODY>}

}

		ExecutionContext stepContext = stepExecution.getExecutionContext();
		JobParameters jobParameters = stepExecution.getJobParameters();
		Collection<String> keys = this.keys;
		if (keys == null) {
			keys = jobParameters.getParameters().keySet();
		}
		for (String key : keys) {
			if (!stepContext.containsKey(key)) {
				stepContext.put(key, jobParameters.getParameters().get(key).getValue());
			}
		}
	
<no_super_class>