public abstract class AbstractCallActionManager extends SendActionManager
createBroadcastAction()
method.
Subclasses are provided which do this.BROADCAST_TARGET
Constructor and Description |
---|
AbstractCallActionManager(Component parent,
GuiHubConnector connector,
ListModel clientListModel)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Action |
createBroadcastAction()
Must be implemented by concrete subclasses.
|
protected abstract Map |
createMessage(Client client)
Returns the Message object which is to be transmitted by this manager
to a given client.
|
protected ResultHandler |
createResultHandler(HubConnection connection,
Message msg,
Client[] recipients)
Returns an object which will be informed of the results of a single-
or multiple-recipient send as they arrive.
|
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.
|
void |
dispose()
Releases resources associated with this object.
|
protected Action |
getSendAction(Client client)
Returns an action which can perform a single-client send associated
with this object.
|
void |
registerHandler(String tag,
Client[] recipients,
ResultHandler handler)
Registers a result handler to handle results corresponding to a
message tag.
|
createSendMenu, createTargetAction, createTargetSelector, disposeSendMenu, getBroadcastAction, getBroadcastIcon, getClientListModel, getConnector, getSendIcon, setEnabled, updateState
public AbstractCallActionManager(Component parent, GuiHubConnector connector, ListModel clientListModel)
parent
- parent componentconnector
- hub connectorclientListModel
- list model containing only those clients
which are suitable recipients;
all elements must be Client
sprotected abstract Action createBroadcastAction()
createBroadcastAction
in class SendActionManager
protected ResultHandler createResultHandler(HubConnection connection, Message msg, Client[] recipients)
The default implementation returns an instance of
LogResultHandler
.
connection
- connection objectmsg
- the message which was sentrecipients
- the recipients to whom the message was sentpublic void dispose()
dispose
in class SendActionManager
protected abstract Map createMessage(Client client) throws Exception
getSendAction(org.astrogrid.samp.Client)
.client
- targetException
protected Action getSendAction(Client client)
SendActionManager
equals
(and hashCode
) intelligently there will be efficiency
advantages.
The enabled status of such actions will be managed by this object.getSendAction
in class SendActionManager
client
- recipient clientpublic 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(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 requiredCopyright © 2008–2024. All rights reserved.