class StepExecutionSimpleCompletionPolicy implements StepExecutionListener, CompletionPolicy {

	private CompletionPolicy delegate;

	private String keyName = "commit.interval";

	/**
	 * Public setter for the key name of a Long value in the {@link JobParameters} that
	 * will contain a commit interval. Defaults to "commit.interval".
	 * @param keyName the keyName to set
	 */
	public void setKeyName(String keyName) {
		this.keyName = keyName;
	}

	/**
	 * Set up a {@link SimpleCompletionPolicy} with a commit interval taken from the
	 * {@link JobParameters}. If there is a Long parameter with the given key name, the
	 * intValue of this parameter is used. If not an exception will be thrown.
	 *
	 * @see org.springframework.batch.core.StepExecutionListener#beforeStep(org.springframework.batch.core.StepExecution)
	 */
	@Override
	public void beforeStep(StepExecution stepExecution) {
		JobParameters jobParameters = stepExecution.getJobParameters();
		Assert.state(jobParameters.getParameters().containsKey(keyName),
				"JobParameters do not contain Long parameter with key=[" + keyName + "]");
		delegate = new SimpleCompletionPolicy(jobParameters.getLong(keyName).intValue());
	}

	/**
	 * @return true if the commit interval has been reached or the result indicates
	 * completion
	 * @see CompletionPolicy#isComplete(RepeatContext, RepeatStatus)
	 */
	@Override
	public boolean isComplete(RepeatContext context, RepeatStatus result) {
		Assert.state(delegate != null, "The delegate resource has not been initialised. "
				+ "Remember to register this object as a StepListener.");
		return delegate.isComplete(context, result);
	}

	/**
	 * @return if the commit interval has been reached
	 * @see org.springframework.batch.repeat.CompletionPolicy#isComplete(org.springframework.batch.repeat.RepeatContext)
	 */
	@Override
	public boolean isComplete(RepeatContext context) {
		Assert.state(delegate != null, "The delegate resource has not been initialised. "
				+ "Remember to register this object as a StepListener.");
		return delegate.isComplete(context);
	}

	/**
	 * @return a new {@link RepeatContext}
	 * @see org.springframework.batch.repeat.CompletionPolicy#start(org.springframework.batch.repeat.RepeatContext)
	 */
	@Override
	public RepeatContext start(RepeatContext parent) {<FILL_FUNCTION_BODY>}

	/**
	 * @see org.springframework.batch.repeat.CompletionPolicy#update(org.springframework.batch.repeat.RepeatContext)
	 */
	@Override
	public void update(RepeatContext context) {
		Assert.state(delegate != null, "The delegate resource has not been initialised. "
				+ "Remember to register this object as a StepListener.");
		delegate.update(context);
	}

	/**
	 * Delegates to the wrapped {@link CompletionPolicy} if set, otherwise returns the
	 * value of {@link #setKeyName(String)}.
	 */
	@Override
	public String toString() {
		return (delegate == null) ? keyName : delegate.toString();
	}

}

		Assert.state(delegate != null, "The delegate resource has not been initialised. "
				+ "Remember to register this object as a StepListener.");
		return delegate.start(parent);
	
<no_super_class>