Top Description Methods
jakarta.batch.api.chunk

public Interface CheckpointAlgorithm

Known Direct Implementers
jakarta.batch.api.chunk.AbstractCheckpointAlgorithm

CheckpointAlgorithm provides a custom checkpoint policy for chunk steps.

Method Summary

Modifier and TypeMethod and Description
public void
beginCheckpoint()

The beginCheckpoint method is invoked before the next checkpoint interval begins (before the next chunk transaction begins).

public int

Returns:

the timeout interval (expressed in seconds) to use for the next checkpoint interval
checkpointTimeout
()

The checkpointTimeout is invoked at the beginning of a new checkpoint interval for the purpose of establishing the checkpoint timeout.

public void
endCheckpoint()

The endCheckpoint method is invoked after the last checkpoint is taken (after the chunk transaction is committed).

public boolean

Returns:

boolean indicating whether or not to checkpoint now.
isReadyToCheckpoint
()

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

beginCheckpointback to summary
public void beginCheckpoint() throws Exception

The beginCheckpoint method is invoked before the next checkpoint interval begins (before the next chunk transaction begins).

Exceptions
Exception:
thrown for any errors.
checkpointTimeoutback to summary
public int checkpointTimeout() throws Exception

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 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:int

the timeout interval (expressed in seconds) to use for the next checkpoint interval

Exceptions
Exception:
thrown for any errors.
endCheckpointback to summary
public void endCheckpoint() throws Exception

The endCheckpoint method is invoked after the last checkpoint is taken (after the chunk transaction is committed).

Exceptions
Exception:
thrown for any errors.
isReadyToCheckpointback to summary
public boolean isReadyToCheckpoint() throws Exception

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.

Returns:boolean

boolean indicating whether or not to checkpoint now.

Exceptions
Exception:
thrown for any errors.