![]() |
Diffusion .NET Classic API - Core and Common
5.9.4
|
Topic listeners cache. More...
Public Member Functions | |
void | TopicDeleted (string topicName) |
Notifies the deletion of a topic. More... | |
override string | ToString () |
Returns a human-readable string form of this object. More... | |
void | AddPriorityTopicListener (string topicName, ITopicListener listener) |
Add a listener to the map of priority listeners. More... | |
void | AddTopicListener (ITopicListener listener, TopicSet topicSet, bool hasPriority=false) |
Add a topic listener for a TopicSet. More... | |
void | AddTopicListener (ITopicListener listener, bool hasPriority=false, params string[] topicPatterns) |
Add a topic listener for one or more patterns. More... | |
bool | RemoveTopicListener (ITopicListener topicListener) |
Removes a topic listener. More... | |
bool | NotifyListeners (IMessageSource messageSource, ITopicMessage message) |
Notify all listeners that apply to the logic of the supplied message. More... | |
void | ClearCache () |
Clear the cache. More... | |
Properties | |
bool | HasTopicListeners [get, set] |
Flag to see if we are actually using topic listeners and thus saving time if we are not. More... | |
Topic listeners cache.
This maintains topic listeners for anything that might need them.
It also provides a notification method which may be used to route a message (copying each time) to all listeners that want it.
There is an ITopicDeletionListener so that it may be notified of removals from a TopicTree so that it can keep its cache tidy.
Where there is no topic tree to do this, then the TopicDeleted method can be called directly when a topic cache entry is to be removed.
void PushTechnology.DiffusionCore.Messaging.Topic.TopicListeners.AddPriorityTopicListener | ( | string | topicName, |
ITopicListener | listener | ||
) |
Add a listener to the map of priority listeners.
Such listeners can be added only by topic name and not by selector as they are only used for command topic handlers.
topicName | |
listener |
void PushTechnology.DiffusionCore.Messaging.Topic.TopicListeners.AddTopicListener | ( | ITopicListener | listener, |
TopicSet | topicSet, | ||
bool | hasPriority = false |
||
) |
Add a topic listener for a TopicSet.
listener | The listener. |
topicSet | The topic patterns. |
hasPriority | Determines whether this topic listener should be placed at the beginning of the list. |
void PushTechnology.DiffusionCore.Messaging.Topic.TopicListeners.AddTopicListener | ( | ITopicListener | listener, |
bool | hasPriority = false , |
||
params string[] | topicPatterns | ||
) |
Add a topic listener for one or more patterns.
listener | The listener. |
hasPriority | Determines whether this topic listener should be placed at the beginning of the list. |
topicPatterns | The patterns. |
void PushTechnology.DiffusionCore.Messaging.Topic.TopicListeners.ClearCache | ( | ) |
Clear the cache.
bool PushTechnology.DiffusionCore.Messaging.Topic.TopicListeners.NotifyListeners | ( | IMessageSource | messageSource, |
ITopicMessage | message | ||
) |
Notify all listeners that apply to the logic of the supplied message.
messageSource | The source of the message. |
message | The message. |
bool PushTechnology.DiffusionCore.Messaging.Topic.TopicListeners.RemoveTopicListener | ( | ITopicListener | topicListener | ) |
Removes a topic listener.
This searches the selector to listener map for any occurrence that points to the listener and removes it. It also updates the cache accordingly.
topicListener | The listener to remove. |
void PushTechnology.DiffusionCore.Messaging.Topic.TopicListeners.TopicDeleted | ( | string | topicName | ) |
Notifies the deletion of a topic.
This is called on deletion of every topic.
topicName | The full name of the deleted topic. |
Implements PushTechnology.DiffusionCore.Messaging.Topic.ITopicDeletionListener.
override string PushTechnology.DiffusionCore.Messaging.Topic.TopicListeners.ToString | ( | ) |
Returns a human-readable string form of this object.
|
getset |
Flag to see if we are actually using topic listeners and thus saving time if we are not.