gemfire::ManagedCacheLoaderGeneric Class Reference


Detailed Description

Wraps the managed GemStone.GemFire.Cache.ICacheLoader object and implements the native gemfire::CacheLoader interface.

Public Member Functions

virtual void close (const RegionPtr &region)
virtual CacheablePtr load (const RegionPtr &region, const CacheableKeyPtr &key, const UserDataPtr &aCallbackArgument)
 ManagedCacheLoaderGeneric (Object^ userptr)

Static Public Member Functions

static
gemfire::CacheLoader * 
create (const char *assemblyPath, const char *factoryFunctionName)

Constructor & Destructor Documentation

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

Constructor to initialize with the provided managed object.

Parameters:
userptr The managed object.


Member Function Documentation

virtual void gemfire::ManagedCacheLoaderGeneric::close ( const RegionPtr &  region  )  [virtual]

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:
region the region pointer
See also:
GemStone.GemFire.Cache.Cache.Close, GemStone.GemFire.Cache.Region.DestroyRegion

static gemfire::CacheLoader* gemfire::ManagedCacheLoaderGeneric::create ( const char *  assemblyPath,
const char *  factoryFunctionName 
) [static]

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

Parameters:
assemblyPath The path of the managed assembly that contains the ICacheLoader factory function.
factoryFunctionName The name of the factory function of the managed class for creating an object that implements ICacheLoader. 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.

virtual CacheablePtr gemfire::ManagedCacheLoaderGeneric::load ( const RegionPtr &  region,
const CacheableKeyPtr &  key,
const UserDataPtr &  aCallbackArgument 
) [virtual]

Loads a value. Application writers should implement this method to customize the loading of a value.

This method is called by the caching service when the requested value is not in the cache. Any exception thrown by this method is propagated back to and thrown by the invocation of GemStone.GemFire.Cache.Region.Get that triggered this load.

Parameters:
region a Region Pointer for which this is called.
key the key for the cacheable
aCallbackArgument any related user data, or null
Returns:
the value supplied for this key, or null if no value can be supplied. If every available loader returns a null value, GemStone.GemFire.Cache.Region.Get will return null.
See also:
GemStone.GemFire.Cache.Region.Get


GemFire C++ Cache .NET API Documentation