public abstract class AbstractCallActionManager extends SendActionManager
createBroadcastAction()
method.
Subclasses are provided which do this.Modifier and Type | Class and Description |
---|---|
private class |
AbstractCallActionManager.CallResponseHandler
ResponseHandler implementation for use by this class.
|
private class |
AbstractCallActionManager.SendAction
Action which performs a send to a particular client.
|
private static class |
AbstractCallActionManager.TagInfo
Aggregates information required for handling responses which
correspond to a particular message tag.
|
Modifier and Type | Field and Description |
---|---|
private GuiHubConnector |
connector_ |
private static java.util.logging.Logger |
logger_ |
private java.awt.Component |
parent_ |
private AbstractCallActionManager.CallResponseHandler |
responder_ |
BROADCAST_TARGET, subscribedClientModel_
Constructor and Description |
---|
AbstractCallActionManager(java.awt.Component parent,
GuiHubConnector connector,
javax.swing.ListModel clientListModel)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract javax.swing.Action |
createBroadcastAction()
Must be implemented by concrete subclasses.
|
protected abstract java.util.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.
|
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.
|
void |
dispose()
Releases resources associated with this object.
|
protected javax.swing.Action |
getSendAction(Client client)
Returns an action which can perform a single-client send associated
with this object.
|
void |
registerHandler(java.lang.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
private final java.awt.Component parent_
private final GuiHubConnector connector_
private final AbstractCallActionManager.CallResponseHandler responder_
private static final java.util.logging.Logger logger_
public AbstractCallActionManager(java.awt.Component parent, GuiHubConnector connector, javax.swing.ListModel clientListModel)
parent
- parent componentconnector
- hub connectorclientListModel
- list model containing only those clients
which are suitable recipients;
all elements must be Client
sprotected abstract javax.swing.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 java.util.Map createMessage(Client client) throws java.lang.Exception
getSendAction(org.astrogrid.samp.Client)
.client
- targetjava.lang.Exception
protected javax.swing.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 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 required