jgroup.core.arm
Interface RecoveryStrategy

All Known Implementing Classes:
AbstractRecoveryStrategy, KeepInitialInPartition, KeepMinimalInPartition

public interface RecoveryStrategy

The RecoveryStrategy interface provides methods that must be implemented by a particular recovery service. These methods will be invoked in response to a corresponding failure event, that the method intend to rectify.

All implementations of this interface that are to be used through the ReplicationManager must implement a no-argument constructor. Initialization of a particular recovery strategy should occur in the initialize method.

Since:
Jgroup 1.2
Author:
Hein Meling
See Also:
AbstractRecoveryStrategy, KeepMinimalInPartition, KeepInitialInPartition

Method Summary
 boolean handleFailure(HostSet hosts)
          Handle multiple simulatenous failures; this may either be due to a network partitioning scenario or if several members of the group failed at the same time.
 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.
 boolean relocateReplica(Host host)
          Relocate the application replica that were running on the given host.
 boolean restartReplica(Host host)
          Restart the given replica on the given host.
 

Method Detail

initialize

void initialize(DistributionScheme distScheme,
                AppConfig app)
Initialize the recovery strategy for the given application.


needsRecovery

boolean needsRecovery()
Returns true if the associated application needs a recovery action, otherwise false is returned.


prepareRecovery

boolean prepareRecovery()
Invoked to initialize the recovery strategy implementation for the provided application. The method returns true if the group has failed.


handleFailure

boolean handleFailure(HostSet hosts)
Handle multiple simulatenous failures; this may either be due to a network partitioning scenario or if several members of the group failed at the same time. FIXME UPDATE DOCUMENTATION: Invoked in the event that an entire group fails. This particular type of failure can be characterized as a design failure in most cases. This can be used by special recovery strategies that are capable of recovery with different versions of a replica. For instance if a replica group running version X of the application software, may be replaced by version Y of the same software, in case we get a group failure.

Parameters:
hosts - The set of hosts on which the application were running.
Returns:
True if recovery was successful; false otherwise.

restartReplica

boolean restartReplica(Host host)
Restart the given replica on the given host. This method differes from the one below in that it will try to instatiate the replica on the same host on which the failed replica was running. That is it will be invoked only when the execution service is still believed to be available on that host.

Parameters:
host - The host on which the replica was running.
Returns:
True if recovery was successful; false otherwise.

relocateReplica

boolean relocateReplica(Host host)
Relocate the application replica that were running on the given host. The new location should be obtain through the DistributionScheme provided by the replication manager.

Parameters:
host - The host on which the replica were running.
Returns:
True if recovery was successful; false otherwise.


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