|Configuring the Native Client Cache / Region Attributes|
GemFire provides a number of predefined, shortcut region attributes settings for your use, in RegionShortcut.
Shortcut attributes are a convenience only. They are named attributes that GemFire has already stored for you. You can override their settings by storing new attributes with the same id as the predefined attributes.
You can also create custom region attributes and store them with an identifier for later retrieval. Both types of stored attributes are referred to as named region attributes. You can create and store your attribute settings in the cache.xml file and through the API.
Retrieve named attributes by providing the ID to the region creation. This example uses the shortcut CACHING_PROXY attributes to create a region:
<region name="testRegion" refid="CACHING_PROXY"/>
You can modify named attributes as needed. For example, this adds a cache listener to the region:
<region name="testRegion" refid="CACHING_PROXY"> <region-attributes> <cache-listener library-name="myAppLib" library-function-name ="myCacheListener" /> </region-attributes> </region>
In this example, the modified region shortcut is saved to the cache using the region attribute id, for retrieval and use by a second region:
<region name="testRegion" refid="CACHING_PROXY"> <region-attributes id="Caching_Proxy_With_Listener"> <cache-listener library-name="myAppLib" library-function-name ="myCacheListener" /> </region-attributes> </region> <region name="newTestRegion" refid="Caching_Proxy_With_Listener"/>
You can select the most common region attributes settings from RegionShortcut, GemFire's predefined named region attributes.
This section provides an overview of the options available in the region shortcut settings.
These are the options available in RegionShortcut.
Communication with Servers and Data Storage
For the non-PROXY regions--the regions that store data in the client cache--you can add data eviction: