|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 LogicalClock interfaces |
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 |
---|
static final String LOGICAL_CLOCK_ITF_NAME
LogicalClock
interfaces
static final int DELIVER
testRecvMessage(Message)
if the message can
be delivered
static final int WAIT_TO_DELIVER
testRecvMessage(Message)
if there is other
messages that must be delivered before this one.
static final int ALREADY_DELIVERED
testRecvMessage(Message)
if the message has
already been delivered.
Method Detail |
---|
int testRecvMessage(Message message)
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
.
message
- the message to test.
DELIVER
,ALREADY_DELIVERED
, or
WAIT_TO_DELIVER
code.void stamp(Message message, int to)
message
- a message to stampto
- the address of the destination process.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |