private class AbstractCallActionManager.CallResponseHandler extends java.lang.Object implements ResponseHandler, javax.swing.event.ChangeListener
| Modifier and Type | Field and Description |
|---|---|
private int |
iCall_ |
private java.util.Map |
tagMap_ |
| Constructor and Description |
|---|
CallResponseHandler()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
createTag()
Creates and returns a new tag which will be attached to
an outgoing message, and updates internal structures so that
it will be recognised in the future.
|
private void |
hubDisconnected()
Called when the connection to the hub disappears.
|
boolean |
ownsTag(java.lang.String tag)
Indicates whether this handler will process the response with a
given message tag.
|
private void |
processResponse(java.lang.String tag,
AbstractCallActionManager.TagInfo info,
java.lang.String responderId,
Response response)
Does the work of passing on a received response to a registered
result handler.
|
void |
receiveResponse(HubConnection connection,
java.lang.String responderId,
java.lang.String tag,
Response response)
Processes a response to an earlier message.
|
void |
registerHandler(java.lang.String tag,
Client[] recipients,
ResultHandler handler)
Registers a result handler to handle results corresponding to a
message tag.
|
void |
stateChanged(javax.swing.event.ChangeEvent evt) |
public java.lang.String createTag()
registerHandler(java.lang.String, org.astrogrid.samp.Client[], org.astrogrid.samp.client.ResultHandler) should be made for the
returned tag.public void registerHandler(java.lang.String tag,
Client[] recipients,
ResultHandler handler)
tag - tag returned by an earlier invocation of
createTag()recipients - clients from which responses are expectedhandler - result handler for responses; may be null
if no handling is requiredpublic boolean ownsTag(java.lang.String tag)
ResponseHandlerownsTag in interface ResponseHandlertag - tag with which earlier call was labelledmsgTagpublic void receiveResponse(HubConnection connection, java.lang.String responderId, java.lang.String tag, Response response)
ResponseHandlermsgTag values which return
true from ResponseHandler.ownsTag(java.lang.String).receiveResponse in interface ResponseHandlerconnection - hub connectionresponderId - client id of client sending responsetag - message tag from previous callresponse - response objectprivate void processResponse(java.lang.String tag,
AbstractCallActionManager.TagInfo info,
java.lang.String responderId,
Response response)
tag - message taginfo - tag handling information objectresponderId - client ID of responderresponse - response objectpublic void stateChanged(javax.swing.event.ChangeEvent evt)
stateChanged in interface javax.swing.event.ChangeListenerprivate void hubDisconnected()