com.dxfeed.api.osub
Interface ObservableSubscription<T>

All Known Implementing Classes:
DXFeedSubscription, DXFeedTimeSeriesSubscription

public interface ObservableSubscription<T>

Observable subscription is a set subscription symbols for specific event types.


Method Summary
 void addChangeListener(ObservableSubscriptionChangeListener listener)
          Adds subscription change listener.
 boolean containsEventType(java.lang.Class<?> eventType)
          Returns true if this subscription contains the corresponding event type.
 java.util.Set<java.lang.Class<? extends T>> getEventTypes()
          Returns a set of event types for this subscription.
 boolean isClosed()
          Returns true if this subscription is closed.
 void removeChangeListener(ObservableSubscriptionChangeListener listener)
          Removes subscription change listener.
 

Method Detail

isClosed

boolean isClosed()
Returns true if this subscription is closed.


getEventTypes

java.util.Set<java.lang.Class<? extends T>> getEventTypes()
Returns a set of event types for this subscription. The resulting set cannot be modified.


containsEventType

boolean containsEventType(java.lang.Class<?> eventType)
Returns true if this subscription contains the corresponding event type.


addChangeListener

void addChangeListener(ObservableSubscriptionChangeListener listener)
Adds subscription change listener. This method does nothing if the given listener is already installed as subscription change listener for this subscription or if subscription is closed. Otherwise, it installs the corresponding listener and immediately invokes ObservableSubscriptionChangeListener#keysAdded on the given listener while holding the lock for this subscription. This way the given listener synchronously receives existing subscription state and and is synchronously notified on all changes in subscription afterwards.

Parameters:
listener - the subscription change listener.
Throws:
java.lang.NullPointerException - if listener is null.

removeChangeListener

void removeChangeListener(ObservableSubscriptionChangeListener listener)
Removes subscription change listener. This method does nothing if the given listener was not installed or was already removed as subscription change listener for this subscription. Otherwise it removes the corresponding listener and immediately invokes ObservableSubscriptionChangeListener.subscriptionClosed() on the given listener while holding the lock for this subscription.

Parameters:
listener - the subscription change listener.
Throws:
java.lang.NullPointerException - if listener is null.