gemfire::ManagedCacheWriterGeneric Class Reference


Detailed Description

Wraps the managed GemStone.GemFire.Cache.ICacheWriter object and implements the native gemfire::CacheWriter interface.

Public Member Functions

bool beforeCreate (const EntryEvent &ev)
bool beforeDestroy (const EntryEvent &ev)
bool beforeRegionClear (const RegionEvent &ev)
bool beforeRegionDestroy (const RegionEvent &ev)
bool beforeUpdate (const EntryEvent &ev)
void close (const RegionPtr &rp)
 ManagedCacheWriterGeneric (Object^ userptr)
GemStone::GemFire::Cache::ICacheWriterptr () const

Static Public Member Functions

static CacheWriter * create (const char *assemblyPath, const char *factoryFunctionName)

Constructor & Destructor Documentation

gemfire::ManagedCacheWriterGeneric::ManagedCacheWriterGeneric ( Object^   userptr  )  [inline]

Constructor to initialize with the provided managed object.

Parameters:
userptr The managed object.


Member Function Documentation

bool gemfire::ManagedCacheWriterGeneric::beforeCreate ( const EntryEvent &  ev  ) 

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:
ev EntryEvent denotes the event object associated with creating the entry
See also:
GemStone.GemFire.Cache.Region.Create, GemStone.GemFire.Cache.Region.Put, GemStone.GemFire.Cache.Region.Get

bool gemfire::ManagedCacheWriterGeneric::beforeDestroy ( const EntryEvent &  ev  ) 

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 GemStone.GemFire.Cache.Region.LocalDestroyRegion.

Parameters:
ev EntryEvent denotes the event object associated with destroying the entry
See also:
GemStone.GemFire.Cache.Region.Destroy

bool gemfire::ManagedCacheWriterGeneric::beforeRegionClear ( const RegionEvent &  ev  ) 

called before this region is cleared

bool gemfire::ManagedCacheWriterGeneric::beforeRegionDestroy ( const RegionEvent &  ev  ) 

called before this region is destroyed

Parameters:
ev RegionEvent denotes the event object associated with destroying the region
See also:
GemStone.GemFire.Cache.Region.DestroyRegion

bool gemfire::ManagedCacheWriterGeneric::beforeUpdate ( const EntryEvent &  ev  ) 

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:
ev EntryEvent denotes the event object associated with updating the entry
See also:
GemStone.GemFire.Cache.Region.Put, GemStone.GemFire.Cache.Region.Get

void gemfire::ManagedCacheWriterGeneric::close ( const RegionPtr &  rp  ) 

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:
GemStone.GemFire.Cache.Cache.Close, GemStone.GemFire.Cache.Region.DestroyRegion

static CacheWriter* gemfire::ManagedCacheWriterGeneric::create ( const char *  assemblyPath,
const char *  factoryFunctionName 
) [static]

Static function to create a ManagedCacheWriter using given managed assembly path and given factory function.

Parameters:
assemblyPath The path of the managed assembly that contains the ICacheWriter factory function.
factoryFunctionName The name of the factory function of the managed class for creating an object that implements ICacheWriter. This should be a static function of the format {Namespace}.{Class Name}.{Method Name}.
Exceptions:
IllegalArgumentException If the managed library cannot be loaded or the factory function fails.

GemStone::GemFire::Cache::ICacheWriter ^ gemfire::ManagedCacheWriterGeneric::ptr (  )  const [inline]

Returns the wrapped managed object reference.


GemFire C++ Cache .NET API Documentation