org.springframework.batch.core.step.item
Class ChunkMonitor

java.lang.Object
  extended by org.springframework.batch.item.ItemStreamSupport
      extended by 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

Nested Class Summary
static class ChunkMonitor.ChunkMonitorData
           
 
Constructor Summary
ChunkMonitor()
           
 
Method Summary
 void close()
          No-op.
 int getOffset()
           
 void incrementOffset()
           
 void open(ExecutionContext executionContext)
          No-op.
 void registerItemStream(ItemStream stream)
           
 void resetOffset()
           
 void setChunkSize(int chunkSize)
           
 void setItemReader(ItemReader<?> reader)
           
 void update(ExecutionContext executionContext)
          Return empty ExecutionContext.
 
Methods inherited from class org.springframework.batch.item.ItemStreamSupport
getExecutionContextKey, setExecutionContextName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChunkMonitor

public ChunkMonitor()
Method Detail

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.