JBoss.org Community Documentation
The concept of regions and the
Region
class were
visited earlier
when talking about marshalling. Regions also have another use, in that they are used to define the eviction
policy used within the region. In addition to using a region-specific configuration, you can also configure
a default, cache-wide eviction policy for nodes that do not fall into predefined regions or if you do not
wish to define specific regions. It is important to note that when defining regions using the configuration
XML file, all elements of the
Fqn
that defines the region are
java.lang.String
objects.
Looking at the eviction configuration snippet above, we see that a default region,
_default_
, holds attributes
which apply to nodes that do not fall into any of the other regions defined.
For each region, you can define parameters which affect how the policy which applies to the region chooses
to evict nodes.
In the example above, the
LRUPolicy
allows a
maxNodes
parameter which defines
how many nodes can exist in the region before it chooses to start evicting nodes. See the javadocs for each
policy for a list of allowed parameters. It also defines a
minTimeToLiveSeconds
parameter,
which defines a minimum time a node must exist in memory before being considered for eviction.