T - The topic typepublic class ListenableSubscriptionManager<T> extends SubscriptionManager<T>
All events are emitted from the domain of the executor
| Constructor and Description |
|---|
ListenableSubscriptionManager(Executor executor) |
ListenableSubscriptionManager(Executor executor,
SubscriptionValidator<T> validator) |
| Modifier and Type | Method and Description |
|---|---|
void |
addManagerListener(SubscriptionManagerListener<T> listener)
Add a listener to the manager
|
void |
dispose() |
protected void |
fireAdded(List<SubscriptionManagerListener<T>> listeners,
Set<T> topic) |
protected void |
fireRemoved(List<SubscriptionManagerListener<T>> listeners,
Set<T> topic) |
Set<T> |
getAllSubscribedTopics() |
void |
removeManagerListener(SubscriptionManagerListener<T> listener) |
protected void |
topicSubscriptionAdded(T topic)
Gets called when somebody subscribed to a topic that was not subscribed
before
|
protected void |
topicSubscriptionRemoved(T topic)
Get called when somebody unsubscribed from a topic and it was the last
subscription
|
getAllGrantedTopics, getSubscriptionCount, setSource, subscribe, subscribe, unsubscribe, unsubscribeAllpublic ListenableSubscriptionManager(Executor executor)
public ListenableSubscriptionManager(Executor executor, SubscriptionValidator<T> validator)
protected void topicSubscriptionAdded(T topic)
SubscriptionManagertopicSubscriptionAdded in class SubscriptionManager<T>topic - the topicprotected void topicSubscriptionRemoved(T topic)
SubscriptionManagertopicSubscriptionRemoved in class SubscriptionManager<T>topic - the topicpublic void addManagerListener(SubscriptionManagerListener<T> listener)
Adding the listener to the manager will trigger an initial call to
SubscriptionManagerListener.subscriptionsAdded(Set) with the
currently open topics.
listener - the listener to addpublic void removeManagerListener(SubscriptionManagerListener<T> listener)
protected void fireAdded(List<SubscriptionManagerListener<T>> listeners, Set<T> topic)
protected void fireRemoved(List<SubscriptionManagerListener<T>> listeners, Set<T> topic)
public void dispose()