|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdarx.DarxCommInterface
public class DarxCommInterface
This is the communication interface, specific to an agent, used to send
messages to other agents.
In practical terms, the leading DarxTask
of a replication
group creates an instance of this class in order to communicate with the
other leaders via their corresponding RemoteTask
.
The DarxCommInterface
is responsible for wrapping the contents
of the messages in instances of DarxMessage
, as well as keeping
count of the sequence number of the sent messages and increasing this number
for each emission.
NB: It might be a good idea to force this class to be a transient
attribute of the DarxTask
. Only the leader of a replication
group would then be able to send messages.
Constructor Summary | |
---|---|
DarxCommInterface(java.lang.String name)
Constructs a new instance for this class. |
Method Summary | |
---|---|
void |
sendAsyncMessage(RemoteTask rem,
java.io.Serializable body)
Sends an asynchronous message to an agent. |
java.lang.Object |
sendSyncMessage(RemoteTask rem,
java.io.Serializable body)
Sends a synchronous message to an agent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DarxCommInterface(java.lang.String name)
name
- the name of the owner of this instance; generally
the name of the corresponding task.Method Detail |
---|
public void sendAsyncMessage(RemoteTask rem, java.io.Serializable body)
rem
- the remote reference to the corresponding replication
group.body
- the contents of the emission.RemoteTask.sendAsyncMessage(DarxMessage msg)
public java.lang.Object sendSyncMessage(RemoteTask rem, java.io.Serializable body)
rem
- the remote reference to the corresponding replication
group.body
- the contents of the emission.RemoteTask.sendSyncMessage(DarxMessage msg)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |