public class TradeWriter extends ItemStreamSupport implements ItemWriter<Trade>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TOTAL_AMOUNT_KEY |
| Constructor and Description |
|---|
TradeWriter() |
| Modifier and Type | Method and Description |
|---|---|
java.math.BigDecimal |
getTotalPrice() |
void |
open(ExecutionContext executionContext)
No-op.
|
void |
setDao(TradeDao dao) |
void |
setFailingCustomers(java.util.List<java.lang.String> failingCustomers)
Public setter for the the customers on which failure should occur.
|
void |
update(ExecutionContext executionContext)
Return empty
ExecutionContext. |
void |
updateTotalPrice(java.util.List<Trade> trades) |
void |
write(java.util.List<? extends Trade> trades)
Process the supplied data element.
|
close, getExecutionContextKey, setExecutionContextName, setNamepublic static final java.lang.String TOTAL_AMOUNT_KEY
public void write(java.util.List<? extends Trade> trades)
ItemWriterwrite in interface ItemWriter<Trade>public void updateTotalPrice(java.util.List<Trade> trades)
public void open(ExecutionContext executionContext)
ItemStreamSupportopen in interface ItemStreamopen in class ItemStreamSupportItemStream.open(ExecutionContext)public void update(ExecutionContext executionContext)
ItemStreamSupportExecutionContext.update in interface ItemStreamupdate in class ItemStreamSupportexecutionContext - to be updatedItemStream.update(ExecutionContext)public java.math.BigDecimal getTotalPrice()
public void setDao(TradeDao dao)
public void setFailingCustomers(java.util.List<java.lang.String> failingCustomers)
failingCustomers - The customers to fail on