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, setName
public static final java.lang.String TOTAL_AMOUNT_KEY
public void write(java.util.List<? extends Trade> trades)
ItemWriter
write
in interface ItemWriter<Trade>
trades
- items to be writtenpublic void updateTotalPrice(java.util.List<Trade> trades)
public void open(ExecutionContext executionContext)
ItemStreamSupport
open
in interface ItemStream
open
in class ItemStreamSupport
executionContext
- current step's ExecutionContext
. Will be the
executionContext from the last run of the step on a restart.ItemStream.open(ExecutionContext)
public void update(ExecutionContext executionContext)
ItemStreamSupport
ExecutionContext
.update
in interface ItemStream
update
in class ItemStreamSupport
executionContext
- 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