universal.leader
Class LeaderCrashStopClient

java.lang.Object
  |
  +--universal.leader.LeaderCrashStopClient
All Implemented Interfaces:
java.lang.Runnable

public class LeaderCrashStopClient
extends java.lang.Object
implements java.lang.Runnable

This is the implementation of the leader part of the algorithm in the client side. As it is now it can be use also for the crash recovery model without big changes.


Nested Class Summary
protected  class LeaderCrashStopClient.trustListElement
           
 
Field Summary
 LeaderCrashStopClient.trustListElement[] trustList
          trustList[k] contains information about the replicated server of pid k
(package private)  universal.UniversalClientCrashStop uniClient
          The object UniversalClientCrashStop this LeaderCrashStopClient is linked to
 
Constructor Summary
LeaderCrashStopClient(universal.UniversalClientCrashStop uniClient)
           
 
Method Summary
 void initialize(boolean recovering)
          Create one object trustlist per replicated server.
 java.lang.String is_leader()
          Returns first correct replicated server alive in the list.
 void omega()
          Check if some replicated server shouldn't be trusted anymore because we don't have receive any AmAlive message from it since a period of length delta.
 void receivedAmAlive(universal.AmAliveMessage m)
          Call when it receives an AmAliveMessage from one of the replicated servers.
 universal.communication.ReceiverClient receiverClient()
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trustList

public LeaderCrashStopClient.trustListElement[] trustList
trustList[k] contains information about the replicated server of pid k


uniClient

universal.UniversalClientCrashStop uniClient
The object UniversalClientCrashStop this LeaderCrashStopClient is linked to

Constructor Detail

LeaderCrashStopClient

public LeaderCrashStopClient(universal.UniversalClientCrashStop uniClient)
Method Detail

initialize

public void initialize(boolean recovering)
Create one object trustlist per replicated server. Starts the thread.


run

public void run()
Specified by:
run in interface java.lang.Runnable

is_leader

public java.lang.String is_leader()
Returns first correct replicated server alive in the list. As we are in the client side the function is_leader will return directly the IOR of the leader. If noone is trusted, it makes a loop until someone finish by beeing trusted as alive.


omega

public void omega()
Check if some replicated server shouldn't be trusted anymore because we don't have receive any AmAlive message from it since a period of length delta.


receivedAmAlive

public void receivedAmAlive(universal.AmAliveMessage m)
Call when it receives an AmAliveMessage from one of the replicated servers. If this replicated servers wasn't trusted as alive it is again trusted and we increase the period delta to check if it has received a message or not.


receiverClient

public universal.communication.ReceiverClient receiverClient()