类 CheckpointAlgorithmAdapter
- java.lang.Object
- org.springframework.batch.jsr.repeat.CheckpointAlgorithmAdapter
- 所有已实现的接口:
CompletionPolicy
public class CheckpointAlgorithmAdapter extends java.lang.Object implements CompletionPolicy
Wrapper for theCheckpointAlgorithm
to be used via the rest of the framework.- 作者:
- Michael Minella
- 另请参阅:
CheckpointAlgorithm
,CompletionPolicy
构造器概要
构造器 构造器 说明 CheckpointAlgorithmAdapter(javax.batch.api.chunk.CheckpointAlgorithm policy)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
isComplete(RepeatContext context)
Allow policy to signal completion according to internal state, without having to wait for the callback to complete.boolean
isComplete(RepeatContext context, RepeatStatus result)
Determine whether a batch is complete given the latest result from the callback.RepeatContext
start(RepeatContext parent)
Create a new context for the execution of a batch.void
update(RepeatContext context)
IfCheckpointAlgorithm.isReadyToCheckpoint()
is true we will callCheckpointAlgorithm.endCheckpoint()
构造器详细资料
CheckpointAlgorithmAdapter
public CheckpointAlgorithmAdapter(javax.batch.api.chunk.CheckpointAlgorithm policy)
方法详细资料
isComplete
public boolean isComplete(RepeatContext context, RepeatStatus result)
从接口复制的说明:CompletionPolicy
Determine whether a batch is complete given the latest result from the callback. If this method returns true thenCompletionPolicy.isComplete(RepeatContext)
should also (but not necessarily vice versa, since the answer here depends on the result).- 指定者:
isComplete
在接口中CompletionPolicy
- 参数:
context
- the current batch context.result
- the result of the latest batch item processing.- 返回:
- true if the batch should terminate.
- 另请参阅:
CompletionPolicy.isComplete(RepeatContext)
isComplete
public boolean isComplete(RepeatContext context)
从接口复制的说明:CompletionPolicy
Allow policy to signal completion according to internal state, without having to wait for the callback to complete.- 指定者:
isComplete
在接口中CompletionPolicy
- 参数:
context
- the current batch context.- 返回:
- true if the batch should terminate.
start
public RepeatContext start(RepeatContext parent)
从接口复制的说明:CompletionPolicy
Create a new context for the execution of a batch. N.B. implementations should not return the parent from this method - they must create a new context to meet the specific needs of the policy. The best way to do this might be to override an existing implementation and use theRepeatContext
to store state in its attributes.- 指定者:
start
在接口中CompletionPolicy
- 参数:
parent
- the current context if one is already in progress.- 返回:
- a context object that can be used by the implementation to store internal state for a batch.
update
public void update(RepeatContext context)
IfCheckpointAlgorithm.isReadyToCheckpoint()
is true we will callCheckpointAlgorithm.endCheckpoint()
- 指定者:
update
在接口中CompletionPolicy
- 参数:
context
- aRepeatContext