private static class MessageSender.AsynchSender.Collector extends java.lang.Object implements CallableClient
| Modifier and Type | Field and Description |
|---|---|
(package private) MessageSender.BlockingMap |
map_ |
(package private) java.util.Collection |
recipients_ |
| Constructor and Description |
|---|
Collector()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
receiveCall(java.lang.String senderId,
java.lang.String msgId,
Message msg)
Receives a message for which a response is required.
|
void |
receiveNotification(java.lang.String senderId,
Message msg)
Receives a message for which no response is required.
|
void |
receiveResponse(java.lang.String responderId,
java.lang.String msgTag,
Response response)
Receives a response to a message previously sent by this client.
|
void |
setRecipients(java.util.Collection recipients)
Notifies this object which clients it should expect a response
from.
|
final MessageSender.BlockingMap map_
java.util.Collection recipients_
Collector()
nExpected - number of responses expected by this collectorpublic void setRecipients(java.util.Collection recipients)
recipients - set of client ids for expected responderspublic void receiveCall(java.lang.String senderId,
java.lang.String msgId,
Message msg)
CallableClientreply
method at some future point.receiveCall in interface CallableClientsenderId - public ID of sending clientmsgId - message identifier for later use with replymsg - messagepublic void receiveNotification(java.lang.String senderId,
Message msg)
CallableClientreceiveNotification in interface CallableClientsenderId - public ID of sending clientmsg - messagepublic void receiveResponse(java.lang.String responderId,
java.lang.String msgTag,
Response response)
CallableClientreceiveResponse in interface CallableClientresponderId - public ID of responding clientmsgTag - client-defined tag labelling previously-sent messageresponse - returned response object