Class CompositeItemStream
java.lang.Object
org.springframework.batch.item.support.CompositeItemStream
- All Implemented Interfaces:
ItemStream
Simple
ItemStream that delegates to a list of other streams.- Author:
- Dave Syer, Mahmoud Ben Hassine, Elimelec Burghelea
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCompositeItemStream(List<ItemStream> streams) Convenience constructor for setting theItemStreams.CompositeItemStream(ItemStream... streams) Convenience constructor for setting theItemStreams. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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(List<ItemStream> streams) Public setter for theItemStreams.voidsetStreams(ItemStream[] streams) Public setter for theItemStreams.voidupdate(ExecutionContext executionContext) Simple aggregateExecutionContextprovider for the contributions registered under the given key.
-
Constructor Details
-
CompositeItemStream
public CompositeItemStream()Default constructor -
CompositeItemStream
Convenience constructor for setting theItemStreams.- Parameters:
streams-ListofItemStream.
-
CompositeItemStream
Convenience constructor for setting theItemStreams.- Parameters:
streams- array ofItemStream.
-
-
Method Details
-
setStreams
Public setter for theItemStreams.- Parameters:
streams-ListofItemStream.
-
setStreams
Public setter for theItemStreams.- Parameters:
streams- array ofItemStream.
-
register
Register aItemStreamas one of the interesting providers under the provided key.- Parameters:
stream- an instance ofItemStreamto be added to the list of streams.
-
update
Simple aggregateExecutionContextprovider for the contributions registered under the given key.- Specified by:
updatein interfaceItemStream- Parameters:
executionContext- to be updated- See Also:
-
close
Broadcast the call to close.- Specified by:
closein interfaceItemStream- Throws:
ItemStreamException- thrown if one of theItemStreams in the list fails to close. Original exceptions thrown by delegates are added as suppressed exceptions into this one, in the same order as delegates were registered.
-
open
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.
-