universal.communication
Class ReceiverClient

java.lang.Object
  |
  +--universal.communication.ReceiverClient
All Implemented Interfaces:
java.lang.Runnable

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

This subclass implements the crash stop model receiver in the side of the client. It is waiting for AmAlive messages from the replicated servers.


Field Summary
(package private)  java.net.Socket clientSocket
           
 java.util.Vector processes
          List of the replicated servers
(package private)  universal.UniversalClient uniClient
          The Universal object this receiver is linked to
 
Constructor Summary
ReceiverClient(universal.UniversalClient univClient)
          Start the thread to listen for new messages to arrive
 
Method Summary
 universal.leader.LeaderCrashStopClient leader()
           
 java.lang.Object receive()
          Waits for new packet to arrive and then return as an Object the message that has been decoded.
 void run()
          Waits for AmAlive messages and then informs the leader part of our algorithm that an AmAlive message has arrived.
 int totalno()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

processes

public java.util.Vector processes
List of the replicated servers


uniClient

universal.UniversalClient uniClient
The Universal object this receiver is linked to


clientSocket

java.net.Socket clientSocket
Constructor Detail

ReceiverClient

public ReceiverClient(universal.UniversalClient univClient)
Start the thread to listen for new messages to arrive

Method Detail

leader

public universal.leader.LeaderCrashStopClient leader()

receive

public java.lang.Object receive()
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
Waits for new packet to arrive and then return as an Object the message that has been decoded.

java.io.IOException
java.lang.ClassNotFoundException

run

public void run()
Waits for AmAlive messages and then informs the leader part of our algorithm that an AmAlive message has arrived.

Specified by:
run in interface java.lang.Runnable

totalno

public int totalno()