class AbstractPartitionHandler implements PartitionHandler {

	protected int gridSize = 1;

	/**
	 * Executes the specified {@link StepExecution} instances and returns an updated view
	 * of them. Throws an {@link Exception} if anything goes wrong.
	 * @param managerStepExecution the whole partition execution
	 * @param partitionStepExecutions the {@link StepExecution} instances to execute
	 * @return an updated view of these completed {@link StepExecution} instances
	 * @throws Exception if anything goes wrong. This allows implementations to be liberal
	 * and rely on the caller to translate an exception into a step failure as necessary.
	 */
	protected abstract Set<StepExecution> doHandle(StepExecution managerStepExecution,
			Set<StepExecution> partitionStepExecutions) throws Exception;

	/**
	 * @see PartitionHandler#handle(StepExecutionSplitter, StepExecution)
	 */
	@Override
	public Collection<StepExecution> handle(final StepExecutionSplitter stepSplitter,
			final StepExecution managerStepExecution) throws Exception {<FILL_FUNCTION_BODY>}

	/**
	 * Returns the number of step executions.
	 * @return the number of step executions
	 */
	public int getGridSize() {
		return gridSize;
	}

	/**
	 * Passed to the {@link StepExecutionSplitter} in the
	 * {@link #handle(StepExecutionSplitter, StepExecution)} method, instructing it how
	 * many {@link StepExecution} instances are required, ideally. The
	 * {@link StepExecutionSplitter} is allowed to ignore the grid size in the case of a
	 * restart, since the input data partitions must be preserved.
	 * @param gridSize the number of step executions that will be created
	 */
	public void setGridSize(int gridSize) {
		this.gridSize = gridSize;
	}

}

		final Set<StepExecution> stepExecutions = stepSplitter.split(managerStepExecution, gridSize);

		return doHandle(managerStepExecution, stepExecutions);
	
<no_super_class>