blob: 238f10461443bf969142f43bd1f083af0f8c61e3 [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::ICacheWriter&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.0</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('a00918.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::ICacheWriter&lt; TKey, TValue &gt; Interface Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>An application plug-in that can be installed on a region.
<a href="a00918.html#details">More...</a></p>
<p>Inherited by <a class="el" href="a00554.html">Apache::Geode::Client::CacheWriterAdapter&lt; TKey, TValue &gt;</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:a304aec2a3a786a6a1b6081e403ac468c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00918.html#a304aec2a3a786a6a1b6081e403ac468c">BeforeCreate</a> (<a class="el" href="a00618.html">EntryEvent</a>&lt; TKey, TValue &gt;^ ev)</td></tr>
<tr class="memdesc:a304aec2a3a786a6a1b6081e403ac468c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called before an entry is created. <a href="#a304aec2a3a786a6a1b6081e403ac468c">More...</a><br /></td></tr>
<tr class="separator:a304aec2a3a786a6a1b6081e403ac468c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a643b6dbda145061fd3df36c7368fdf"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00918.html#a2a643b6dbda145061fd3df36c7368fdf">BeforeDestroy</a> (<a class="el" href="a00618.html">EntryEvent</a>&lt; TKey, TValue &gt;^ ev)</td></tr>
<tr class="memdesc:a2a643b6dbda145061fd3df36c7368fdf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called before an entry is destroyed. <a href="#a2a643b6dbda145061fd3df36c7368fdf">More...</a><br /></td></tr>
<tr class="separator:a2a643b6dbda145061fd3df36c7368fdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf421b26ca2aaebde9ff08f9ca1a3cc2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00918.html#adf421b26ca2aaebde9ff08f9ca1a3cc2">BeforeRegionClear</a> (<a class="el" href="a01102.html">RegionEvent</a>&lt; TKey, TValue &gt;^ ev)</td></tr>
<tr class="memdesc:adf421b26ca2aaebde9ff08f9ca1a3cc2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called before this region is cleared. <a href="#adf421b26ca2aaebde9ff08f9ca1a3cc2">More...</a><br /></td></tr>
<tr class="separator:adf421b26ca2aaebde9ff08f9ca1a3cc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad61b2e507a3e77455a4979f01e4f0fca"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00918.html#ad61b2e507a3e77455a4979f01e4f0fca">BeforeRegionDestroy</a> (<a class="el" href="a01102.html">RegionEvent</a>&lt; TKey, TValue &gt;^ ev)</td></tr>
<tr class="memdesc:ad61b2e507a3e77455a4979f01e4f0fca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called before this region is destroyed. <a href="#ad61b2e507a3e77455a4979f01e4f0fca">More...</a><br /></td></tr>
<tr class="separator:ad61b2e507a3e77455a4979f01e4f0fca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afcbf2c234449adf36f4e437d71fcd52c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00918.html#afcbf2c234449adf36f4e437d71fcd52c">BeforeUpdate</a> (<a class="el" href="a00618.html">EntryEvent</a>&lt; TKey, TValue &gt;^ ev)</td></tr>
<tr class="memdesc:afcbf2c234449adf36f4e437d71fcd52c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called before an entry is updated. <a href="#afcbf2c234449adf36f4e437d71fcd52c">More...</a><br /></td></tr>
<tr class="separator:afcbf2c234449adf36f4e437d71fcd52c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaace5d635e985e37362dfa925cd033f0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00918.html#aaace5d635e985e37362dfa925cd033f0">Close</a> (<a class="el" href="a01014.html">IRegion</a>&lt; TKey, TValue &gt;^ region)</td></tr>
<tr class="memdesc:aaace5d635e985e37362dfa925cd033f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the region containing this callback is destroyed, when the cache is closed. <a href="#aaace5d635e985e37362dfa925cd033f0">More...</a><br /></td></tr>
<tr class="separator:aaace5d635e985e37362dfa925cd033f0"><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::ICacheWriter&lt; TKey, TValue &gt;</h3>
<p>An application plug-in that can be installed on a region. </p>
<p>Defines methods that are called <b>before</b> entry modification, such as writing the value to a database. </p>
<p>A distributed region will typically have a single cache writer. If the application is designed such that all or most updates to a region occur on a node, the cache writer for the region should be installed at that node. </p>
<p>A cache writer is defined in the <a class="el" href="a01010.html" title="Defines attributes for configuring a region.">RegionAttributes</a>. </p>
<p><a class="el" href="a00410.html" title="Provides a distributed cache.">Cache</a> writer invocations are initiated by the node where the entry or region modification occurs. </p>
<p>Before a region is updated via a put, create, or destroy operation, <a class="el" href="a00381.html" title="This namespace contains all the Geode .NET classes and utility classes.">Geode</a> will call an <code><a class="el" href="a00918.html" title="An application plug-in that can be installed on a region.">ICacheWriter</a></code> that is installed anywhere in any participating cache for that region, preferring a local <code><a class="el" href="a00918.html" title="An application plug-in that can be installed on a region.">ICacheWriter</a></code> if there is one. Usually there will be only one <code><a class="el" href="a00918.html" title="An application plug-in that can be installed on a region.">ICacheWriter</a></code> in the distributed system. If there are multiple <code><a class="el" href="a00918.html" title="An application plug-in that can be installed on a region.">ICacheWriter</a></code>s available in the distributed system, the <a class="el" href="a00381.html" title="This namespace contains all the Geode .NET classes and utility classes.">Geode</a> implementation always prefers one that is stored locally, or else picks one arbitrarily. In any case, only one <code><a class="el" href="a00918.html" title="An application plug-in that can be installed on a region.">ICacheWriter</a></code> will be invoked. </p>
<p>The typical use for a <code><a class="el" href="a00918.html" title="An application plug-in that can be installed on a region.">ICacheWriter</a></code> is to update a database. Application writers should implement these methods to execute application-specific behavior before the cache is modified. </p>
<p>Note that cache writer callbacks are synchronous callbacks and have the ability to veto the cache update. Since cache writer invocations require communications over the network, (especially if they are not co-located on the nodes where the change occurs) the use of cache writers presents a performance penalty. </p>
<p>The <code><a class="el" href="a00918.html" title="An application plug-in that can be installed on a region.">ICacheWriter</a></code> is capable of aborting the update to the cache by throwing a <code><a class="el" href="a00654.html" title="Thrown when the cache writer aborts the operation.">CacheWriterException</a></code>. This exception or any runtime exception thrown by the <code><a class="el" href="a00918.html" title="An application plug-in that can be installed on a region.">ICacheWriter</a></code> will abort the operation, and the exception will be propagated to the initiator of the operation, regardless of whether the initiator is in the same process as the <code><a class="el" href="a00918.html" title="An application plug-in that can be installed on a region.">ICacheWriter</a></code>. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="a01098.html#a5acd87ead880f53e6b64e3b3620338d6" title="Sets the cache writer for the RegionAttributes being created.">RegionAttributesFactory.SetCacheWriter</a>, <a class="el" href="a01010.html#aacb4efa0e2abdec427815286ed7d8d02" title="Gets the cache writer for the region.">RegionAttributes.CacheWriter</a>, <a class="el" href="a00914.html" title="A data-loading application plug-in that can be installed on a region.">ICacheLoader</a>, <a class="el" href="a00906.html" title="An application plug-in that can be installed on a region.">ICacheListener</a></dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a304aec2a3a786a6a1b6081e403ac468c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a304aec2a3a786a6a1b6081e403ac468c">&#9670;&nbsp;</a></span>BeforeCreate()</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">bool <a class="el" href="a00918.html">Apache::Geode::Client::ICacheWriter</a>&lt; TKey, TValue &gt;::BeforeCreate </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00618.html">EntryEvent</a>&lt; TKey, TValue &gt;^&#160;</td>
<td class="paramname"><em>ev</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Called before an entry is created. </p>
<p>Entry creation is initiated by a <code>Create</code>, a <code>Put</code>, or a <code>Get</code>. </p>
<p>The <code>CacheWriter</code> can determine whether this value comes from a <code>Get</code> or not from <code>Load</code>. The entry being created may already exist in the local cache where this <code>CacheWriter</code> is installed, but it does not yet exist in the cache where the operation was initiated. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ev</td><td>event object associated with creating the entry </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd>Region.Create, Region.Put, Region.Get</dd></dl>
<p>Implemented in <a class="el" href="a00554.html#a475817fa87a09ed2cd57ca747ad7dfb5">Apache::Geode::Client::CacheWriterAdapter&lt; TKey, TValue &gt;</a>.</p>
</div>
</div>
<a id="a2a643b6dbda145061fd3df36c7368fdf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a643b6dbda145061fd3df36c7368fdf">&#9670;&nbsp;</a></span>BeforeDestroy()</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">bool <a class="el" href="a00918.html">Apache::Geode::Client::ICacheWriter</a>&lt; TKey, TValue &gt;::BeforeDestroy </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00618.html">EntryEvent</a>&lt; TKey, TValue &gt;^&#160;</td>
<td class="paramname"><em>ev</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Called before an entry is destroyed. </p>
<p>The entry being destroyed may or may not exist in the local cache where the CacheWriter is installed. This method is <em>not</em> called as a result of expiration or Region.LocalDestroyRegion. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ev</td><td>event object associated with destroying the entry </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="a00382.html#a30c72f6219e29e7305222feb4857caeca0e181f89f47654b86f3beb42f5cc08b8" title="When the region or cached object expires, it is destroyed.">Region.Destroy</a></dd></dl>
<p>Implemented in <a class="el" href="a00554.html#a1cc175e0d60780c1d922c38806b4bf95">Apache::Geode::Client::CacheWriterAdapter&lt; TKey, TValue &gt;</a>.</p>
</div>
</div>
<a id="adf421b26ca2aaebde9ff08f9ca1a3cc2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adf421b26ca2aaebde9ff08f9ca1a3cc2">&#9670;&nbsp;</a></span>BeforeRegionClear()</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">bool <a class="el" href="a00918.html">Apache::Geode::Client::ICacheWriter</a>&lt; TKey, TValue &gt;::BeforeRegionClear </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a01102.html">RegionEvent</a>&lt; TKey, TValue &gt;^&#160;</td>
<td class="paramname"><em>ev</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Called before this region is cleared. </p>
<p>Implemented in <a class="el" href="a00554.html#ac9403957b0e13c4999b4445aad31bba8">Apache::Geode::Client::CacheWriterAdapter&lt; TKey, TValue &gt;</a>.</p>
</div>
</div>
<a id="ad61b2e507a3e77455a4979f01e4f0fca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad61b2e507a3e77455a4979f01e4f0fca">&#9670;&nbsp;</a></span>BeforeRegionDestroy()</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">bool <a class="el" href="a00918.html">Apache::Geode::Client::ICacheWriter</a>&lt; TKey, TValue &gt;::BeforeRegionDestroy </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a01102.html">RegionEvent</a>&lt; TKey, TValue &gt;^&#160;</td>
<td class="paramname"><em>ev</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Called before this region is destroyed. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ev</td><td>event object associated with destroying the region </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd>Region.DestroyRegion</dd></dl>
<p>Implemented in <a class="el" href="a00554.html#af4df7e20a0d35739a5d8d4e41be714f2">Apache::Geode::Client::CacheWriterAdapter&lt; TKey, TValue &gt;</a>.</p>
</div>
</div>
<a id="afcbf2c234449adf36f4e437d71fcd52c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afcbf2c234449adf36f4e437d71fcd52c">&#9670;&nbsp;</a></span>BeforeUpdate()</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">bool <a class="el" href="a00918.html">Apache::Geode::Client::ICacheWriter</a>&lt; TKey, TValue &gt;::BeforeUpdate </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00618.html">EntryEvent</a>&lt; TKey, TValue &gt;^&#160;</td>
<td class="paramname"><em>ev</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Called before an entry is updated. </p>
<p>The entry update is initiated by a <code>Put</code> or a <code>Get</code> that causes the loader to update an existing entry. </p>
<p>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. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ev</td><td>event object associated with updating the entry </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd>Region.Put, Region.Get</dd></dl>
<p>Implemented in <a class="el" href="a00554.html#a0e0eb26baa33385c8ea6cab0fb628d99">Apache::Geode::Client::CacheWriterAdapter&lt; TKey, TValue &gt;</a>.</p>
</div>
</div>
<a id="aaace5d635e985e37362dfa925cd033f0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaace5d635e985e37362dfa925cd033f0">&#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="a00918.html">Apache::Geode::Client::ICacheWriter</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="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">region</td><td>region to close</td></tr>
</table>
</dd>
</dl>
<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>
<p>Implemented in <a class="el" href="a00554.html#ab53df2f5c01450756386c8bac5f34847">Apache::Geode::Client::CacheWriterAdapter&lt; TKey, TValue &gt;</a>.</p>
</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>