Interface ProxyMessageSender

  • All Known Implementing Classes:
    TcpConnection

    public interface ProxyMessageSender
    A ProxyMessageSender sends messages (ProxyMessage) to a client. Messages can be sent synchronously by directly calling send or asynchronously by executing a task (if allowed by the ProxyMessageSender).
    • Method Detail

      • send

        void send​(ProxyMessage msg)
           throws Exception
        Sends a message to the client.
        Parameters:
        msg - the message to be sent
        Throws:
        Exception - if an error occurs
      • isExecutor

        boolean isExecutor()
        States whether executing a task is allowed.
        Returns:
        true if executing a task is allowed; false otherwise.
      • execute

        void execute​(Runnable task)
        Executes a task.
        Parameters:
        task - task to be executed
      • close

        void close()
        Closes the connection used by this ProxyMessageSender to send messages to the client.