Class NotifyActionManager


  • public abstract class NotifyActionManager
    extends SendActionManager
    SendActionManager subclass which works with messages of a single MType, using the Notify delivery pattern.
    Since:
    5 Sep 2008
    Author:
    Mark Taylor
    • Constructor Detail

      • NotifyActionManager

        public NotifyActionManager​(java.awt.Component parent,
                                   GuiHubConnector connector,
                                   java.lang.String mtype,
                                   java.lang.String sendType)
        Constructor.
        Parameters:
        parent - parent component
        connector - hub connector
        mtype - MType for messages transmitted by this object's actions
        sendType - short string identifying the kind of thing being sent (used for action descriptions etc)
    • Method Detail

      • createMessage

        protected abstract java.util.Map createMessage()
                                                throws java.lang.Exception
        Generates the message which is sent to one or all clients by this object's actions.
        Returns:
        Message-like Map representing message to transmit
        Throws:
        java.lang.Exception
      • messageSent

        protected void messageSent​(HubConnection connection,
                                   Message msg,
                                   Client[] recipients)
        Called when a message has been sent by this object. The default action is to notify via the logging system. Subclasses may override this method.
        Parameters:
        connection - connection object
        msg - the message which was sent
        recipients - the recipients to whom an attempt was made to send the message
      • createBroadcastAction

        protected javax.swing.Action createBroadcastAction()
        Description copied from class: SendActionManager
        Returns a new action for broadcast associated with this object. The enabled status of the action will be managed by this object.
        Specified by:
        createBroadcastAction in class SendActionManager
        Returns:
        broadcast action; may be null if broadcast is not required
      • createSendMenu

        public javax.swing.JMenu createSendMenu()
        Returns a new menu for targetted sends with a title suitable for this object.
        Returns:
        new send menu
      • getSendAction

        protected javax.swing.Action getSendAction​(Client client)
        Description copied from class: SendActionManager
        Returns an action which can perform a single-client send associated with this object. If it implements equals (and hashCode) intelligently there will be efficiency advantages. The enabled status of such actions will be managed by this object.
        Specified by:
        getSendAction in class SendActionManager
        Parameters:
        client - recipient client
        Returns:
        action which sends to the given client