org.springframework.batch.sample.support
Class RetrySampleItemWriter<T>

java.lang.Object
  extended by org.springframework.batch.sample.support.RetrySampleItemWriter<T>
All Implemented Interfaces:
ItemWriter<T>

public class RetrySampleItemWriter<T>
extends Object
implements ItemWriter<T>

Simulates temporary output trouble - requires to retry 3 times to pass successfully.

Author:
Robert Kasanicky

Constructor Summary
RetrySampleItemWriter()
           
 
Method Summary
 int getCounter()
           
 void write(List<? extends T> items)
          Process the supplied data element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetrySampleItemWriter

public RetrySampleItemWriter()
Method Detail

write

public void write(List<? extends T> items)
           throws Exception
Description copied from interface: ItemWriter
Process the supplied data element. Will not be called with any null items in normal operation.

Specified by:
write in interface ItemWriter<T>
Throws:
Exception - if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.

getCounter

public int getCounter()
Returns:
number of times write(List) method was called.


Copyright © 2009 SpringSource. All Rights Reserved.