Pivotal GemFire Native .NET Reference
10.0.5
|
A data-loading application plug-in that can be installed on a region. More...
Public Member Functions | |
void | Close (IRegion< TKey, TValue >^ region) |
Called when the region containing this callback is destroyed, when the cache is closed. More... | |
TValue | Load (IRegion< TKey, TValue >^ region, TKey key, Object^ callbackArgument) |
Loads a value. More... | |
A data-loading application plug-in that can be installed on a region.
Loaders facilitate loading of data into the cache from a third-party data source. When an application does a lookup for a key in a region and it does not exist, Geode checks to see if any loaders are available for the region in the system and invokes them to get the value for the key into the cache.
A cache loader is defined in the RegionAttributes.
When Region.Get is called for a region entry that has a null value, the ICacheLoader.Load method of the region's cache loader is invoked. The Load
method creates the value for the desired key by performing an operation such as a database query.
void Apache::Geode::Client::ICacheLoader< TKey, TValue >::Close | ( | IRegion< TKey, TValue >^ | region | ) |
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.
TValue Apache::Geode::Client::ICacheLoader< TKey, TValue >::Load | ( | IRegion< TKey, TValue >^ | region, |
TKey | key, | ||
Object^ | callbackArgument | ||
) |
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 Region.Get that triggered this load.
region | a Region for which this is called. |
key | the key for the cacheable |
callbackArgument |