VMware Tanzu GemFire Native .NET Reference 10.3.0
Apache::Geode::Client::CacheWriterAdapter< TKey, TValue > Class Template Reference

Utility class that implements all methods in ICacheWriter with empty implementations. More...

#include <CacheWriterAdapter.hpp>

Inherits Apache::Geode::Client::ICacheWriter< TKey, TValue >.

Public Member Functions

virtual bool BeforeCreate (EntryEvent< TKey, TValue >^ ev)
 Called before an entry is created. More...
 
virtual bool BeforeDestroy (EntryEvent< TKey, TValue >^ ev)
 Called before an entry is destroyed. More...
 
virtual bool BeforeRegionClear (RegionEvent< TKey, TValue >^ ev)
 Called before this region is cleared. More...
 
virtual bool BeforeRegionDestroy (RegionEvent< TKey, TValue >^ ev)
 Called before this region is destroyed. More...
 
virtual bool BeforeUpdate (EntryEvent< TKey, TValue >^ ev)
 Called before an entry is updated. More...
 
virtual void Close (IRegion< TKey, TValue >^ region)
 Called when the region containing this callback is destroyed, when the cache is closed. More...
 

Detailed Description

template<class TKey, class TValue>
class Apache::Geode::Client::CacheWriterAdapter< TKey, TValue >

Utility class that implements all methods in ICacheWriter with empty implementations.

Applications can subclass this class and only override the methods for the events of interest.

Member Function Documentation

◆ BeforeCreate()

template<class TKey , class TValue >
virtual bool Apache::Geode::Client::CacheWriterAdapter< TKey, TValue >::BeforeCreate ( EntryEvent< TKey, TValue >^  ev)
inlinevirtual

Called before an entry is created.

Entry creation is initiated by a Create, a Put, or a Get.

The CacheWriter can determine whether this value comes from a Get or not from Load. The entry being created may already exist in the local cache where this CacheWriter is installed, but it does not yet exist in the cache where the operation was initiated.

Parameters
evevent object associated with creating the entry
See also
Region.Create, Region.Put, Region.Get

Implements Apache::Geode::Client::ICacheWriter< TKey, TValue >.

◆ BeforeDestroy()

template<class TKey , class TValue >
virtual bool Apache::Geode::Client::CacheWriterAdapter< TKey, TValue >::BeforeDestroy ( EntryEvent< TKey, TValue >^  ev)
inlinevirtual

Called before an entry is destroyed.

The entry being destroyed may or may not exist in the local cache where the CacheWriter is installed. This method is not called as a result of expiration or Region.LocalDestroyRegion.

Parameters
evevent object associated with destroying the entry
See also
Region.Destroy

Implements Apache::Geode::Client::ICacheWriter< TKey, TValue >.

◆ BeforeRegionClear()

template<class TKey , class TValue >
virtual bool Apache::Geode::Client::CacheWriterAdapter< TKey, TValue >::BeforeRegionClear ( RegionEvent< TKey, TValue >^  ev)
inlinevirtual

Called before this region is cleared.

Implements Apache::Geode::Client::ICacheWriter< TKey, TValue >.

◆ BeforeRegionDestroy()

template<class TKey , class TValue >
virtual bool Apache::Geode::Client::CacheWriterAdapter< TKey, TValue >::BeforeRegionDestroy ( RegionEvent< TKey, TValue >^  ev)
inlinevirtual

Called before this region is destroyed.

Parameters
evevent object associated with destroying the region
See also
Region.DestroyRegion

Implements Apache::Geode::Client::ICacheWriter< TKey, TValue >.

◆ BeforeUpdate()

template<class TKey , class TValue >
virtual bool Apache::Geode::Client::CacheWriterAdapter< TKey, TValue >::BeforeUpdate ( EntryEvent< TKey, TValue >^  ev)
inlinevirtual

Called before an entry is updated.

The entry update is initiated by a Put or a Get that causes the loader to update an existing entry.

The entry previously existed in the cache where the operation was initiated, although the old value may have been null. The entry being updated may or may not exist in the local cache where the CacheWriter is installed.

Parameters
evevent object associated with updating the entry
See also
Region.Put, Region.Get

Implements Apache::Geode::Client::ICacheWriter< TKey, TValue >.

◆ Close()

template<class TKey , class TValue >
virtual void Apache::Geode::Client::CacheWriterAdapter< TKey, TValue >::Close ( IRegion< TKey, TValue >^  region)
inlinevirtual

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.

Parameters
regionregion to close
See also
Cache.Close, Region.DestroyRegion

Implements Apache::Geode::Client::ICacheWriter< TKey, TValue >.


Apache Geode C++ Cache .NET API Documentation