private class HubConnector.CallItem
extends java.lang.Object
implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
(package private) long |
finish_ |
(package private) ResultHandler |
handler_ |
(package private) java.util.Map |
recipientMap_ |
(package private) java.util.Map |
responseMap_ |
Constructor and Description |
---|
CallItem(ResultHandler handler,
long finish)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addResponse(java.lang.String responderId,
Response response)
Take delivery of a response object.
|
int |
compareTo(java.lang.Object o)
Compares on timeout epochs.
|
boolean |
isDone()
Indicate whether this call item has received all the responses it's
going to.
|
private void |
processResponse(java.lang.String responderId,
Response response)
Process a response when we have both the list of recipients
and the response itself.
|
void |
setRecipients(java.lang.String[] recipientIds)
Sets the recipient Ids for which responses are expected.
|
final ResultHandler handler_
final long finish_
volatile java.util.Map responseMap_
volatile java.util.Map recipientMap_
CallItem(ResultHandler handler, long finish)
handler
- callback objectfinish
- epoch at which timeout should be calledpublic void setRecipients(java.lang.String[] recipientIds)
recipientIds
- recipient client idspublic void addResponse(java.lang.String responderId, Response response)
responderId
- client ID of responderresponse
- response objectprivate void processResponse(java.lang.String responderId, Response response)
responderId
- client ID of responderresponse
- response objectpublic boolean isDone()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable