darx
Class ReplicationManager

java.lang.Object
  extended by darx.ReplicationManager

public abstract class ReplicationManager
extends java.lang.Object

LA DEFINITION QUI SUIT EST CELLE A COURT TERME
Ce composant sert a traduire le changement de valeur de la criticite en modification de strategie.


LA DEFINITION QUI SUIT EST CELLE A LONG TERME
This is the component, used alongside each TaskShell, which defines a task's replication group, that is its members and its scheme, and handles its consistency.
This class provides methods to manage the information a specific task possesses about its replication group in terms of replicant (un)registration, that is it maintains up to date the number of replicants for this particular task, the location of each replicant and the strategy it belongs to.

NB: EVERY replicant, independently of its being leader of the replication group or not, carries and maintains this information up to date so as to be available to take the leadership in case of the current leader's failure.

NB2: A scheme may be composed of multiple replication strategies.

See Also:
ReplicationStrategy

Constructor Summary
ReplicationManager(TaskShell shell, ReplicationPolicy policy, double criticity)
          Constructs a new ReplicationManager.
 
Method Summary
abstract  void adaptPolicy()
          Adapts the current replication scheme using a specific heuristic.
 int compareStrategies(ReplicationStrategy rep_strat_a, ReplicationStrategy rep_strat_b)
          Compares two replication strategies.
 double getCriticity()
           
 double setCriticity(double new_criticity)
          Updates the criticity of the replication group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationManager

public ReplicationManager(TaskShell shell,
                          ReplicationPolicy policy,
                          double criticity)
Constructs a new ReplicationManager.

Method Detail

getCriticity

public double getCriticity()
Returns:
the criticity of the agent.

setCriticity

public double setCriticity(double new_criticity)
Updates the criticity of the replication group. If the newly computed value for the criticity is different from the previous one, then the current scheme is modified.

Parameters:
new_criticity - the newly computed value for the criticity.
Returns:
the latest value of the criticity.

adaptPolicy

public abstract void adaptPolicy()
Adapts the current replication scheme using a specific heuristic.


compareStrategies

public int compareStrategies(ReplicationStrategy rep_strat_a,
                             ReplicationStrategy rep_strat_b)
Compares two replication strategies.

Parameters:
rep_strat_a - the first strategy to be compared
rep_strat_b - the second strategy to be compared
Returns:
0 if both strategies are equivalent, a positive integer if strategy A is more pessimistic than strategy B, a negative integer otherwise.