navigators.smart.tom
Class TOMSender

java.lang.Object
  extended by navigators.smart.tom.TOMSender
All Implemented Interfaces:
ReplyReceiver
Direct Known Subclasses:
LatencyTestClient, ServiceProxy, ThroughputLatencyTestClient, ThroughputTestClient

public abstract class TOMSender
extends java.lang.Object
implements ReplyReceiver

This class is used to multicast data to a group of replicas


Field Summary
private  CommunicationSystemClientSide cs
           
private  int[] group
           
private  java.util.concurrent.locks.Lock lock
           
private  int me
           
private  int sequence
           
private  boolean useSignatures
           
 
Constructor Summary
TOMSender()
          Creates a new instance of TOMulticastSender TODO: Isto pode mesmo estar vazio?
 
Method Summary
 int getLastSequenceNumber()
          Get last sequence number of an already multicasted message
private  int getNextSequenceNumber()
           
 void init(CommunicationSystemClientSide cs, TOMConfiguration conf)
          This method initializes the object TODO: Perguntar se este metodo n pode antes ser protected (compila como protected, mas mesmo assim...)
 void init(CommunicationSystemClientSide cs, TOMConfiguration conf, int sequence)
          This method initializes the object TODO: Perguntar se este metodo n pode antes ser protected (compila como protected, mas mesmo assim...)
 TOMMessage sign(byte[] m)
          Create TOMMessage and sign it
 void TOMulticast(byte[] m)
          Multicast data to the group of replicas
 void TOMulticast(byte[] m, boolean readOnly)
          Multicast data to the group of replicas
 void TOMulticast(TOMMessage sm)
          Multicast a TOMMessage to the group of replicas
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface navigators.smart.communication.client.ReplyReceiver
replyReceived
 

Field Detail

me

private int me

group

private int[] group

sequence

private int sequence

cs

private CommunicationSystemClientSide cs

lock

private java.util.concurrent.locks.Lock lock

useSignatures

private boolean useSignatures
Constructor Detail

TOMSender

public TOMSender()
Creates a new instance of TOMulticastSender TODO: Isto pode mesmo estar vazio?

Method Detail

init

public void init(CommunicationSystemClientSide cs,
                 TOMConfiguration conf,
                 int sequence)
This method initializes the object TODO: Perguntar se este metodo n pode antes ser protected (compila como protected, mas mesmo assim...)

Parameters:
cs - Client side comunication system
conf - Client side comunication system configuration
sequence - Initial sequence number for data multicast TODO: ver o q é isto de "client side comunication system"

init

public void init(CommunicationSystemClientSide cs,
                 TOMConfiguration conf)
This method initializes the object TODO: Perguntar se este metodo n pode antes ser protected (compila como protected, mas mesmo assim...)

Parameters:
cs - Client side comunication system
conf - Total order messaging configuration

getNextSequenceNumber

private int getNextSequenceNumber()

getLastSequenceNumber

public int getLastSequenceNumber()
Get last sequence number of an already multicasted message

Returns:
Last sequence number of an already multicasted message TODO: Isto nao devia ter tambem um semaforo a controlar a leitura deste atributo?

TOMulticast

public void TOMulticast(byte[] m)
Multicast data to the group of replicas

Parameters:
m - Data to be multicast

TOMulticast

public void TOMulticast(byte[] m,
                        boolean readOnly)
Multicast data to the group of replicas

Parameters:
m - Data to be multicast
readOnly - it is a readonly request

TOMulticast

public void TOMulticast(TOMMessage sm)
Multicast a TOMMessage to the group of replicas

Parameters:
m - Data to be multicast

sign

public TOMMessage sign(byte[] m)
Create TOMMessage and sign it

Parameters:
m - Data to be included in TOMMessage
Returns:
TOMMessage with serializedMsg and serializedMsgSignature fields filled