com.dxfeed.api.osub
Interface ObservableSubscriptionChangeListener


public interface ObservableSubscriptionChangeListener

The listener interface for receiving notifications on the changes of observed subscription. All methods on this interface are invoked while holding a lock on ObservableSubscription instance, thus all changes for a given subscription are synchronized with respect to each other.

Decorated symbols

The sets of symbols that are passed to symbolsAdded(Set) and symbolsRemoved(Set) are decorated depending on the actual implementation class of DXFeedSubscription. DXFeedTimeSeriesSubscription decorates original subscription symbols by wrapping them into instances of TimeSeriesSubscriptionSymbol class.

Equality of symbols

Symbols are compared using their equals method. When one symbol in subscription is replaced by the other one that is equal to it, then only symbolsAdded(Set) notification is emitted, even though the old instance of the symbol was removed from the set of subscribed symbols.

In particular, two instances of TimeSeriesSubscriptionSymbol objects are equal when their underlying symbols are equal, thus only one, most recently added, instance of TimeSeriesSubscriptionSymbol will be kept in the set of subscribed symbols and only symbolsAdded(Set) notification is emitted when subscription time changes.

Wildcard symbols

The set of symbols may contain WildcardSymbol.ALL object. See WildcardSymbol for details.


Method Summary
 void subscriptionClosed()
          Invoked after subscription is closed or when this listener is removed from the subscription.
 void symbolsAdded(Set<?> symbols)
          Invoked after a collection of symbols is added to a subscription.
 void symbolsRemoved(Set<?> symbols)
          Invoked after a collection of symbols is removed from a subscription.
 

Method Detail

symbolsAdded

void symbolsAdded(Set<?> symbols)
Invoked after a collection of symbols is added to a subscription. Subscription's set of symbols already includes added symbols when this method is invoked. The set of symbols is decorated.


symbolsRemoved

void symbolsRemoved(Set<?> symbols)
Invoked after a collection of symbols is removed from a subscription. Subscription's set of symbols already excludes removed symbols when this method is invoked. The set of symbols is decorated.


subscriptionClosed

void subscriptionClosed()
Invoked after subscription is closed or when this listener is removed from the subscription. DXPublisher subscription is considered to be closed when the corresponding DXEndpoint is closed.



Copyright © 2013 Devexperts. All Rights Reserved.