Class SubscriptionRegistry


  • public class SubscriptionRegistry
    extends Object
    Thread-safe provision of a set of a subscription managers plus tracking mechanism.
    • Method Detail

      • addSubscription

        public void addSubscription​(SourceSubscriptionManager subscriptionManager)
        Adds a subscription to the subscription registry.
        Parameters:
        subscriptionManager - the subscription manager to add to the registy.
      • getSubscriptions

        public Map<String,​SourceSubscriptionManager> getSubscriptions()
        Returns a copied snapshot of all available subscription managers.
        Returns:
        all subscription managers as a copy.
      • registerObserver

        public void registerObserver​(Object observer)
        Registers an EventBus observer to enable tracking of subscription insertion and deletion.
        Parameters:
        observer - an observer with Subscribe annotated methods and the first argument of type SubscriptionAddedMessage or SubscriptionRemovedMessage.
        See Also:
        EventBus.register(Object)
      • unregisterObserver

        public void unregisterObserver​(Object observer)
        Removes an observer formerly registered via registerObserver(Object).
        Parameters:
        observer - the observer to unregister.
        See Also:
        EventBus.unregister(Object)