Collapse All Expand All

C#

Oracle® Coherence .NET API Reference
CacheEventFilter Class
Members See Also

Oracle® Coherence .NET API Reference Release 3.6.1
E18812-01
IFilter which evaluates the content of a CacheEventArgs object according to the specified criteria.

Namespace: Tangosol.Util.Filter
Assembly: Coherence (in Coherence.dll) Version: 3.6.1.0 (3.6.1.0)

# Syntax

C#
    public class CacheEventFilter : IFilter,
    	IPortableObject

# Remarks

This filter is intended to be used by various IObservableCache listeners that are interested in particular subsets of CacheEvent notifications emitted by the cache.

Usage examples:

- a filter that evaluates to true if an Employee object is inserted into a cache with a value of IsMarried property set to true.
  CopyC#

      new CacheEventFilter(CacheEventMask.Inserted,
      new EqualsFilter("IsMarried", true));

- a filter that evaluates to true if any object is removed from a cache.
  CopyC#

      new CacheEventFilter(CacheEventMask.Deleted);

- a filter that evaluates to true if there is an update to an Employee object where either an old or new value of LastName property equals to "Smith".
  CopyC#

      new CacheEventFilter(CacheEventMask.Updated,
      new EqualsFilter("LastName", "Smith"));

- a filter that is used to keep a cached keys collection result based on some cache filter up-to-date.
  CopyC#

      ICollection keys = new ArrayList();
      IFilter filterEvt = new CacheEventFilter(filterCache);
      ICacheListener listener = new TestListener();
      cache.AddCacheListener(listener, filterEvt, true);
      keys.AddAll(cache.GetKeys(filterCache));

# Inheritance Hierarchy

System..::.Object
Tangosol.Util.Filter..::.CacheEventFilter

# See Also

CacheEventFilter Members
Tangosol.Util.Filter Namespace
Tangosol.Util.Filter..::.ValueChangeEventFilter