Interface PubSubSupport<T>

    • Method Detail

      • subscribe

        void subscribe​(java.lang.Object listener)
        Subscribe all handlers of the given listener. Any listener is only subscribed once -> subsequent subscriptions of an already subscribed listener will be silently ignored
        Parameters:
        listener -
      • unsubscribe

        boolean unsubscribe​(java.lang.Object listener)
        Immediately remove all registered message handlers (if any) of the given listener. When this call returns all handlers have effectively been removed and will not receive any messages (provided that running publications (iterators) in other threads have not yet obtained a reference to the listener)

        A call to this method passing any object that is not subscribed will not have any effect and is silently ignored.

        Parameters:
        listener -
        Returns:
        true, if the listener was found and successfully removed false otherwise
      • publish

        IMessagePublication publish​(T message)
        Synchronously publish a message to all registered listeners. This includes listeners defined for super types of the given message type, provided they are not configured to reject valid subtype. The call returns when all matching handlers of all registered listeners have been notified (invoked) of the message.
        Parameters:
        message -