Class ChunkMonitor
java.lang.Object
org.springframework.batch.item.ItemStreamSupport
org.springframework.batch.core.step.item.ChunkMonitor
- All Implemented Interfaces:
ItemStream
Manage the offset data between the last successful commit and updates made to an input
chunk. Only works with single threaded steps because it has to use a
ThreadLocal to manage the state and coordinate between the caller and the
wrapped ItemStream.- Since:
- 2.0
- Author:
- Dave Syer, Mahmoud Ben Hassine
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intvoidvoidopen(ExecutionContext executionContext) voidregisterItemStream(ItemStream stream) voidvoidsetChunkSize(int chunkSize) voidsetItemReader(ItemReader<?> reader) voidupdate(ExecutionContext executionContext) Methods inherited from class org.springframework.batch.item.ItemStreamSupport
getExecutionContextKey, getName, setExecutionContextName, setName
-
Constructor Details
-
ChunkMonitor
public ChunkMonitor()
-
-
Method Details
-
registerItemStream
- Parameters:
stream- the stream to set
-
setItemReader
- Parameters:
reader- the reader to set
-
incrementOffset
public void incrementOffset() -
getOffset
public int getOffset() -
resetOffset
public void resetOffset() -
setChunkSize
public void setChunkSize(int chunkSize) -
close
- Specified by:
closein interfaceItemStream- Overrides:
closein classItemStreamSupport- Throws:
ItemStreamException
-
open
- Specified by:
openin interfaceItemStream- Overrides:
openin classItemStreamSupport- Throws:
ItemStreamException
-
update
- Specified by:
updatein interfaceItemStream- Overrides:
updatein classItemStreamSupport- Throws:
ItemStreamException
-