If you are declaring a client cache then use this schema:
The contents of a declarative XML file correspond to APIs found in the
com.gemstone.gemfire.cache and com.gemstone.gemfire.cache.client
packages. A declarative caching XML file is used to populate a Cache
or a ClientCache when it is created.
The top-level element in this syntax is "cache" or "client-cache".
All elements are listed here in alphabetical order.
The following conventions apply to all GemFire distributed cache
declarative caching XML file elements unless indicated otherwise.
- In elements that contain PCDATA, leading and trailing whitespace in
the data may be ignored.
- In elements whose value is an "enumerated type", the value is case
sensitive.
]]>
The "cache" element is the root element of the declarative cache file on a peer or server. This element configures a GemFire Cache and
describes the root regions it contains, if any.
The "gateway-hub" element specifies a Gateway Hub that is
initialized when the Cache is declaratively initialized.
The "gateway" element specifies a Gateway that is
initialized when a GatewayHub is declaratively initialized.
The "gateway-endpoint" element specifies an endpoint that is
initialized when a Gateway is declaratively
initialized.
The "gateway-listener" element specifies a listener that is
initialized when a Gateway is declaratively initialized.
The "gateway-queue" element specifies a queue that is
initialized when a Gateway is declaratively initialized.
As of
6.5 overflow-directory is deprecated. Use disk-store-name instead.
As of 6.5 roll-oplogs is deprecated. Use disk-store-name instead.
A "gateway-conflict-resolver" element describes a region's GatewayConflictResolver.
It is used to resolve inter-system concurrency
conflicts.
A "async-event-listener" element describes a region's AsyncEventListener.
The "cache-server" element specifies a Cache Server that will accept requests from clients and that is started when the Cache is
declaratively initialized.
The "bridge-server" element specifies a Cache Bridge Server that is started when the Cache is declaratively initialized.
NOTE: as
of 5.7 this element is deprecated; use the "cache-server" element instead.
deprecated
A "vm-root-region" element is the same as "region".
This element exists for backwards compatiblity and should not be used
in new xml files.
The backup element defines files or directories that should
be backed up when the system wide backup command is invoked.
Disk
stores with persistent data are automatically backed up,
they do not need to be listed with this element.
The "client-cache" element is the root element of the declarative cache file on a client. This element configures a GemFire ClientCache
and describes the root regions it contains, if any.
A "region" element describes a region (and its entries) in GemFire
distributed cache. It may be used to create a new region or may be
used to add new entries to an existing region. Note that the "name"
attribute specifies the simple name of the region; it cannot contain a
"/".
If "refid"
is set then it defines the default region attributes to use for this region.
A nested "region-attributes" element can override these defaults.
If the
nested "region-attributes" element has its own "refid" then it will cause the
"refid" on the region to be ignored.
"refid" can be set to the name of a
RegionShortcut or a ClientRegionShortcut
(see the javadocs of those enum classes for their names).
An "index" element describes an index to be created on a region.
The index node, if any, should all come immediately after the
"region-attributes" node. There can be any number of functional types
of index on a Region, but only at max one index of type "primary-key". The
"name" attribute is a required field which identifies the name of the index.
A functional type of index needs a from-clause, expression which are mandatory.
The import string is used for specifying the
type of Object in the region or
the type of Object which the indexed expression evaluates to.
A primary-key type of index needs a field attribute which is mandatory.
There should be only one or zero primary-index defined
for a region
An "entry" element desribes an entry to be added to a region. Note
that if an entry with the given key already exists in the region,
it
will be replaced.
A "key" element describes the key in a Region entry.
A "value" element describes the value in a Region entry
A "key-constraint" element specifies the name of a class to which the
keys of a region are constrained.
A "value-constraint" element specifies the name of a class to which the
values of a region are constrained.
A "region-time-to-live" element specifies a Region's time to live.
A "region-idle-time" element specifies a Region's idle time.
Note that the APIs that correspond to this element add "out" to their
name.
See getRegionIdleTimeout and setRegionIdleTimeout.
A "entry-time-to-live" element specifies a Region's entries' time to
live.
A "entry-idle-time" element specifies a Region's entries' idle time.
Note that the APIs that correspond to this element add "out" to
their name.
See getEntryIdleTimeout and setEntryIdleTimeout.
A "disk-write-attributes" element describes how entry data is written
to disk. Deprecated as of 6.5 use disk-store instead.
An "asynchronous-writes" element specifies how entry data should be
written to disk asynchronous.
Deprecated as of 6.5 use
disk-store instead.
A "synchronous-writes" element specifies that entry data should be
written to disk synchronously.
A "partition-attributes" element configures a region for partitioned
data storage.
local-max-memory attribute added to
partition-attributes in release 5.1
total-max-memory attribute added to partition-attributes in release 5.1
total-num-buckets attribute added to
partition-attributes in release 5.1
partition-resolver attribute added to partition-attributes in release 5.7
partition-listener attribute added to
partition-attributes in release 6.1
colocated-with attribute added to partition-attributes in release 5.7
A "partition-resolver" element describes a partitioned region's custom
PartitionResolver.
A "partition-listener" element describes a partitioned region's custom
PartitionListener.
A "fixed-partition-attributes" element describes characteristics of a
partition in a Fixed Partitioned Region.
A "membership-attributes" element configures a region for membership
constraints based on required roles.
A "required-role" element specifies a role that is required for reliable
access to the region
A "subscription-attributes" element configures how a region subscribes
to remote distributed regions.
A "cache-listener" element describes a region's CacheListener.
A compressor registers a custom class which extends Compressor
to support compression on a region.
Create eviction attributes that monitor and control the size of the Region.
Create an LRU eviction controller which performs the action if the
Region has more than the maximum number of Entries in the
Region.
Create an LRU which evicts entries using the specified action
when the heap is over the resource manager
critical-heap-percentage.
When the threshold has been exceeded each create or put operation
is required to evict the same size of data which was
added. The
optional class-name and parameters allow for the declaration
of an ObjectSizer, which will be used to determine data size.
The class
must implement the ObjectSizer interface.
Create an LRU that performs the action when the memory size of the Region is
over the maximum. The optional class-name and
parameters allow for the
declaration an ObjectSizer, which is used to measure the size of each Object
in the Region. The class must implement
the ObjectSizer interface.
The "bridge-server" element specifies a Cache Bridge Server that is started when the Cache is declaratively initialized.
NOTE: as
of 5.7
this element is deprecated; use the "cache-server" element instead.
A "group" element specifies a single server group.
Deprecated as of 7.0 use the groups gemfire property instead.
A "client-subscription" element describes the eviction policy, capacity and overflow-directory for client subscription
config. The
overflow-directory attribute is deprecated as of 6.5 use disk-store-name instead.
A "custom-load-probe" element describes a callback that reports the load on a cache-server.
deprecated
The "resource manager" element configures the behavior of the resource manager.
The resource manager provides support for resource
management of its associated Cache
The "function service" element configures the behavior of the function service.
The function service allows users to execute functions
on data stored in
GemFire
The "function" element defines a function for registration in the function service
A "cache-loader" element describes a region's CacheLoader.
A "cache-transaction-manager" element allows insertion of cache-level
transaction listeners.
A "transaction-listener" describes a TransactionListener.
A "transaction-writer" describes a TransactionWriter.
A "cache-writer" element describes a region's CacheWriter.
A serialization-registration contains a set of serializer or
instantiator tags to register customer DataSerializer extensions
or
DataSerializable implementations respectively.
A serializer registers a custom class which extends DataSerializer
to support custom serialization of non-modifiable object types
inside
GemFire. The class must have a public zero-arg constructor.
An instantiator registers a custom class which implements the
DataSerializable interface to support custom object serialization
inside GemFire. The class must have a public zero-arg constructor.
The id that the instantiator should associate with the DataSerializable
type.
A "class-name" element specifies the name of a class, an
instance of which is created when a declarative cache XML file is
read.
A "disk-store" element specifies a DiskStore for persistence.
A "pdx" element specifies the configuration for the portable data exchange (PDX) method of serialization.
The "read-serialized"
attribute is "early access".
A "pdx-serializer" element describes a serializer used to serialize objects in the portable data exchange format.
A "pool" element specifies a client to server connection pool.
A "locator" element specifies the host and port that a server locator is listening on
A "server" element specifies the host and port that a cache server is listening on
A "declarable" element specifies a Declarable object to be placed in a
Region entry.
A "disk-dir" element specifies one of a region or diskstore's disk directories.
A "disk-dirs" element specifies the region's disk directories.
A "dynamic-region-factory" element configures a dynamic region factory for
this cache. If this optional element is missing then the
cache does not
support dynamic regions.
The optional "disk-dir" sub-element can be used to specify the directory to
store the persistent files that are
used for dynamic region bookkeeping.
It defaults to the current directory.
The pool-name attribute can be used to set the name of the connection
pool used
by client applications in a client/server cache configuration.
It should not be specified in servers or peers.
The optional "cache-loader" and
"cache-writer" are for legacy client client
applications that doen't use a connection pool. They must be a
bridge-loader and a bridge-writer. They should
not be specified in
servers or peers.
An "expiration-attributes" element describes expiration.
The "custom-expiry" element specifies a callback that specifies
custom expiration attributes. See the CustomExpiry class.
A "initializer" element specifies a Declarable object whose init method
will be called after all other cache.xml initialization is
complete.
A jndi-bindings element will contain the jndi-binding for each of the
datasources which are to be bound with the JNDI Context.
For every datasource which is bound to the JNDI tree, there will exist one
jndi-binding tag. This tag will describe the property
and
configuration of the
datasource. The attributes of jndi-binding are used for configuration by
GemFire, while the property element is used to
configure
the custom property
for the datasource.
The "xa-datasource-class" must be set when type is XAPooledDataSource,
"conn-pooled-datasource-class" must be
set when type is PooledDataSource,
and "jdbc-driver-class" msut be set when the type is SimpleDataSource.
It
is advisable to set the user-name and
password as attributes
rather than as a property element.
Alternatively, they may both be set as attributes of
the jndi-binding tag
as well as an
attribute of the property tag.
A "parameter" element describes a parameter used to initialize a
Declarable object.
A "string" element specifies a String to be placed in a Region entry.
Decimal version type.