VMware Tanzu GemFire Native .NET Reference 10.3.0
Apache::Geode::Client::ICqListener< TKey, TResult > Interface Template Reference

An application plug-in that can be installed on a region. More...

#include <ICqListener.hpp>

Inherited by Apache::Geode::Client::ICqStatusListener< TKey, TResult >.

Public Member Functions

void Close ()
 Called when the region containing this callback is destroyed, when the cache is closed. More...
 
void Close ()
 Called when the region containing this callback is destroyed, when the cache is closed. More...
 
void OnError (CqEvent< TKey, TResult >^ ev)
 Handles the event of an entry's value being modified in a region. More...
 
void OnError (CqEvent^ ev)
 Handles the event of an entry's value being modified in a region. More...
 
void OnEvent (CqEvent< TKey, TResult >^ ev)
 Handles the event of a new key being added to a region. More...
 
void OnEvent (CqEvent^ ev)
 Handles the event of a new key being added to a region. More...
 

Detailed Description

template<class TKey, class TResult>
interface Apache::Geode::Client::ICqListener< TKey, TResult >

An application plug-in that can be installed on a region.

Listener change notifications are invoked after the change has occured.

Listeners receive notifications when entries in a region change or changes occur to the region attributes themselves.

A cache listener is defined in the RegionAttributes.

The methods on a ICacheListener are invoked asynchronously. Multiple events can cause concurrent invocation of ICacheListener methods. If event A occurs before event B, there is no guarantee that their corresponding ICacheListener method invocations will occur in the same order. Any exceptions thrown by the listener are caught by Geode and logged.

Listeners are user callbacks that are invoked by Geode. It is important to ensure that minimal work is done in the listener before returning control back to Geode. For example, a listener implementation may choose to hand off the event to a thread pool that then processes the event on its thread rather than the listener thread

See also
RegionAttributesFactory.SetCacheListener, RegionAttributes.CacheListener, ICacheLoader, ICacheWriter

Member Function Documentation

◆ Close() [1/2]

template<class TKey , class TResult >
void Apache::Geode::Client::ICqListener< TKey, TResult >::Close ( )

Called when the region containing this callback is destroyed, when the cache is closed.

Implementations should clean up any external resources, such as database connections. Any runtime exceptions this method throws will be logged.

It is possible for this method to be called multiple times on a single callback instance, so implementations must be tolerant of this.

See also
Cache.Close, Region.DestroyRegion

◆ Close() [2/2]

template<class TKey , class TResult >
void Apache::Geode::Client::ICqListener< TKey, TResult >::Close ( )

Called when the region containing this callback is destroyed, when the cache is closed.

Implementations should clean up any external resources, such as database connections. Any runtime exceptions this method throws will be logged.

It is possible for this method to be called multiple times on a single callback instance, so implementations must be tolerant of this.

See also
Cache.Close, Region.DestroyRegion

◆ OnError() [1/2]

template<class TKey , class TResult >
void Apache::Geode::Client::ICqListener< TKey, TResult >::OnError ( CqEvent< TKey, TResult >^  ev)

Handles the event of an entry's value being modified in a region.

This entry previously existed in this region in the local cache, but its previous value may have been null.

Parameters
evEntryEvent denotes the event object associated with updating the entry.
See also
Region.Put

◆ OnError() [2/2]

template<class TKey , class TResult >
void Apache::Geode::Client::ICqListener< TKey, TResult >::OnError ( CqEvent ev)

Handles the event of an entry's value being modified in a region.

This entry previously existed in this region in the local cache, but its previous value may have been null.

Parameters
evEntryEvent denotes the event object associated with updating the entry.
See also
Region.Put

◆ OnEvent() [1/2]

template<class TKey , class TResult >
void Apache::Geode::Client::ICqListener< TKey, TResult >::OnEvent ( CqEvent< TKey, TResult >^  ev)

Handles the event of a new key being added to a region.

The entry did not previously exist in this region in the local cache (even with a null value).

This function does not throw any exception.

Parameters
evDenotes the event object associated with the entry creation.
See also
Region.Create, Region.Put, Region.Get

◆ OnEvent() [2/2]

template<class TKey , class TResult >
void Apache::Geode::Client::ICqListener< TKey, TResult >::OnEvent ( CqEvent ev)

Handles the event of a new key being added to a region.

The entry did not previously exist in this region in the local cache (even with a null value).

This function does not throw any exception.

Parameters
evDenotes the event object associated with the entry creation.
See also
Region.Create, Region.Put, Region.Get

Apache Geode C++ Cache .NET API Documentation