Package javax.batch.api.chunk
Interface CheckpointAlgorithm
- All Known Implementing Classes:
AbstractCheckpointAlgorithm
public interface CheckpointAlgorithm
CheckpointAlgorithm provides a custom checkpoint
policy for chunk steps.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
The beginCheckpoint method is invoked before the next checkpoint interval begins.int
The checkpointTimeout is invoked at the beginning of a new checkpoint interval for the purpose of establishing the checkpoint timeout.void
The endCheckpoint method is invoked after the current checkpoint ends.boolean
The isReadyToCheckpoint method is invoked by the batch runtime after each item processed to determine if now is the time to checkpoint the current chunk.
-
Method Details
-
checkpointTimeout
The checkpointTimeout is invoked at the beginning of a new checkpoint interval for the purpose of establishing the checkpoint timeout. It is invoked before the next checkpoint transaction begins. This method returns an integer value, which is the timeout value that will be used for the next checkpoint transaction. This method is useful to automate the setting of the checkpoint timeout based on factors known outside the job * definition.- Parameters:
timeout
- specifies the checkpoint timeout value for the * next checkpoint interval.- Returns:
- the timeout interval to use for the next checkpoint interval
- Throws:
Exception
- thrown for any errors.
-
beginCheckpoint
The beginCheckpoint method is invoked before the next checkpoint interval begins.- Throws:
Exception
- thrown for any errors.
-
isReadyToCheckpoint
The isReadyToCheckpoint method is invoked by the batch runtime after each item processed to determine if now is the time to checkpoint the current chunk.- Returns:
- boolean indicating whether or not to checkpoint now.
- Throws:
Exception
- thrown for any errors.
-
endCheckpoint
The endCheckpoint method is invoked after the current checkpoint ends.- Throws:
Exception
- thrown for any errors.
-