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
-
Constructor Summary
ConstructorDescriptionDefault constructorCompositeItemStream
(List<ItemStream> streams) Convenience constructor for setting theItemStream
s.CompositeItemStream
(ItemStream... streams) Convenience constructor for setting theItemStream
s. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Broadcast the call to close.void
open
(ExecutionContext executionContext) Broadcast the call to open.void
register
(ItemStream stream) Register aItemStream
as one of the interesting providers under the provided key.void
setStreams
(List<ItemStream> streams) Public setter for theItemStream
s.void
setStreams
(ItemStream[] streams) Public setter for theItemStream
s.void
update
(ExecutionContext executionContext) Simple aggregateExecutionContext
provider for the contributions registered under the given key.
-
Constructor Details
-
CompositeItemStream
public CompositeItemStream()Default constructor -
CompositeItemStream
Convenience constructor for setting theItemStream
s.- Parameters:
streams
-List
ofItemStream
.
-
CompositeItemStream
Convenience constructor for setting theItemStream
s.- Parameters:
streams
- array ofItemStream
.
-
-
Method Details
-
setStreams
Public setter for theItemStream
s.- Parameters:
streams
-List
ofItemStream
.
-
setStreams
Public setter for theItemStream
s.- Parameters:
streams
- array ofItemStream
.
-
register
Register aItemStream
as one of the interesting providers under the provided key.- Parameters:
stream
- an instance ofItemStream
to be added to the list of streams.
-
update
Simple aggregateExecutionContext
provider for the contributions registered under the given key.- Specified by:
update
in interfaceItemStream
- Parameters:
executionContext
- to be updated- See Also:
-
close
Broadcast the call to close.- Specified by:
close
in interfaceItemStream
- Throws:
ItemStreamException
- thrown if one of theItemStream
s 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
Broadcast the call to open.- Specified by:
open
in 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 theItemStream
s 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.
-