org.springframework.batch.core
Interface ItemWriteListener

All Superinterfaces:
StepListener
All Known Implementing Classes:
CompositeItemWriteListener, DefaultItemFailureHandler, ItemListenerSupport, MulticasterBatchListener, StepListenerSupport

public interface ItemWriteListener
extends StepListener

Listener interface around the writing of an item.

Author:
Lucas Ward

Method Summary
 void afterWrite(Object item)
          Called after ItemWriter.write(Object) If the item is last in a chunk, this will be called before any transaction is committed, and before ChunkListener.afterChunk()
 void beforeWrite(Object item)
          Called before ItemWriter.write(Object)
 void onWriteError(Exception ex, Object item)
          Called if an error occurs while trying to write.
 

Method Detail

beforeWrite

void beforeWrite(Object item)
Called before ItemWriter.write(Object)

Parameters:
item - to be written

afterWrite

void afterWrite(Object item)
Called after ItemWriter.write(Object) If the item is last in a chunk, this will be called before any transaction is committed, and before ChunkListener.afterChunk()

Parameters:
item - written item

onWriteError

void onWriteError(Exception ex,
                  Object item)
Called if an error occurs while trying to write.

Parameters:
ex - thrown from ItemWriter
item - attempted to be written.


Copyright © 2008 SpringSource. All Rights Reserved.