class HubCallableClient extends java.lang.Object implements CallableClient
| Modifier and Type | Field and Description |
|---|---|
private HubConnection |
connection_ |
private AbstractMessageHandler[] |
handlers_ |
| Constructor and Description |
|---|
HubCallableClient(HubConnection connection,
AbstractMessageHandler[] handlers)
Constructs a HubCallableClient with a given set of handlers.
|
| Modifier and Type | Method and Description |
|---|---|
private AbstractMessageHandler |
getHandler(java.lang.String mtype)
Returns a handler owned by this callable client which can handle
a given MType.
|
Subscriptions |
getSubscriptions()
Returns the subscriptions corresponding to the messages that this
receiver can deal with.
|
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.
|
private final HubConnection connection_
private final AbstractMessageHandler[] handlers_
public HubCallableClient(HubConnection connection, AbstractMessageHandler[] handlers)
connection - connection to hub servicehandlers - array of message handlerspublic void receiveCall(java.lang.String senderId,
java.lang.String msgId,
Message msg)
throws SampException
CallableClientreply
method at some future point.receiveCall in interface CallableClientsenderId - public ID of sending clientmsgId - message identifier for later use with replymsg - messageSampExceptionpublic void receiveNotification(java.lang.String senderId,
Message msg)
throws SampException
CallableClientreceiveNotification in interface CallableClientsenderId - public ID of sending clientmsg - messageSampExceptionpublic void receiveResponse(java.lang.String responderId,
java.lang.String msgTag,
Response response)
throws SampException
CallableClientreceiveResponse in interface CallableClientresponderId - public ID of responding clientmsgTag - client-defined tag labelling previously-sent messageresponse - returned response objectSampExceptionpublic Subscriptions getSubscriptions()
private AbstractMessageHandler getHandler(java.lang.String mtype) throws SampException
mtype - MType to handlemtypeSampException - if no suitable handler exists