Package jakarta.batch.api.chunk
Interface CheckpointAlgorithm
-
- All Known Implementing Classes:
AbstractCheckpointAlgorithm
public interface CheckpointAlgorithmCheckpointAlgorithm provides a custom checkpoint policy for chunk steps.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbeginCheckpoint()The beginCheckpoint method is invoked before the next checkpoint interval begins (before the next chunk transaction begins).intcheckpointTimeout()The checkpointTimeout is invoked at the beginning of a new checkpoint interval for the purpose of establishing the checkpoint timeout.voidendCheckpoint()The endCheckpoint method is invoked after the last checkpoint is taken (after the chunk transaction is committed).booleanisReadyToCheckpoint()The isReadyToCheckpoint method is invoked by the batch runtime after each item is processed to determine if now is the time to checkpoint the current chunk.
-
-
-
Method Detail
-
checkpointTimeout
int checkpointTimeout() throws ExceptionThe 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 chunk transaction begins. This method returns an integer value, which is the timeout value (expressed in seconds) which will be used for the next chunk transaction. This method is useful to automate the setting of the checkpoint timeout based on factors known outside the job definition. A value of '0' signifies no maximum established by this CheckpointAlgorithm, i.e. the maximum permissible timeout allowed by the runtime environment.- Returns:
- the timeout interval (expressed in seconds) to use for the next checkpoint interval
- Throws:
Exception- thrown for any errors.
-
beginCheckpoint
void beginCheckpoint() throws ExceptionThe beginCheckpoint method is invoked before the next checkpoint interval begins (before the next chunk transaction begins).- Throws:
Exception- thrown for any errors.
-
isReadyToCheckpoint
boolean isReadyToCheckpoint() throws ExceptionThe isReadyToCheckpoint method is invoked by the batch runtime after each item is 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.
-
-