...
But typically the abstract class AbstractRecoveryExecutor can be used as super class.
After implementing a new recovery executor, it must be declared as an OSGi declarative service that provides an implementation of IRecoveryExecutor.
If you want to use the checkpointing component to get a notification when a checkpoint is reached, you have to register like in the following example:
Code Block | ||||
---|---|---|---|---|
| ||||
RollbackRecoveryExecutor instance = new RollbackRecoveryExecutor(); List<IRecoveryComponent> components = new ArrayList<>(); components.add(new CheckpointingRecoveryComponent()); components.add(new ProcessingImageRecoveryComponent()); components.add(new BaDaStRecoveryComponent()); components.add(new DuplicatesDetectorRecoveryComponent()); instance.init(config, components); ((CheckpointingRecoveryComponent) instance.components.get(0)) .addCheckpointManagerListener((ProcessingImageRecoveryComponent) instance.components.get(1)); return instance; |