class CompositeItemWriter<T> implements ItemStreamWriter<T>, InitializingBean {

	private List<ItemWriter<? super T>> delegates;

	private boolean ignoreItemStream = false;

	/**
	 * Default constructor
	 */
	public CompositeItemWriter() {

	}

	/**
	 * Convenience constructor for setting the delegates.
	 * @param delegates the list of delegates to use.
	 */
	public CompositeItemWriter(List<ItemWriter<? super T>> delegates) {
		setDelegates(delegates);
	}

	/**
	 * Convenience constructor for setting the delegates.
	 * @param delegates the array of delegates to use.
	 */
	@SafeVarargs
	public CompositeItemWriter(ItemWriter<? super T>... delegates) {
		this(Arrays.asList(delegates));
	}

	/**
	 * Establishes the policy whether to call the open, close, or update methods for the
	 * item writer delegates associated with the CompositeItemWriter.
	 * @param ignoreItemStream if false the delegates' open, close, or update methods will
	 * be called when the corresponding methods on the CompositeItemWriter are called. If
	 * true the delegates' open, close, nor update methods will not be called (default is
	 * false).
	 */
	public void setIgnoreItemStream(boolean ignoreItemStream) {
		this.ignoreItemStream = ignoreItemStream;
	}

	@Override
	public void write(Chunk<? extends T> chunk) throws Exception {
		for (ItemWriter<? super T> writer : delegates) {
			writer.write(chunk);
		}
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		Assert.state(delegates != null, "The 'delegates' may not be null");
		Assert.state(!delegates.isEmpty(), "The 'delegates' may not be empty");
	}

	/**
	 * The list of item writers to use as delegates. Items are written to each of the
	 * delegates.
	 * @param delegates the list of delegates to use. The delegates list must not be null
	 * nor be empty.
	 */
	public void setDelegates(List<ItemWriter<? super T>> delegates) {
		this.delegates = delegates;
	}

	@Override
	public void close() throws ItemStreamException {
		for (ItemWriter<? super T> writer : delegates) {
			if (!ignoreItemStream && (writer instanceof ItemStream)) {
				((ItemStream) writer).close();
			}
		}
	}

	@Override
	public void open(ExecutionContext executionContext) throws ItemStreamException {<FILL_FUNCTION_BODY>}

	@Override
	public void update(ExecutionContext executionContext) throws ItemStreamException {
		for (ItemWriter<? super T> writer : delegates) {
			if (!ignoreItemStream && (writer instanceof ItemStream)) {
				((ItemStream) writer).update(executionContext);
			}
		}
	}

}

		for (ItemWriter<? super T> writer : delegates) {
			if (!ignoreItemStream && (writer instanceof ItemStream)) {
				((ItemStream) writer).open(executionContext);
			}
		}
	
<no_super_class>