org.objectweb.dream.protocol.bus.logicalClock
Interface LogicalClock

All Known Implementing Classes:
FIFOClock, MatrixClock

public interface LogicalClock

Component interface to manipulate logical clock. A logical clock protocol allows n processes to exchange ordered messages. Each process has a identifier form 0 to n-1 . When a process send a message to an other, this message is stamped with a logical clock. Before to be delivered to the destination process, the stamp of a given message is analyzed to know if other messages should be delivered before this one.


Field Summary
static int ALREADY_DELIVERED
          the value returned by testRecvMessage(Message)if the message has already been delivered.
static int DELIVER
          the value returned by testRecvMessage(Message) if the message can be delivered
static String LOGICAL_CLOCK_ITF_NAME
          The default name of LogicalClockinterfaces
static int WAIT_TO_DELIVER
          the value returned by testRecvMessage(Message)if there is other messages that must be delivered before this one.
 
Method Summary
 void stamp(Message message, int to)
          Stamps the given message.
 int testRecvMessage(Message message)
          Test if the given message can be delivered.
 

Field Detail

LOGICAL_CLOCK_ITF_NAME

static final String LOGICAL_CLOCK_ITF_NAME
The default name of LogicalClockinterfaces

See Also:
Constant Field Values

DELIVER

static final int DELIVER
the value returned by testRecvMessage(Message) if the message can be delivered

See Also:
Constant Field Values

WAIT_TO_DELIVER

static final int WAIT_TO_DELIVER
the value returned by testRecvMessage(Message)if there is other messages that must be delivered before this one.

See Also:
Constant Field Values

ALREADY_DELIVERED

static final int ALREADY_DELIVERED
the value returned by testRecvMessage(Message)if the message has already been delivered.

See Also:
Constant Field Values
Method Detail

testRecvMessage

int testRecvMessage(Message message)
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.

Parameters:
message - the message to test.
Returns:
DELIVER,ALREADY_DELIVERED, or WAIT_TO_DELIVER code.

stamp

void stamp(Message message,
           int to)
Stamps the given message.

Parameters:
message - a message to stamp
to - the address of the destination process.


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