org.objectweb.dream.protocol.causality
Interface MatrixClock

All Known Implementing Classes:
BasicMatrixClockImpl, UpdateMatrixClockImpl

public interface MatrixClock

Component interfae to manipulate causal matrix clock. The causality protocol composite allows n processes to exchange causaly 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 by the causality protocol. Before to be delivered to the destination process, the stamp of a given message is analysed to know if other messages should be delivered before this one.


Field Summary
static int ALREADY_DELIVERED
          the value returned by testRecvMatrix(Object, short, short)if the message has already been delivred.
static int DELIVER
          the value returned by testRecvMatrix(Object, short, short)if the message can be delivred
static String MATRIX_CLOCK_ITF_NAME
          The default name of MatrixClockinterfaces
static int WAIT_TO_DELIVER
          the value returned by testRecvMatrix(Object, short, short)if there is other message in the causal ordering before this.
 
Method Summary
 Object getStamp(short from, short to)
          Generate a stamp for the specified destination identifier.
 int testRecvMatrix(Object stamp, short from, short to)
          Test if the received message, the given stamp belong, can be delivered.
 

Field Detail

MATRIX_CLOCK_ITF_NAME

public static final String MATRIX_CLOCK_ITF_NAME
The default name of MatrixClockinterfaces

See Also:
Constant Field Values

DELIVER

public static final int DELIVER
the value returned by testRecvMatrix(Object, short, short)if the message can be delivred

See Also:
Constant Field Values

WAIT_TO_DELIVER

public static final int WAIT_TO_DELIVER
the value returned by testRecvMatrix(Object, short, short)if there is other message in the causal ordering before this.

See Also:
Constant Field Values

ALREADY_DELIVERED

public static final int ALREADY_DELIVERED
the value returned by testRecvMatrix(Object, short, short)if the message has already been delivred.

See Also:
Constant Field Values
Method Detail

testRecvMatrix

public int testRecvMatrix(Object stamp,
                          short from,
                          short to)
Test if the received message, the given stamp belong, can be delivered. If the message is ready to be delivered, the method returns DELIVER and the matrix clock is updated. 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. In the last two case the matrix clock remains unchanged.

Parameters:
stamp - a stamp
from - the identifier of the sender process.
to - the identifier of the local process.
Returns:
DELIVER,ALREADY_DELIVERED, or WAIT_TO_DELIVER code.

getStamp

public Object getStamp(short from,
                       short to)
Generate a stamp for the specified destination identifier.

Parameters:
from - the local process identifier
to - the destination process identifier
Returns:
a stamp.


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