Interface MessageEnvironment

    • Field Detail

      • MASTER_COMMUNICATION_ID

        static final java.lang.String MASTER_COMMUNICATION_ID
        See Also:
        Constant Field Values
      • RUNTIME_MASTER_MESSAGE_LISTENER_ID

        static final java.lang.String RUNTIME_MASTER_MESSAGE_LISTENER_ID
        See Also:
        Constant Field Values
      • BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID

        static final java.lang.String BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID
        See Also:
        Constant Field Values
      • PIPE_MANAGER_MASTER_MESSAGE_LISTENER_ID

        static final java.lang.String PIPE_MANAGER_MASTER_MESSAGE_LISTENER_ID
        See Also:
        Constant Field Values
      • EXECUTOR_MESSAGE_LISTENER_ID

        static final java.lang.String EXECUTOR_MESSAGE_LISTENER_ID
        See Also:
        Constant Field Values
    • Method Detail

      • setupListener

        <T> void setupListener​(java.lang.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​(java.lang.String listenerId)
        Remove the MessageListener bound to a specific listener ID.
        Parameters:
        listenerId - the ID of the listener to remove.
      • asyncConnect

        <T> java.util.concurrent.Future<MessageSender<T>> asyncConnect​(java.lang.String receiverId,
                                                                       java.lang.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 java.lang.Exception
        Close this message environment.
        Throws:
        java.lang.Exception - while closing
      • getId

        java.lang.String getId()
        Returns:
        identifier for this node