org.springframework.batch.item.support
Class CompositeItemWriter

java.lang.Object
  extended by org.springframework.batch.item.support.CompositeItemWriter
All Implemented Interfaces:
ItemWriter

public class CompositeItemWriter
extends Object
implements ItemWriter

Calls a collection of ItemWriters in fixed-order sequence.

Author:
Robert Kasanicky

Constructor Summary
CompositeItemWriter()
           
 
Method Summary
 void clear()
          Clear any buffers that are being held.
 void flush()
          Flush any buffers that are being held.
 void setDelegates(List delegates)
           
 void write(Object data)
          Calls injected ItemProcessors in order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeItemWriter

public CompositeItemWriter()
Method Detail

setDelegates

public void setDelegates(List delegates)

write

public void write(Object data)
           throws Exception
Calls injected ItemProcessors in order.

Specified by:
write in interface ItemWriter
Throws:
Exception - if there are errors. If the writer is used inside a retry or a batch the framework will catch the exception and convert or rethrow it as appropriate.

clear

public void clear()
           throws ClearFailedException
Description copied from interface: ItemWriter
Clear any buffers that are being held. This will usually be performed prior to rolling back any transactions.

Specified by:
clear in interface ItemWriter
Throws:
ClearFailedException - in case of an error. If this exception is thrown the writer may be in an inconsistent state and manual intervention might be required to reconcile the data with persistent output.

flush

public void flush()
           throws FlushFailedException
Description copied from interface: ItemWriter
Flush any buffers that are being held. This will usually be performed prior to committing any transactions.

Specified by:
flush in interface ItemWriter
Throws:
FlushFailedException - in case of an error. If this exception is thrown the writer may be in an inconsistent state and manual intervention might be required to reconcile the data with persistent output.


Copyright © 2008 SpringSource. All Rights Reserved.