org.springframework.batch.sample.domain.trade.internal
Class TradeWriter
java.lang.Object
org.springframework.batch.item.ItemStreamSupport
org.springframework.batch.sample.domain.trade.internal.TradeWriter
- All Implemented Interfaces:
- ItemStream, ItemWriter<Trade>
public class TradeWriter
- extends ItemStreamSupport
- implements ItemWriter<Trade>
Delegates the actual writing to custom DAO delegate. Allows configurable
exception raising for testing skip and restart.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TOTAL_AMOUNT_KEY
public static final String TOTAL_AMOUNT_KEY
- See Also:
- Constant Field Values
TradeWriter
public TradeWriter()
write
public void write(List<? extends Trade> trades)
- 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<Trade>
updateTotalPrice
public void updateTotalPrice(List<Trade> trades)
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)
- Description copied from class:
ItemStreamSupport
- Return empty
ExecutionContext.
- Specified by:
update in interface ItemStream- Overrides:
update in class ItemStreamSupport
- Parameters:
executionContext - to be updated- See Also:
ItemStream.update(ExecutionContext)
getTotalPrice
public BigDecimal getTotalPrice()
setDao
public void setDao(TradeDao dao)
setFailingCustomers
public void setFailingCustomers(List<String> failingCustomers)
- Public setter for the the customers on which failure should occur.
- Parameters:
failingCustomers - The customers to fail on
Copyright © 2011 SpringSource. All Rights Reserved.