Class SubscriptionList

    • Field Detail

      • subscriptions

        private java.util.List<Subscription> subscriptions
      • unsubscribed

        private volatile boolean unsubscribed
    • Constructor Detail

      • SubscriptionList

        public SubscriptionList()
        Constructs an empty SubscriptionList.
      • SubscriptionList

        public SubscriptionList​(Subscription... subscriptions)
        Constructs a SubscriptionList with the given initial child subscriptions.
        Parameters:
        subscriptions - the array of subscriptions to start with
      • SubscriptionList

        public SubscriptionList​(Subscription s)
        Constructs a SubscriptionList with the given initial child subscription.
        Parameters:
        s - the initial subscription instance
    • Method Detail

      • isUnsubscribed

        public boolean isUnsubscribed()
        Description copied from interface: Subscription
        Indicates whether this Subscription is currently unsubscribed.
        Specified by:
        isUnsubscribed in interface Subscription
        Returns:
        true if this Subscription is currently unsubscribed, false otherwise
      • add

        public void add​(Subscription s)
        Adds a new Subscription to this SubscriptionList if the SubscriptionList is not yet unsubscribed. If the SubscriptionList is unsubscribed, add will indicate this by explicitly unsubscribing the new Subscription as well.
        Parameters:
        s - the Subscription to add
      • unsubscribe

        public void unsubscribe()
        Unsubscribe from all of the subscriptions in the list, which stops the receipt of notifications on the associated Subscriber.
        Specified by:
        unsubscribe in interface Subscription
      • unsubscribeFromAll

        private static void unsubscribeFromAll​(java.util.Collection<Subscription> subscriptions)
      • clear

        public void clear()
      • hasSubscriptions

        public boolean hasSubscriptions()
        Returns true if this composite is not unsubscribed and contains subscriptions.
        Returns:
        true if this composite is not unsubscribed and contains subscriptions.