Class Listeners
Provide a simple, efficient, and thread-safe implementation of a list of event listeners.
Inherited Members
Namespace: Tangosol.Util
Assembly: Coherence.dll
Syntax
[Serializable]
public class Listeners
Remarks
The implementation is optimized based on the assumption that listeners are added and removed relatively rarely, and that the list of listeners is requested relatively often.
Thread safety is implemented by synchronizing on all methods that modify any data member of the class. Read-only methods are not synchronized.
Properties
FiltersArray
Get the filters for this listener.
Declaration
public virtual IFilter[] FiltersArray { get; set; }
Property Value
Type | Description |
---|---|
IFilter[] | The list of filters. |
IsEmpty
Check if there are no listeners.
Declaration
public virtual bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool | true if there are no listeners. |
ListenersArray
Get the list of listeners.
Declaration
public virtual ICacheListener[] ListenersArray { get; }
Property Value
Type | Description |
---|---|
ICacheListener[] | The list of listeners. |
Remarks
The contents of this array are immutable; to add or remove listeners, a copy of this array is made and the new array replaces the old.
Methods
Add(ICacheListener)
Add a listener.
Declaration
public virtual void Add(ICacheListener listener)
Parameters
Type | Name | Description |
---|---|---|
ICacheListener | listener | The ICacheListener to add. |
AddAll(Listeners)
Add all listeners from another Listeners object.
Declaration
public virtual void AddAll(Listeners listeners)
Parameters
Type | Name | Description |
---|---|---|
Listeners | listeners | The Listeners to add. |
Contains(ICacheListener)
Check if a listener is in the list of listeners.
Declaration
public virtual bool Contains(ICacheListener listener)
Parameters
Type | Name | Description |
---|---|---|
ICacheListener | listener | The ICacheListener to search for. |
Returns
Type | Description |
---|---|
bool | true if the listener is in the list of listeners. |
Remove(ICacheListener)
Remove a listener.
Declaration
public virtual void Remove(ICacheListener listener)
Parameters
Type | Name | Description |
---|---|---|
ICacheListener | listener | The ICacheListener to remove. |
RemoveAll()
Remove all listeners.
Declaration
public virtual void RemoveAll()
ToString()
Return a string representation of the Listeners object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string representation of the Listeners object. |