Class CompositeItemStream
- java.lang.Object
- org.springframework.batch.item.support.CompositeItemStream
- All Implemented Interfaces:
ItemStream
public class CompositeItemStream extends java.lang.Object implements ItemStream
SimpleItemStreamthat delegates to a list of other streams.- Author:
- Dave Syer
Constructor Summary
Constructors Constructor Description CompositeItemStream()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Broadcast the call to close.voidopen(ExecutionContext executionContext)Broadcast the call to open.voidregister(ItemStream stream)Register aItemStreamas one of the interesting providers under the provided key.voidsetStreams(ItemStream[] streams)Public setter for theItemStreams.voidupdate(ExecutionContext executionContext)Simple aggregateExecutionContextprovider for the contributions registered under the given key.
Method Detail
setStreams
public void setStreams(ItemStream[] streams)
Public setter for theItemStreams.- Parameters:
streams- array ofItemStream.
register
public void register(ItemStream stream)
Register aItemStreamas one of the interesting providers under the provided key.- Parameters:
stream- an instance ofItemStreamto be added to the list of streams.
update
public void update(ExecutionContext executionContext)
Simple aggregateExecutionContextprovider for the contributions registered under the given key.- Specified by:
updatein interfaceItemStream- Parameters:
executionContext- to be updated- See Also:
ItemStream.update(ExecutionContext)
close
public void close() throws ItemStreamExceptionBroadcast the call to close.- Specified by:
closein interfaceItemStream- Throws:
ItemStreamException- thrown if one of theItemStreams in the list fails to close. This is a sequential operation so all itemStreams in the list after the one that failed to close will remain open.
open
public void open(ExecutionContext executionContext) throws ItemStreamException
Broadcast the call to open.- Specified by:
openin interfaceItemStream- Parameters:
executionContext- current step'sExecutionContext. Will be the executionContext from the last run of the step on a restart.- Throws:
ItemStreamException- thrown if one of theItemStreams in the list fails to open. This is a sequential operation so all itemStreams in the list after the one that failed to open will not be opened.