universal.communication
Class Receiver

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

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

This subclass implements the crash stop model receiver. It waits for connection to the socket and then after each time a connection has been accepted, it starts a new thread to wait for the packet and treat the message.


Field Summary
 java.util.Vector AckBuffer
          Contain the AckRead,NackRead,AckWrite and NackWrite messages that have been received but not yet analize in AckListenner.
 java.util.Vector ReadBuffer
          Contains the Read messages that have been received but not yet analize in ReadListenner
(package private)  universal.Universal uni
          The Universal object this receiver is linked to.
 java.util.Vector WriteBuffer
          Contains the Write messages that have been recived but not yet analize in WriteListenner
 
Constructor Summary
Receiver(universal.Universal univ)
          It starts the thread that is going to listen for connection.
 
Method Summary
 universal.leader.Leader leader()
           
 universal.consensus.register.Register reg()
           
 void run()
          Waits for connection to the socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ReadBuffer

public java.util.Vector ReadBuffer
Contains the Read messages that have been received but not yet analize in ReadListenner


WriteBuffer

public java.util.Vector WriteBuffer
Contains the Write messages that have been recived but not yet analize in WriteListenner


AckBuffer

public java.util.Vector AckBuffer
Contain the AckRead,NackRead,AckWrite and NackWrite messages that have been received but not yet analize in AckListenner.


uni

universal.Universal uni
The Universal object this receiver is linked to.

Constructor Detail

Receiver

public Receiver(universal.Universal univ)
It starts the thread that is going to listen for connection. Initialize ReadBuffer, WriteBuffer and AckBuffer.

Parameters:
univ - the universal object this receuiver is linked to.
Method Detail

leader

public universal.leader.Leader leader()
Returns:
lead the object leader of the object Universal

reg

public universal.consensus.register.Register reg()
Returns:
reg the object register of the object Universal

run

public void run()
Waits for connection to the socket. After each time a connection has been accepted, it starts a new thread to wait for the packet and treat the message.

Specified by:
run in interface java.lang.Runnable