This is an automated email from the ASF dual-hosted git repository.

dbarnes pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new a001151  GEODE-4728: Docs - Update region creation examples
a001151 is described below

commit a001151cc6a85f5057f043219006a575e2f7ebc5
Author: Dave Barnes <[email protected]>
AuthorDate: Wed Apr 25 13:17:08 2018 -0700

    GEODE-4728: Docs - Update region creation examples
---
 .../client-cache/cache-init-file.html.md.erb       |  32 +++----
 docs/geode-native-docs/regions/regions.html.md.erb | 106 +++++++++++++++------
 2 files changed, 91 insertions(+), 47 deletions(-)

diff --git a/docs/geode-native-docs/client-cache/cache-init-file.html.md.erb 
b/docs/geode-native-docs/client-cache/cache-init-file.html.md.erb
index e6f1385..90f41bc 100644
--- a/docs/geode-native-docs/client-cache/cache-init-file.html.md.erb
+++ b/docs/geode-native-docs/client-cache/cache-init-file.html.md.erb
@@ -45,36 +45,36 @@ Specific information about cache and region attributes is 
in [Region Attributes]
 
 For information on using a cache with a server pool, see [Using Connection 
Pools](../connection-pools/connection-pools.html). The example below shows a 
`cache.xml` file that creates a region.
 
-``` pre
+``` xml
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE cache PUBLIC
-    "-//Example Systems, Inc.//Example Declarative Caching 1.0//EN"
-    "http://geode.apache.org/schema/cache/cache-1.0.xsd";>
-<!-- Sample cache.xml file -->
-<!-- Example Declarative Cache Initialization with cache.xml -->
-<cache>
+<client-cache
+    xmlns="http://geode.apache.org/schema/cpp-cache";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xsi:schemaLocation="http://geode.apache.org/schema/cpp-cache
+                        
http://geode.apache.org/schema/cpp-cache/cpp-cache-1.0.xsd";
+    version="1.0">
     <pool name="examplePool" subscription-enabled="true">
         <server host="localhost" port="24680" />
     </pool>
     <region name="root1" refid="CACHING_PROXY">
         <region-attributes pool-name="examplePool"
-            initial-capacity="25"
-            load-factor="0.32"
-            concurrency-level="10"
-            lru-entries-limit="35">
+                initial-capacity="25"
+                load-factor="0.32"
+                concurrency-level="10"
+                lru-entries-limit="35">
             <region-idle-time>
-                <expiration-attributes timeout="20" action="destroy"/>
+                <expiration-attributes timeout="20s" action="destroy"/>
             </region-idle-time>
             <entry-idle-time>
-                <expiration-attributes timeout="10" action="invalidate"/>
+                <expiration-attributes timeout="10s" action="invalidate"/>
             </entry-idle-time>
             <region-time-to-live>
-                <expiration-attributes timeout="5" action="local-destroy"/>
+                <expiration-attributes timeout="5s" action="local-destroy"/>
             </region-time-to-live>
             <entry-time-to-live>
-                <expiration-attributes timeout="10" action="local-invalidate"/>
+                <expiration-attributes timeout="10s" 
action="local-invalidate"/>
             </entry-time-to-live>
         </region-attributes>
     </region>
-</cache>
+</client-cache>
 ```
diff --git a/docs/geode-native-docs/regions/regions.html.md.erb 
b/docs/geode-native-docs/regions/regions.html.md.erb
index 8c6ac50..f0bc1d6 100644
--- a/docs/geode-native-docs/regions/regions.html.md.erb
+++ b/docs/geode-native-docs/regions/regions.html.md.erb
@@ -37,51 +37,92 @@ Create your regions using the `regionFactory` class.
 
 **C++ RegionFactory Example**
 
-``` pre
-RegionFactoryPtr regionFactory =
-    cachePtr->createRegionFactory(CACHING_PROXY);
-RegionPtr regPtr0 = regionFactory->setLruEntriesLimit(20000)
-        ->create("exampleRegion0");
-    
+``` cpp
+auto cacheFactory = CacheFactory();
+auto cache = cacheFactory.create();
+
+auto examplePool = cache.getPoolManager()
+    .createFactory()
+    .addLocator("localhost", 40404)
+    .setSubscriptionEnabled(true)
+    .create("examplePool");
+
+auto clientRegion1 = cache.createRegionFactory(RegionShortcut::PROXY)
+  .setPoolName("examplePool")
+  .create("clientRegion1");
+
+auto clientRegion2 = cache.createRegionFactory(RegionShortcut::CACHING_PROXY)
+  .setPoolName("examplePool")
+  .setRegionTimeToLive(ExpirationAction::INVALIDATE, std::chrono::minutes(2))
+  .create("clientRegion2");
+```
+
+**.NET C# RegionFactory Example**
+
+``` csharp
+var cacheFactory = CacheFactory();
+var cache = cacheFactory.Create();
+
+var examplePool = cache.GetPoolManager()
+    .CreateFactory()
+    .AddLocator("localhost", 40404)
+    .SetSubscriptionEnabled(true)
+    .Create("examplePool");
+
+var clientRegion1 = cache.CreateRegionFactory(RegionShortcut.PROXY)
+  .SetPoolName("examplePool")
+  .Create("clientRegion1");
+
+var clientRegion2 = cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY)
+  .SetPoolName("examplePool")
+  .SetRegionTimeToLive(ExpirationAction.INVALIDATE, TimeSpan.FromMinutes(2))
+  .Create("clientRegion2");
 ```
 
 ## <a id="declarative-region-creation"></a>Declarative Region Creation
 
-Declarative region creation involves placing the region's XML declaration, 
with the appropriate attribute settings, in the `cache.xml` file that is loaded 
at cache creation.
+Declarative region creation involves placing the region's XML declaration, 
with the appropriate
+attribute settings, in the `cache.xml` file that is loaded at cache creation.
 
 **Note:**
 Before creating a region, specify region attributes. See [Region 
Attributes](region-attributes.html).
 
 Regions are placed inside the cache declaration in `region` elements. For 
example:
 
-``` pre
-<cache>
-  <pool name="examplePool" subscription-enabled="true" >
-    <server host="localhost" port="40404" />
-  </pool>
-  <region name="A" refid="PROXY">
-    <region-attributes pool-name="examplePool"/>
-  </region>
-  <region name="A1">
-    <region-attributes refid="PROXY" pool-name="examplePool"/>
-  </region>
-  <region name="A2" refid="CACHING_PROXY">
-    <region-attributes pool-name="examplePool">
-      <region-time-to-live>
-        <expiration-attributes timeout="120" action="invalidate"/>
-      </region-time-to-live>
-    </region-attributes>
-  </region>
-</cache>
+``` xml
+<?xml version="1.0" encoding="UTF-8"?>
+<client-cache
+    xmlns="http://geode.apache.org/schema/cpp-cache";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xsi:schemaLocation="http://geode.apache.org/schema/cpp-cache
+                        
http://geode.apache.org/schema/cpp-cache/cpp-cache-1.0.xsd";
+    version="1.0">
+    <pool name="examplePool" subscription-enabled="true">
+        <server host="localhost" port="40404" />
+    </pool>
+    <region name="clientRegion1" refid="PROXY">
+        <region-attributes pool-name="examplePool"/>
+    </region>
+    <region name="clientRegion2" refid="CACHING_PROXY">
+        <region-attributes pool-name="examplePool">
+            <region-time-to-live>
+                <expiration-attributes timeout="120s" action="invalidate"/>
+            </region-time-to-live>
+        </region-attributes>
+    </region>
+</client-cache>
     
 ```
 
-The `cache.xml` file contents must conform to the XML described at 
[http://geode.apache.org/schema/cache/cache-1.0.xsd](http://geode.apache.org/schema/cache/cache-1.0.xsd).
 For details, see [Cache Initialization 
File](../client-cache/cache-init-file.html).
+The `cache.xml` file contents must conform to the XML described at
+[http://geode.apache.org/schema/cache/cache-1.0.xsd](http://geode.apache.org/schema/cache/cache-1.0.xsd).
 For
+details, see [Cache Initialization File](../client-cache/cache-init-file.html).
 
 
 ## <a id="invalidating-regions"></a>Invalidating and Destroying Regions
 
-Invalidation marks all entries contained in the region as invalid (with null 
values). Destruction removes the region and all of its contents from the cache.
+Invalidation marks all entries contained in the region as invalid (with null 
values). Destruction
+removes the region and all of its contents from the cache.
 
 <a id="invalidating-region__section_6F7E304D1D5743F1B53FCBD4F82651D0"></a>
 You can execute these operations explicitly in the local cache in the 
following ways:
@@ -95,10 +136,13 @@ In either case, you can perform invalidation and 
destruction as a local or a dis
 -   A distributed operation works first on the region in the local cache and 
then distributes the operation to all other caches where the region is defined. 
This is the proper choice when the region is no longer needed, or valid, for 
any application in the distributed system.
 -   If the region on the server is configured as a partitioned region, it 
cannot be cleared using API calls from the client.
 
-A user-defined cache writer can abort a region destroy operation. Cache 
writers are synchronous listeners with the ability to abort operations. If a 
cache writer is defined for the region anywhere in the distributed system, it 
is invoked before the region is explicitly destroyed.
-
-Region invalidation and destruction can cause other user-defined application 
plug-ins to be invoked as well. These plug-ins are described in detail in the 
[Overview of Application 
Plug-Ins](application-plugins.html#application-plugins__section_8FEB62EEC7A042E0A85E0FEDC9F71597).
+A user-defined cache writer can abort a region destroy operation. Cache 
writers are synchronous
+listeners with the ability to abort operations. If a cache writer is defined 
for the region anywhere
+in the distributed system, it is invoked before the region is explicitly 
destroyed.
 
+Region invalidation and destruction can cause other user-defined application 
plug-ins to be invoked
+as well. These plug-ins are described in detail in the [Overview of Application
+Plug-Ins](application-plugins.html#application-plugins__section_8FEB62EEC7A042E0A85E0FEDC9F71597).
 
 Whether carried out explicitly or through expiration activities, invalidation 
and destruction cause event notification.
 

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to