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.
Note: Before creating a region, specify region attributes. See Region Attributes.
Regions are placed inside the cache declaration in region
elements. For example:
<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>
The cache.xml
file contents must conform to the XML described at http://geode.apache.org/schema/cache/cache-1.0.xsd. For details, see Cache Initialization File.