com.ibm.wsspi.batch
Interface CheckpointPolicyAlgorithm
-
- All Superinterfaces:
- com.ibm.batch.spi.CheckpointPolicyAlgorithm
public interface CheckpointPolicyAlgorithm extends com.ibm.batch.spi.CheckpointPolicyAlgorithmCheckPointPolicy algorithms determine when a Batch Execution Environment commits the global transaction when it is invoking the Batch Step Bean by calling the Step Bean's processJobStep method in a batch loop. This SPI allows for the creation of customized checkpoint algorithms which can be applied to particular batch jobs when they are submitted to the job scheduler.
-
-
Method Summary
Methods Modifier and Type Method and Description java.lang.StringgetAlgorithmName()Returns the name of the checkpoint algorithmintgetRecommendedTimeOutValue()Called by the Batch Execution Environment to determine the timeout for global transactions that it manages for the batch loop.booleaninitialize(CheckpointAlgorithm ckpt)Called by the Batch Execution Environment to allow a Checkpoint algorithm to retrieve properties defined for the algorithm in xJCL (eg: interval for committing global transactions for a time base checkpoint algorithm) and to do any other initialization tasks.booleanShouldCheckpointBeExecuted()Called by the Batch Execution Environment on each iteration of the batch loop to determine if the global transaction under which the processJobStep method is invoked should be committed or not.voidstartCheckpoint()Called by the Batch Execution Environment when it starts a global transaction.voidstopCheckpoint()Called by the Batch Execution Environment when it commits a global transaction.
-
-
-
Method Detail
-
initialize
boolean initialize(CheckpointAlgorithm ckpt)
Called by the Batch Execution Environment to allow a Checkpoint algorithm to retrieve properties defined for the algorithm in xJCL (eg: interval for committing global transactions for a time base checkpoint algorithm) and to do any other initialization tasks. The CheckpointAlgorithm object passed in represents the Checkpoint information from xJCL.- Specified by:
initializein interfacecom.ibm.batch.spi.CheckpointPolicyAlgorithm- Parameters:
ckpt- the CheckpointAlgorithm information that is specified in xJCL.- Returns:
- boolean indicating if the algorithm was initialized successfully
-
getAlgorithmName
java.lang.String getAlgorithmName()
Returns the name of the checkpoint algorithm- Specified by:
getAlgorithmNamein interfacecom.ibm.batch.spi.CheckpointPolicyAlgorithm- Returns:
- the name of the Checkpoint algorithm
-
ShouldCheckpointBeExecuted
boolean ShouldCheckpointBeExecuted()
Called by the Batch Execution Environment on each iteration of the batch loop to determine if the global transaction under which the processJobStep method is invoked should be committed or not. For example if this is a time based checkpoint algorithm, this method will calculate if enough time has passed between the previous commit time and the current time to determine if the transaction should be committed or not.- Specified by:
ShouldCheckpointBeExecutedin interfacecom.ibm.batch.spi.CheckpointPolicyAlgorithm- Returns:
- a boolean indicating if the Batch Execution Environment should commit the global transaction
-
getRecommendedTimeOutValue
int getRecommendedTimeOutValue()
Called by the Batch Execution Environment to determine the timeout for global transactions that it manages for the batch loop.- Specified by:
getRecommendedTimeOutValuein interfacecom.ibm.batch.spi.CheckpointPolicyAlgorithm- Returns:
- the timeout value for global transactions that are started by the Batch Execution Environment.
-
startCheckpoint
void startCheckpoint()
Called by the Batch Execution Environment when it starts a global transaction. This allows a checkpoint algorithm to keep track of the fact that a transaction has started (e.g. if it's a time based algorithm, it will remember at what time the Batch Execution Environment started the transaction, so when ShouldCheckpointBeExecuted is called, it can calculate if the global transaction should be committed or not).- Specified by:
startCheckpointin interfacecom.ibm.batch.spi.CheckpointPolicyAlgorithm
-
stopCheckpoint
void stopCheckpoint()
Called by the Batch Execution Environment when it commits a global transaction. This allows a checkpoint algorithm to keep track of the fact that a transaction has been committed.- Specified by:
stopCheckpointin interfacecom.ibm.batch.spi.CheckpointPolicyAlgorithm
-
-