org.springframework.batch.core.step.item
Class ChunkMonitor
java.lang.Object
org.springframework.batch.item.ItemStreamSupport
org.springframework.batch.core.step.item.ChunkMonitor
- All Implemented Interfaces:
- ItemStream
public class ChunkMonitor
- extends ItemStreamSupport
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 co-ordinate between the caller
and the wrapped ItemStream.
- Since:
- 2.0
- Author:
- Dave Syer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChunkMonitor
public ChunkMonitor()
registerItemStream
public void registerItemStream(ItemStream stream)
- Parameters:
stream - the stream to set
setItemReader
public void setItemReader(ItemReader<?> reader)
- 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
public void close()
throws ItemStreamException
- Description copied from class:
ItemStreamSupport
- No-op.
- Specified by:
close in interface ItemStream- Overrides:
close in class ItemStreamSupport
- Throws:
ItemStreamException- See Also:
ItemStream.close()
open
public void open(ExecutionContext executionContext)
throws ItemStreamException
- Description copied from class:
ItemStreamSupport
- No-op.
- Specified by:
open in interface ItemStream- Overrides:
open in class ItemStreamSupport
- Throws:
ItemStreamException- See Also:
ItemStream.open(ExecutionContext)
update
public void update(ExecutionContext executionContext)
throws ItemStreamException
- Description copied from class:
ItemStreamSupport
- Return empty
ExecutionContext.
- Specified by:
update in interface ItemStream- Overrides:
update in class ItemStreamSupport
- Parameters:
executionContext - to be updated
- Throws:
ItemStreamException- See Also:
ItemStream.update(ExecutionContext)
Copyright © 2013 SpringSource. All Rights Reserved.