Interface MessageEnvironment

    • Method Detail

      • setupListener

        <T> void setupListener​(String listenerId,
                               MessageListener<T> listener)
        Set up a MessageListener with a listener id.
        Type Parameters:
        T - The type of the message to be sent in the environment
        Parameters:
        listenerId - an identifier of the message listener
        listener - a message listener
      • removeListener

        void removeListener​(String listenerId)
        Remove the MessageListener bound to a specific listener ID.
        Parameters:
        listenerId - the ID of the listener to remove.
      • asyncConnect

        <T> Future<MessageSender<T>> asyncConnect​(String receiverId,
                                                  String listenerId)
        Asynchronously connect to the node called receiverId and return a future of MessageSender that sends messages to the listener with listenerId.
        Type Parameters:
        T - The type of the message to be sent in the environment
        Parameters:
        receiverId - a receiver id
        listenerId - an identifier of the message listener
        Returns:
        a message sender
      • close

        void close()
            throws Exception
        Close this message environment.
        Throws:
        Exception - while closing
      • getId

        String getId()
        Returns:
        identifier for this node