| --- |
| title: Region Attributes |
| --- |
| |
| <!-- |
| 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. |
| --> |
| |
| Region attributes govern the automated management of a region and its entries. |
| |
| Region attribute settings determine where the data resides, how the region is managed in memory, and the automatic loading, distribution, and expiration of region entries. |
| |
| ## <a id="specifying-region-attributes"></a>Specifying Region Attributes |
| |
| Specify region attributes before creating the region. You can do this either through the API or |
| through the declarative XML file. The API includes classes for defining a region's attributes before |
| creation and for modifying some of them after creation. For details, see the API for |
| `RegionShortcut`, `RegionAttributes`, `AttributesFactory`, and `AttributesMutator`. |
| |
| ## <a id="region-shortcuts"></a>Region Shortcuts |
| |
| <%=vars.product_name%> provides predefined, shortcut region attributes settings for your use in `RegionShortcut`. |
| |
| Shortcut attributes are a convenience only. They are named attributes that <%=vars.product_name%> |
| has already stored for you. You can override their settings by storing new attributes with the same |
| `id` as the predefined attributes. |
| |
| ### <a id="region-shortcuts_shortcut-attribute-options"></a>Shortcut Attribute Options |
| |
| You can select the most common region attributes settings from `RegionShortcut`, the predefined named region attributes. |
| |
| This section provides an overview of the options available in the region shortcut settings. |
| |
| **Communication with Servers and Data Storage** |
| |
| `PROXY` |
| > does not store data in the client cache, but connects the region to the servers for data requests and updates, interest registrations, and so on. |
| |
| `CACHING_PROXY` |
| > stores data in the client cache and connects the region to the servers for data requests and updates, interest registrations, and so on. |
| |
| `LOCAL` |
| > stores data in the client cache and does not connect the region to the servers. This is a client-side-only region. |
| |
| **Data Eviction** |
| |
| Non-PROXY regions are those that store data in the client cache. |
| You can add data eviction for non-PROXY regions: |
| |
| `ENTRY_LRU` |
| > causes least recently used data to be evicted from memory when the region reaches the entry count limit. |
| |