Package org.springframework.batch.item
Interface ItemStream
- All Known Subinterfaces:
ItemStreamReader<T>
,ItemStreamWriter<T>
,ResourceAwareItemReaderItemStream<T>
,ResourceAwareItemWriterItemStream<T>
- All Known Implementing Classes:
AbstractCursorItemReader
,AbstractFileItemWriter
,AbstractItemCountingItemStreamItemReader
,AbstractItemStreamItemReader
,AbstractItemStreamItemWriter
,AbstractPaginatedDataItemReader
,AbstractPagingItemReader
,AsyncItemWriter
,AvroItemReader
,AvroItemWriter
,ChunkMessageChannelItemWriter
,ChunkMonitor
,CompositeItemStream
,CompositeItemWriter
,FlatFileItemReader
,FlatFileItemWriter
,HibernateCursorItemReader
,HibernatePagingItemReader
,ItemStreamSupport
,JdbcCursorItemReader
,JdbcPagingItemReader
,JpaCursorItemReader
,JpaPagingItemReader
,JsonFileItemWriter
,JsonItemReader
,KafkaItemReader
,LdifReader
,MappingLdifReader
,MongoItemReader
,MultiResourceItemReader
,MultiResourceItemWriter
,Neo4jItemReader
,RepositoryItemReader
,ResourcesItemReader
,SingleItemPeekableItemReader
,StaxEventItemReader
,StaxEventItemWriter
,StoredProcedureItemReader
,SynchronizedItemStreamReader
,SynchronizedItemStreamWriter
public interface ItemStream
Marker interface defining a contract for periodically storing state and restoring from that state should an error occur.
- Author:
- Dave Syer, Lucas Ward, Mahmoud Ben Hassine
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
If any resources are needed for the stream to operate they need to be destroyed here.default void
open
(ExecutionContext executionContext) Open the stream for the providedExecutionContext
.default void
update
(ExecutionContext executionContext) Indicates that the execution context provided during open is about to be saved.
-
Method Details
-
open
Open the stream for the providedExecutionContext
.- Parameters:
executionContext
- current step'sExecutionContext
. Will be the executionContext from the last run of the step on a restart.- Throws:
IllegalArgumentException
- if context is nullItemStreamException
-
update
Indicates that the execution context provided during open is about to be saved. If any state is remaining, but has not been put in the context, it should be added here.- Parameters:
executionContext
- to be updated- Throws:
IllegalArgumentException
- if executionContext is null.ItemStreamException
-
close
If any resources are needed for the stream to operate they need to be destroyed here. Once this method has been called all other methods (except open) may throw an exception.- Throws:
ItemStreamException
-