jgroup.arm.recovery
Class AbstractRecoveryStrategy

java.lang.Object
  extended by jgroup.arm.recovery.AbstractRecoveryStrategy
All Implemented Interfaces:
RecoveryStrategy
Direct Known Subclasses:
KeepMinimalInPartition

public abstract class AbstractRecoveryStrategy
extends java.lang.Object
implements RecoveryStrategy

This implements only the core initialization of a recovery strategy, including also handling for the RM recoveree replica.

Since:
Jgroup 1.2
Author:
Hein Meling

Field Summary
protected  AppConfig app
          The application associated with this recovery strategy instance
protected  DistributionScheme distScheme
          The distribution scheme interface
protected  int missing
          The current delta redundancy (the number of missing replicas)
 
Constructor Summary
AbstractRecoveryStrategy()
          All recovery strategy implementations should implement a no-argument constructor.
 
Method Summary
protected  int deltaRedundancy(AppConfig app)
          Returns the number of replicas that needs to be recovered to maintain the minimal redundancy level specified.
 void initialize(DistributionScheme distScheme, AppConfig app)
          Initialize the recovery strategy for the given application.
 boolean needsRecovery()
          Returns true if the associated application needs a recovery action, otherwise false is returned.
 boolean prepareRecovery()
          Invoked to initialize the recovery strategy implementation for the provided application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jgroup.core.arm.RecoveryStrategy
handleFailure, relocateReplica, restartReplica
 

Field Detail

distScheme

protected DistributionScheme distScheme
The distribution scheme interface


app

protected AppConfig app
The application associated with this recovery strategy instance


missing

protected int missing
The current delta redundancy (the number of missing replicas)

Constructor Detail

AbstractRecoveryStrategy

public AbstractRecoveryStrategy()
All recovery strategy implementations should implement a no-argument constructor. This pattern cannot be enforced by the RecoveryStratgy interface, but can be check while parsing.

Method Detail

deltaRedundancy

protected int deltaRedundancy(AppConfig app)
Returns the number of replicas that needs to be recovered to maintain the minimal redundancy level specified. If no recovery is needed, zero is returned.


initialize

public void initialize(DistributionScheme distScheme,
                       AppConfig app)
Description copied from interface: RecoveryStrategy
Initialize the recovery strategy for the given application.

Specified by:
initialize in interface RecoveryStrategy

needsRecovery

public boolean needsRecovery()
Description copied from interface: RecoveryStrategy
Returns true if the associated application needs a recovery action, otherwise false is returned.

Specified by:
needsRecovery in interface RecoveryStrategy

prepareRecovery

public boolean prepareRecovery()
Description copied from interface: RecoveryStrategy
Invoked to initialize the recovery strategy implementation for the provided application. The method returns true if the group has failed.

Specified by:
prepareRecovery in interface RecoveryStrategy


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.