org.objectweb.dream.protocol.bus.logicalClock
Class FIFOClock

java.lang.Object
  extended by org.objectweb.dream.protocol.bus.logicalClock.FIFOClock
All Implemented Interfaces:
LogicalClock

public class FIFOClock
extends Object
implements LogicalClock

TODO Add class comment


Field Summary
protected  int[] lastDelivered
           
protected  ChunkFactoryReference<LogicalClockChunk> logicalClockChunkFactory
           
protected  String logicalClockChunkName
           
protected  MessageManager messageManager
           
protected  int myAddress
           
protected  int size
           
protected  int[] stamp
           
 
Fields inherited from interface org.objectweb.dream.protocol.bus.logicalClock.LogicalClock
ALREADY_DELIVERED, DELIVER, LOGICAL_CLOCK_ITF_NAME, WAIT_TO_DELIVER
 
Constructor Summary
FIFOClock(int size, int myAddress, String logicalClockChunkName, MessageManager messageManager)
           
 
Method Summary
 void stamp(Message message, int to)
          Stamps the given message.
 int testRecvMessage(Message message)
          Test if the given message can be delivered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stamp

protected int[] stamp

lastDelivered

protected int[] lastDelivered

myAddress

protected int myAddress

size

protected int size

logicalClockChunkName

protected String logicalClockChunkName

messageManager

protected MessageManager messageManager

logicalClockChunkFactory

protected ChunkFactoryReference<LogicalClockChunk> logicalClockChunkFactory
Constructor Detail

FIFOClock

public FIFOClock(int size,
                 int myAddress,
                 String logicalClockChunkName,
                 MessageManager messageManager)
Parameters:
size - the bus size;
myAddress - the local address in the bus.
logicalClockChunkName - the name of the chunk to add in the message.
messageManager - the message manager.
Method Detail

testRecvMessage

public int testRecvMessage(Message message)
Description copied from interface: LogicalClock
Test if the given message can be delivered. If the message is ready to be delivered, the method returns DELIVER. If the message has already been delivered, the method returns ALREADY_DELIVERED, and if other messages are waited before this message the method returns WAIT_TO_DELIVER.

Specified by:
testRecvMessage in interface LogicalClock
Parameters:
message - the message to test.
Returns:
DELIVER,ALREADY_DELIVERED, or WAIT_TO_DELIVER code.
See Also:
LogicalClock.testRecvMessage(Message)

stamp

public void stamp(Message message,
                  int to)
Description copied from interface: LogicalClock
Stamps the given message.

Specified by:
stamp in interface LogicalClock
Parameters:
message - a message to stamp
to - the address of the destination process.
See Also:
LogicalClock.stamp(Message, int)


Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.