Class AbstractPubSubSupport<T>

    • Constructor Detail

      • AbstractPubSubSupport

        public AbstractPubSubSupport​(IBusConfiguration configuration)
    • Method Detail

      • unsubscribe

        public boolean unsubscribe​(java.lang.Object listener)
        Description copied from interface: PubSubSupport
        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.

        Specified by:
        unsubscribe in interface PubSubSupport<T>
        Returns:
        true, if the listener was found and successfully removed false otherwise
      • subscribe

        public void subscribe​(java.lang.Object listener)
        Description copied from interface: PubSubSupport
        Subscribe all handlers of the given listener. Any listener is only subscribed once -> subsequent subscriptions of an already subscribed listener will be silently ignored
        Specified by:
        subscribe in interface PubSubSupport<T>
      • createMessagePublication

        protected MessagePublication createMessagePublication​(T message)
      • getSubscriptionsByMessageType

        protected java.util.Collection<Subscription> getSubscriptionsByMessageType​(java.lang.Class messageType)
      • handlePublicationError

        protected void handlePublicationError​(PublicationError error)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object