[jboss-cvs] JBossCache/docs/JBossCache-UserGuide/en/modules ...
Brian Stansberry
brian.stansberry at jboss.com
Wed May 30 17:38:04 EDT 2007
User: bstansberry
Date: 07/05/30 17:38:04
Modified: docs/JBossCache-UserGuide/en/modules eviction_policies.xml
Log:
Update configuration discussion
Revision Changes Path
1.11 +44 -20 JBossCache/docs/JBossCache-UserGuide/en/modules/eviction_policies.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: eviction_policies.xml
===================================================================
RCS file: /cvsroot/jboss/JBossCache/docs/JBossCache-UserGuide/en/modules/eviction_policies.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- eviction_policies.xml 30 Apr 2007 17:36:48 -0000 1.10
+++ eviction_policies.xml 30 May 2007 21:38:04 -0000 1.11
@@ -20,12 +20,12 @@
...
- <attribute name="EvictionPolicyConfig">
+ <attribute name="EvictionConfig">
<config>
<attribute name="wakeUpIntervalSeconds">3</attribute>
<!-- This defaults to 200000 if not specified -->
- <attribute name="eventQueueSize">200000</attribute>
+ <attribute name="eventQueueSize">100000</attribute>
<!-- Name of the DEFAULT eviction policy class. -->
<attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
@@ -40,8 +40,10 @@
<attribute name="maxNodes">250</attribute>
</region>
- <region name="/org/jboss/test/data">
- <attribute name="maxNodes">6</attribute>
+ <!-- We expect a lot of events for this region,
+ so override the default event queue size -->
+ <region name="/org/jboss/test/data" eventQueueSize="500000">
+ <attribute name="maxNodes">60000</attribute>
</region>
</config>
@@ -59,7 +61,8 @@
<listitem>
<literal>eventQueueSize</literal>
- this optional parameter defines the size of the queue which holds eviction events. If your eviction
- thread does not run often enough, you may need to increase this.
+ thread does not run often enough, you may need to increase this. This can be overridden on a
+ per-region basis.
</listitem>
<listitem>
<literal>policyClass</literal>
@@ -139,8 +142,34 @@
<literal>org.jboss.cache.config.EvictionConfig</literal>
bean, which is passed into
<literal>Configuration.setEvictionConfig()</literal>
- .
+ . See the
+ <link linkend="configuration">chapter on Configuration</link>
+ for more on building a <literal>Configuration</literal>
+ programatically.
+ </para>
+
+ <para>
+ The use of simple POJO beans to represent all elements in a
+ cache's configuration also makes it fairly easy to programatically
+ add eviction regions after the cache is started . For example,
+ assume we had an existing cache configured via XML with the
+ EvictionConfig element shown above. Now at runtime we wished to
+ add a new eviction region named "/org/jboss/fifo", using
+ <literal>LRUPolicy</literal> but a different number of
+ <literal>maxNodes</literal>:
</para>
+
+ <programlisting>
+ Fqn fqn = Fqn.fromString("/org/jboss/fifo");
+
+ // Create a configuration for an LRUPolicy
+ LRUConfiguration lruc = new LRUConfiguration();
+ lruc.setMaxNodes(10000);
+
+ // Create the region and set the config
+ Region region = cache.getRegion(fqn, true);
+ region.setEvictionPolicy(lruc);
+ </programlisting>
</section>
</section>
@@ -386,7 +415,7 @@
<literal>org.jboss.cache.eviction.EvictionQueue</literal>
</listitem>
<listitem>
- <literal>org.jboss.cache.eviction.EvictionConfiguration</literal>
+ <literal>org.jboss.cache.eviction.EvictionPolicyConfig</literal>
</listitem>
</itemizedlist>
When compounded
@@ -412,22 +441,17 @@
<itemizedlist>
<listitem>
- <para>The EvictionConfiguration class
- <literal>parseXMLConfig(Element)</literal>
- method expects only the DOM element pertaining to the region the
- policy is being configured for.
- </para>
- </listitem>
- <listitem>
- <para>The EvictionConfiguration implementation should maintain
- getter and setter methods for configured properties pertaining to
- the policy used on a given cache region. (e.g. for
+ <para>The <literal>EvictionPolicyConfig</literal> implementation
+ should maintain
+ getter and setter methods for whatever configuration properties
+ the policy supports (e.g. for
<literal>LRUConfiguration</literal>
- there is a
+ among others there is a
<literal>int getMaxNodes()</literal>
and a
<literal>setMaxNodes(int)</literal>
- )
+ ). When the "EvictionConfig" section of an XML configuration
+ is parsed, these properties will be set by reflection.
</para>
</listitem>
</itemizedlist>
More information about the jboss-cvs-commits
mailing list