类 RepeatContextCounter
- java.lang.Object
- org.springframework.batch.repeat.context.RepeatContextCounter
public class RepeatContextCounter extends java.lang.Object
Helper class for policies that need to count the number of occurrences of some event (e.g. an exception type in the context) in the scope of a batch. The value of the counter can be stored between batches in a nested context, so that the termination decision is based on the aggregate of a number of sibling batches.- 作者:
- Dave Syer
构造器概要
构造器 构造器 说明 RepeatContextCounter(RepeatContext context, java.lang.String countKey)
Convenience constructor with useParent=false.RepeatContextCounter(RepeatContext context, java.lang.String countKey, boolean useParent)
Construct a newRepeatContextCounter
.
构造器详细资料
RepeatContextCounter
public RepeatContextCounter(RepeatContext context, java.lang.String countKey)
Convenience constructor with useParent=false.- 参数:
context
- the current context.countKey
- the key to use to store the counter in the context.
RepeatContextCounter
public RepeatContextCounter(RepeatContext context, java.lang.String countKey, boolean useParent)
Construct a newRepeatContextCounter
.- 参数:
context
- the current context.countKey
- the key to use to store the counter in the context.useParent
- true if the counter is to be shared between siblings. The state will be stored in the parent of the context (if it exists) instead of the context itself.