blob: 038816abfbfa25542024f5d69e6e5039df1773a9 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Apache Geode Native .NET Reference: Apache::Geode::Client::ICacheLoader&lt; TKey, TValue &gt; Interface Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Apache Geode Native .NET Reference
&#160;<span id="projectnumber">1.13.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00914.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">Apache::Geode::Client::ICacheLoader&lt; TKey, TValue &gt; Interface Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A data-loading application plug-in that can be installed on a region.
<a href="a00914.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac134d7bb955fb07205de87e3ec02e551"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00914.html#ac134d7bb955fb07205de87e3ec02e551">Close</a> (<a class="el" href="a01014.html">IRegion</a>&lt; TKey, TValue &gt;^ region)</td></tr>
<tr class="memdesc:ac134d7bb955fb07205de87e3ec02e551"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the region containing this callback is destroyed, when the cache is closed. <a href="#ac134d7bb955fb07205de87e3ec02e551">More...</a><br /></td></tr>
<tr class="separator:ac134d7bb955fb07205de87e3ec02e551"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab83b569c80f81ff132dd881e7e997590"><td class="memItemLeft" align="right" valign="top">TValue&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00914.html#ab83b569c80f81ff132dd881e7e997590">Load</a> (<a class="el" href="a01014.html">IRegion</a>&lt; TKey, TValue &gt;^ region, TKey key, Object^ callbackArgument)</td></tr>
<tr class="memdesc:ab83b569c80f81ff132dd881e7e997590"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loads a value. <a href="#ab83b569c80f81ff132dd881e7e997590">More...</a><br /></td></tr>
<tr class="separator:ab83b569c80f81ff132dd881e7e997590"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;class TKey, class TValue&gt;<br />
interface Apache::Geode::Client::ICacheLoader&lt; TKey, TValue &gt;</h3>
<p>A data-loading application plug-in that can be installed on a region. </p>
<p>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, <a class="el" href="a00381.html" title="This namespace contains all the Geode .NET classes and utility classes.">Geode</a> 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. </p>
<p>A cache loader is defined in the <a class="el" href="a01010.html" title="Defines attributes for configuring a region.">RegionAttributes</a>. </p>
<p>When Region.Get is called for a region entry that has a null value, the <a class="el" href="a00914.html#ab83b569c80f81ff132dd881e7e997590" title="Loads a value.">ICacheLoader.Load</a> method of the region's cache loader is invoked. The <code>Load</code> method creates the value for the desired key by performing an operation such as a database query. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="a01098.html#a9f3538bd7d5c4a885e5defc84234b0cb" title="Sets the cache loader for the RegionAttributes being created.">RegionAttributesFactory.SetCacheLoader</a>, <a class="el" href="a01010.html#aaed51d72dc1a777348e474a259ad93ff" title="Gets the cache loader for the region.">RegionAttributes.CacheLoader</a>, <a class="el" href="a00906.html" title="An application plug-in that can be installed on a region.">ICacheListener</a>, <a class="el" href="a00918.html" title="An application plug-in that can be installed on a region.">ICacheWriter</a></dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ac134d7bb955fb07205de87e3ec02e551"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac134d7bb955fb07205de87e3ec02e551">&#9670;&nbsp;</a></span>Close()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class TKey , class TValue &gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="a00914.html">Apache::Geode::Client::ICacheLoader</a>&lt; TKey, TValue &gt;::Close </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a01014.html">IRegion</a>&lt; TKey, TValue &gt;^&#160;</td>
<td class="paramname"><em>region</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Called when the region containing this callback is destroyed, when the cache is closed. </p>
<p>Implementations should clean up any external resources, such as database connections. Any runtime exceptions this method throws will be logged. </p>
<p>It is possible for this method to be called multiple times on a single callback instance, so implementations must be tolerant of this. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="a00410.html#ae4914b5a4b36ff81a81a91db5225019b" title="Terminates this object cache and releases all the local resources.">Cache.Close</a>, Region.DestroyRegion</dd></dl>
</div>
</div>
<a id="ab83b569c80f81ff132dd881e7e997590"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab83b569c80f81ff132dd881e7e997590">&#9670;&nbsp;</a></span>Load()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class TKey , class TValue &gt; </div>
<table class="memname">
<tr>
<td class="memname">TValue <a class="el" href="a00914.html">Apache::Geode::Client::ICacheLoader</a>&lt; TKey, TValue &gt;::Load </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a01014.html">IRegion</a>&lt; TKey, TValue &gt;^&#160;</td>
<td class="paramname"><em>region</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">TKey&#160;</td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Object^&#160;</td>
<td class="paramname"><em>callbackArgument</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Loads a value. </p>
<p>Application writers should implement this method to customize the loading of a value. </p>
<p>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. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">region</td><td>a Region for which this is called.</td></tr>
<tr><td class="paramname">key</td><td>the key for the cacheable</td></tr>
<tr><td class="paramname">callbackArgument</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the value supplied for this key, or null if no value can be supplied. If every available loader returns a null value, Region.Get will return null. </dd></dl>
<dl class="section see"><dt>See also</dt><dd>Region.Get</dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<HR><address style="align: right;"><small>Apache Geode C++ Cache .NET API Documentation</small></address>