class ExecutionContextPromotionListener implements StepExecutionListener, InitializingBean {

	private String[] keys = null;

	private String[] statuses = new String[] { ExitStatus.COMPLETED.getExitCode() };

	private boolean strict = false;

	@Nullable
	@Override
	public ExitStatus afterStep(StepExecution stepExecution) {
		ExecutionContext stepContext = stepExecution.getExecutionContext();
		ExecutionContext jobContext = stepExecution.getJobExecution().getExecutionContext();
		String exitCode = stepExecution.getExitStatus().getExitCode();
		for (String statusPattern : statuses) {
			if (PatternMatcher.match(statusPattern, exitCode)) {
				for (String key : keys) {
					if (stepContext.containsKey(key)) {
						jobContext.put(key, stepContext.get(key));
					}
					else {
						if (strict) {
							throw new IllegalArgumentException(
									"The key [" + key + "] was not found in the Step's ExecutionContext.");
						}
					}
				}
				break;
			}
		}

		return null;
	}

	@Override
	public void afterPropertiesSet() throws Exception {<FILL_FUNCTION_BODY>}

	/**
	 * @param keys A list of keys corresponding to items in the {@link Step}
	 * {@link ExecutionContext} that must be promoted.
	 */
	public void setKeys(String[] keys) {
		this.keys = keys;
	}

	/**
	 * @param statuses A list of statuses for which the promotion should occur. Statuses
	 * can may contain wildcards recognizable by a {@link PatternMatcher}.
	 */
	public void setStatuses(String[] statuses) {
		this.statuses = statuses;
	}

	/**
	 * If set to TRUE, the listener will throw an exception if any 'key' is not found in
	 * the Step {@link ExecutionContext}. FALSE by default.
	 * @param strict boolean the value of the flag.
	 */
	public void setStrict(boolean strict) {
		this.strict = strict;
	}

}

		Assert.state(this.keys != null, "The 'keys' property must be provided");
		Assert.state(!ObjectUtils.isEmpty(this.keys), "The 'keys' property must not be empty");
		Assert.state(this.statuses != null, "The 'statuses' property must be provided");
		Assert.state(!ObjectUtils.isEmpty(this.statuses), "The 'statuses' property must not be empty");
	
<no_super_class>