IBM WebSphere Extended Deployment (XD)TM
Release 6.0

com.ibm.wsspi.batch
CheckpointPolicyAlgorithm



CheckPointPolicy 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 Long Running Scheduler.


Method Summary
public  booleaninitialize(com.ibm.wsspi.batch.xjcl.CheckpointAlgorithm)
           Called by 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.
public  StringgetAlgorithmName()
          
public  booleanShouldCheckpointBeExecuted()
           Called by Batch Execution Environment on each iteration of the batch loop to determine if the global transaction under which the processJobStep method is invoked should commit or not.
public  intgetRecommendedTimeOutValue()
           Called by Batch Execution Environment to determine the timeout for global transactions that it manages for the batch loop.
public  voidstartCheckpoint()
           Called by Batch Execution Environment when it starts a global transaction. This.
public  voidstopCheckpoint()
           Called by Batch Execution Environment when it commits a global transaction. This.

Method Detail

initialize

public boolean initialize(CheckpointAlgorithm ckpt)
Called by 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.
Parameters:
    ckpt - the CheckpointAlgorithm information that is specified in xJCL.


Returns:
     boolean indicates if the algorithm was initialized successfully


getAlgorithmName

public String getAlgorithmName()
Returns the name of checkpoint algorithm


Returns:
     the name of Checkpoint algorithm


ShouldCheckpointBeExecuted

public boolean ShouldCheckpointBeExecuted()
Called by Batch Execution Environment on each iteration of the batch loop to determine if the global transaction under which the processJobStep method is invoked should commit 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 determin if the tran should be committed or not.


Returns:
     a boolean indicating if the Batch Execution Environment should commit the global transaction


getRecommendedTimeOutValue

public int getRecommendedTimeOutValue()
Called by Batch Execution Environment to determine the timeout for global transactions that it manages for the batch loop.


Returns:
     the timeout value for global transactions that are started by the Batch Execution Environment.


startCheckpoint

public void startCheckpoint()
Called by Batch Execution Environment when it starts a global transaction. This allows checkpoint algorithm to keep track of the fact that a transaction has started. Eg: 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 shoud commit or not.


stopCheckpoint

public void stopCheckpoint()
Called by Batch Execution Environment when it commits a global transaction. This allows checkpoint algorithm to keep track of the fact that a transaction has been committed.


IBM WebSphere Extended Deployment (XD)TM
Release 6.0