darx
Class ActiveReplicationStrategy

java.lang.Object
  extended by darx.ReplicationStrategy
      extended by darx.ActiveReplicationStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class ActiveReplicationStrategy
extends ReplicationStrategy
implements java.io.Serializable

This is the replication group manager specialisation which implements the active replication strategy.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class darx.ReplicationStrategy
ACTIVE_STRATEGY, BACKUP, EMPTY_STRATEGY, info, LEADER, PASSIVE_STRATEGY, QUORUM_STRATEGY, rep_number, replicants, role, type
 
Constructor Summary
ActiveReplicationStrategy()
           
ActiveReplicationStrategy(ActiveReplicationStrategy newstr)
           
 
Method Summary
 int compareTo(ReplicationStrategy other_strat)
          Compares this replication strategy to another.
 void deliverAsyncMessage(TaskShell shell, DarxMessage msg)
          Spreads the delivery of an asynchronous message throughout the replication group.
 java.io.Serializable deliverSyncMessage(TaskShell shell, DarxMessage msg)
          Spreads the delivery of a synchronous message throughout the replication group.
 void resume()
          Spreads the resumption of the encapsulated task execution throughout the replication group.
 void suspend()
          Spreads the suspension of the encapsulated task execution throughout the replication group.
 
Methods inherited from class darx.ReplicationStrategy
compareTo, contains, display, equals, findReplicantAt, getRemoteShellHandle, getReplicantHandle, getReplicantInfo, getReplicantRole, getReplicants, getReplicationNumber, getReplicationType, handleUnreachableReplicant, hashCode, registerReplicant, setLeaderInfo, setReplicantRole, setReplicants, setReplicantType, setReplicationNumber, stop, terminate, unregisterReplicant
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActiveReplicationStrategy

public ActiveReplicationStrategy()

ActiveReplicationStrategy

public ActiveReplicationStrategy(ActiveReplicationStrategy newstr)
Method Detail

compareTo

public int compareTo(ReplicationStrategy other_strat)
Description copied from class: ReplicationStrategy
Compares this replication strategy to another.

Specified by:
compareTo in class ReplicationStrategy
Parameters:
other_strat - the strategy to be compared
Returns:
0 if both strategies are equivalent, a positive integer if this strategy is more pessimistic than the compared strategy, a negative integer otherwise.

suspend

public void suspend()
Description copied from class: ReplicationStrategy
Spreads the suspension of the encapsulated task execution throughout the replication group. This method is used by the leader of the replication group only.

Specified by:
suspend in class ReplicationStrategy

resume

public void resume()
Description copied from class: ReplicationStrategy
Spreads the resumption of the encapsulated task execution throughout the replication group. This method is used by the leader of the replication group only.

Specified by:
resume in class ReplicationStrategy

deliverAsyncMessage

public void deliverAsyncMessage(TaskShell shell,
                                DarxMessage msg)
Description copied from class: ReplicationStrategy
Spreads the delivery of an asynchronous message throughout the replication group. This method is used by the leader of the replication group only.

Specified by:
deliverAsyncMessage in class ReplicationStrategy
Parameters:
shell - the shell corresponding to the present strategy (used to process the message locally)
msg - the message to deliver

deliverSyncMessage

public java.io.Serializable deliverSyncMessage(TaskShell shell,
                                               DarxMessage msg)
Description copied from class: ReplicationStrategy
Spreads the delivery of a synchronous message throughout the replication group. This method is used by the leader of the replication group only.

Specified by:
deliverSyncMessage in class ReplicationStrategy
Parameters:
shell - the shell corresponding to the present strategy (used to process the message locally)
msg - the message to deliver
Returns:
the reply to be sent back