类 TradeWriter
- java.lang.Object
- org.springframework.batch.item.ItemStreamSupport
- org.springframework.batch.sample.domain.trade.internal.TradeWriter
- 所有已实现的接口:
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.
字段概要
字段 修饰符和类型 字段 说明 static java.lang.String
TOTAL_AMOUNT_KEY
构造器概要
构造器 构造器 说明 TradeWriter()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 emptyExecutionContext
.void
updateTotalPrice(java.util.List<Trade> trades)
void
write(java.util.List<? extends Trade> trades)
Process the supplied data element.从类继承的方法 org.springframework.batch.item.ItemStreamSupport
close, getExecutionContextKey, setExecutionContextName, setName
字段详细资料
TOTAL_AMOUNT_KEY
public static final java.lang.String TOTAL_AMOUNT_KEY
- 另请参阅:
- 常量字段值
构造器详细资料
TradeWriter
public TradeWriter()
方法详细资料
write
public void write(java.util.List<? extends Trade> trades)
从接口复制的说明:ItemWriter
Process the supplied data element. Will not be called with any null items in normal operation.- 指定者:
write
在接口中ItemWriter<Trade>
- 参数:
trades
- items to be written
updateTotalPrice
public void updateTotalPrice(java.util.List<Trade> trades)
open
public void open(ExecutionContext executionContext)
从类复制的说明:ItemStreamSupport
No-op.- 指定者:
open
在接口中ItemStream
- 覆盖:
open
在类中ItemStreamSupport
- 参数:
executionContext
- current step'sExecutionContext
. Will be the executionContext from the last run of the step on a restart.- 另请参阅:
ItemStream.open(ExecutionContext)
update
public void update(ExecutionContext executionContext)
从类复制的说明:ItemStreamSupport
Return emptyExecutionContext
.- 指定者:
update
在接口中ItemStream
- 覆盖:
update
在类中ItemStreamSupport
- 参数:
executionContext
- to be updated- 另请参阅:
ItemStream.update(ExecutionContext)
getTotalPrice
public java.math.BigDecimal getTotalPrice()
setFailingCustomers
public void setFailingCustomers(java.util.List<java.lang.String> failingCustomers)
Public setter for the the customers on which failure should occur.- 参数:
failingCustomers
- The customers to fail on