[jbosscache-commits] JBoss Cache SVN: r4251 - pojo/trunk/src/main/docbook/userguide/en/modules.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Aug 14 15:09:33 EDT 2007


Author: jason.greene at jboss.com
Date: 2007-08-14 15:09:32 -0400 (Tue, 14 Aug 2007)
New Revision: 4251

Added:
   pojo/trunk/src/main/docbook/userguide/en/modules/api.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/appendix.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/architecture.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/configuration.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/example.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/instrumentation.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/introduction.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/term.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/troubleshooting.xml
Removed:
   pojo/trunk/src/main/docbook/userguide/en/modules/architecture.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/basic_api.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/cache_loaders.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/compatibility.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/configuration.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/deployment.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/introduction.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/jmx_reference.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/preface.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/replication.xml
   pojo/trunk/src/main/docbook/userguide/en/modules/transactions.xml
Log:
Use pojo cache docs


Added: pojo/trunk/src/main/docbook/userguide/en/modules/api.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/api.xml	                        (rev 0)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/api.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -0,0 +1,184 @@
+<chapter id="api">
+
+   <title>API Overview</title>
+   <para>This section provides a brief overview of the POJO Cache APIs. Please consult the javadoc for the full API.</para>
+
+   <sect1>
+      <title>PojoCacheFactory Class</title>
+      <para>PojoCacheFactory provides a couple of static methods to instantiate and obtain a PojoCache instance.</para>
+<programlisting>
+   /**
+    * Create a PojoCache instance. Note that this will start the cache life cycle automatically.
+    * @param config A configuration string that represents the file name that is used to
+    * configure the underlying Cache instance.
+    * @return PojoCache
+    */
+   public static PojoCache createInstance(String config);
+
+   /**
+    * Create a PojoCache instance.
+    * @param config A configuration string that represents the file name that is used to
+    * configure the underlying Cache instance.
+    * @param start If true, it will start the cache life cycle.
+    * @return PojoCache
+    */
+   public static PojoCache createInstance(String config, boolean start);
+
+   /**
+    * Create a PojoCache instance.
+    * @param config A configuration object that is used to configure the underlying Cache instance.
+    * @param start If true, it will start the cache life cycle.
+    * @return PojoCache
+    */
+   public static PojoCache createInstance(Configuration config, boolean start);
+</programlisting>
+      <para>For example, to obtain a PojoCache instance and start the cache lifestyle automatically,
+      we can do:
+<programlisting>
+   String configFile = "META-INF/replSync-service.xml";
+   PojoCache cache = PojoCacheFactory.createInstance(configFile);
+</programlisting>
+      </para>
+   </sect1>
+
+
+   <sect1>
+      <title>PojoCache Interface</title>
+      <para>
+         <literal>PojoCache</literal> is the main interface for POJO Cache operations. 
+         Since most of the cache interaction is performed against the application domain model, 
+         there are only a few methods on this interface.
+      </para>
+
+   <sect2>
+      <title>Attachment</title>
+
+<programlisting>
+   /**
+    * Attach a POJO into PojoCache. It will also recursively put any sub-POJO into
+    * the cache system. A POJO can be the following and have the consequences when attached:
+    *
+    * It is PojoCacheable, that is, it has been annotated with
+    * {@see org.jboss.cache.aop.annotation.PojoCacheable} annotation (or via XML), and has
+    * been "instrumented" either compile- or load-time. The POJO will be mapped recursively to
+    * the system and fine-grained replication will be performed.
+    *
+    * It is Serializable. The POJO will still be stored in the cache system. However, it is
+    * treated as an "opaque" object per se. That is, the POJO will neither be intercepted
+    * (for fine-grained operation) or object relationship will be maintained.
+    *
+    * Neither of above. In this case, a user can specify whether it wants this POJO to be
+    * stored (e.g., replicated or persistent). If not, a PojoCacheException will be thrown.
+    *
+    * @param id   An id String to identify the object in the cache. To promote concurrency, we
+    *             recommend the use of hierarchical String separating by a designated separator. Default
+    *             is "/" but it can be set differently via a System property, jbosscache.separator
+    *             in the future release. E.g., "ben", or "student/joe", etc.
+    * @param pojo object to be inserted into the cache. If null, it will nullify the fqn node.
+    * @return Existing POJO or null if there is none.
+    * @throws PojoCacheException Throws if there is an error related to the cache operation.
+    */
+   Object attach(String id, Object pojo) throws PojoCacheException;
+</programlisting>
+            <para>
+             As described in the above javadoc, this method "attaches" the passed object to the cache 
+             at the specified location (<literal>id</literal>).
+             The passed in object (<literal>pojo</literal>) must have been instrumented (using the <literal>@Replicable</literal> annotation)  
+             or implement the <literal>Serializable</literal> interface. 
+            </para>
+
+            <para>
+               If the object is not instrumented, but serializable, POJO Cache will simply treat it as an opaque "primitive" type. That is,
+               it will simply store it without mapping the object's fields into the cache. Replication is done on the object wide
+               level and therefore it will not be fine-grained.
+            </para>
+
+            <para>If the object has references to other objects, this call will issue
+               <literal>attach()</literal> calls
+               recursively until the entire object graph is
+               traversed. In addition, object identity and object references are preserved. So both circular and multiply referenced objects
+               are mapped as expected. 
+            </para>
+
+            <para>The return value after the call is the previous object under <literal>id</literal>, if any. As a result, a successful call i
+                  will replace that old value with the new instance. Note that a user will only need to
+               issue this call once for each top-level object. Further calls can be made directly on the graph, and they will be mapped as
+               expected.
+            </para>
+</sect2>
+         <sect2>
+            <title>Detachment</title>
+
+<programlisting>
+   /**
+    * Remove POJO object from the cache.
+    *
+    * @param id Is string that associates with this node.
+    * @return Original value object from this node.
+    * @throws PojoCacheException Throws if there is an error related to the cache operation.
+    */
+   Object detach(String id) throws PojoCacheException;
+</programlisting>
+
+            <para>
+               This call will detach the POJO from the cache by removing the contents under <literal>id</literal>
+               and return the POJO instance stored there (null if it doesn't exist). If successful, further operations against
+               this object will not affect the cache. 
+               Note this call will also remove everything stored under <literal>id</literal> even if you have put
+               other plain cache data there.
+            </para>
+         </sect2>
+
+   <sect2>
+      <title>Query</title>
+<programlisting>
+
+   /**
+    * Retrieve POJO from the cache system. Return null if object does not exist in the cache.
+    * Note that this operation is fast if there is already a POJO instance attached to the cache.
+    *
+    * @param id that associates with this node.
+    * @return Current content value. Null if does not exist.
+    * @throws PojoCacheException Throws if there is an error related to the cache operation.
+    */
+   Object find(String id) throws PojoCacheException;
+</programlisting>
+      <para>
+This call will
+         return the current object content located under
+         <literal>id</literal>. This method call is useful when you don't have the exact POJO reference.
+         For example, when you fail over to the
+         replicated node, you want to get the object reference from the replicated cache instance.
+         In this case, PojoCache will create a new Java object if it does not exist and
+         then add the cache interceptor such that every future access will be
+         in sync with the underlying cache store.
+      </para>
+
+<programlisting>
+   /**
+    * Query all managed POJO objects under the id recursively. Note that this will not return
+    * the sub-object POJOs, e.g., if Person has a sub-object of Address, it
+    * won't return Address pojo. Also note also that this operation is not thread-safe
+    * now. In addition, it assumes that once a POJO is found with a id, no more POJO is stored
+    * under the children of the id. That is, we don't mix the id with different POJOs.
+    *
+    * @param id The starting place to find all POJOs.
+    * @return Map of all POJOs found with (id, POJO) pair. Return size of 0, if not found.
+    * @throws PojoCacheException Throws if there is an error related to the cache operation.
+    */
+   Map findAll(String id) throws PojoCacheException;
+</programlisting>
+
+      <para>
+This call will return all the managed POJOs under cache with a base Fqn name. It is recursive, meaning that
+         it will traverse all the sub-trees to find the POJOs under that base. For example, if you specify
+         the fqn to be root, e.g.,
+         <code>"/"</code>
+         , then it will return all the
+         managed POJOs under the cache.
+      </para>
+   </sect2>
+
+</sect1>
+
+</chapter>


Property changes on: pojo/trunk/src/main/docbook/userguide/en/modules/api.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: pojo/trunk/src/main/docbook/userguide/en/modules/appendix.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/appendix.xml	                        (rev 0)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/appendix.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -0,0 +1,309 @@
+<chapter id="appendix">
+
+   <title>Appendix</title>
+   <sect1>
+      <title id="examplePOJO">Example POJO</title>
+
+      <para>The example POJO classes used for
+         are:
+         <literal>Person,</literal> <literal>Student,</literal>
+         and
+         <literal>Address</literal>. Below are their definition
+         (note that
+         neither class implements
+         <literal>Serializable</literal>
+         ) along with the annotation.
+      </para>
+
+      <programlisting>
+ at org.jboss.cache.pojo.annotation.Replicable
+public class Person {
+   String name=null;
+   int age=0;
+   Map hobbies=null;
+   Address address=null;
+   Set skills;
+   List languages;
+
+   public String getName() { return name; }
+   public void setName(String name) { this.name=name; }
+
+   public int getAge() { return age; }
+   public void setAge(int age) { this.age = age; }
+
+   public Map getHobbies() { return hobbies; }
+   public void setHobbies(Map hobbies) { this.hobbies = hobbies; }
+
+   public Address getAddress() { return address; }
+   public void setAddress(Address address) { this.address = address; }
+
+   public Set getSkills() { return skills; }
+   public void setSkills(Set skills) { this.skills = skills; }
+
+   public List getLanguages() { return languages; }
+   public void setLanguages(List languages) { this.languages = languages; }
+}</programlisting>
+
+      <programlisting>public class Student extends Person {
+   String year=null;
+
+   public String getYear() { return year; }
+   public void setYear(String year) { this.year=year; }
+}</programlisting>
+
+      <programlisting>
+   @org.jboss.cache.pojo.annotation.Replicable
+   public class Address {
+   String street=null;
+   String city=null;
+   int zip=0;
+
+   public String getStreet() { return street; }
+   public void setStreet(String street) { this.street=street; }
+   ...
+}</programlisting>
+   </sect1>
+
+   <sect1 id="xml" revision="1">
+      <title>Sample Cache configuration xml</title>
+
+      <para>
+         Below is a sample xml configuration for Cache that you can use for PojoCache creation.
+      </para>
+      <programlisting>
+         <![CDATA[
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<server>
+   <mbean code="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper" 
+          name="jboss.cache:service=PojoCache">
+      
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!-- Configure the TransactionManager -->
+      <attribute name="TransactionManagerLookupClass">
+         org.jboss.cache.transaction.DummyTransactionManagerLookup
+      </attribute>
+
+      <!-- Isolation level : SERIALIZABLE
+                             REPEATABLE_READ (default)
+                             READ_COMMITTED
+                             READ_UNCOMMITTED
+                             NONE
+      -->
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+      <!-- Valid modes are LOCAL, REPL_ASYNC and REPL_SYNC -->
+      <attribute name="CacheMode">REPL_SYNC</attribute>
+
+      <!-- Name of cluster. Needs to be the same for all caches, 
+           in order for them to find each other
+      -->
+      <attribute name="ClusterName">PojoCacheCluster</attribute>
+
+   	  <!-- JGroups protocol stack properties. -->
+      <attribute name="ClusterConfig">
+         <config>
+            <!-- UDP: if you have a multihomed machine, set the bind_addr 
+                 attribute to the appropriate NIC IP address -->
+            <!-- UDP: On Windows machines, because of the media sense feature
+                 being broken with multicast (even after disabling media sense)
+                 set the loopback attribute to true -->
+            <UDP mcast_addr="228.1.2.3" mcast_port="48866"
+                 ip_ttl="64" ip_mcast="true"
+                 mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
+                 ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
+                 loopback="false"/>
+            <PING timeout="2000" num_initial_members="3"/>
+            <MERGE2 min_interval="10000" max_interval="20000"/>
+            <FD shun="true"/>
+            <FD_SOCK/>
+            <VERIFY_SUSPECT timeout="1500"/>
+            <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
+                           max_xmit_size="8192"/>
+            <UNICAST timeout="600,1200,2400",4800/>
+            <pbcast.STABLE desired_avg_gossip="400000"/>
+            <FC max_credits="2000000" min_threshold="0.10"/>
+            <FRAG2 frag_size="8192"/>
+            <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
+                        shun="true" print_local_addr="true"/>
+            <pbcast.STATE_TRANSFER/>
+         </config>
+      </attribute>
+
+      <!-- Whether or not to fetch state on joining a cluster -->
+      <attribute name="FetchInMemoryState">true</attribute>
+
+      <!-- The max amount of time (in milliseconds) we wait until the
+           initial state (ie. the contents of the cache) are retrieved from
+           existing members in a clustered environment
+      -->
+      <attribute name="InitialStateRetrievalTimeout">15000</attribute>
+
+      <!-- Number of milliseconds to wait until all responses for a
+           synchronous call have been received.
+      -->
+      <attribute name="SyncReplTimeout">15000</attribute>
+
+      <!--  Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">10000</attribute>
+   
+   </mbean>
+</server>
+]]>
+      </programlisting>
+
+   </sect1>
+
+
+   <sect1 id="xml-pojo" revision="1">
+      <title>PojoCache configuration xml</title>
+      <para>Attached is a full listing for <literal>pojocache-aop.xml</literal>.</para>
+<programlisting>
+   &lt;?xml version="1.0" encoding="UTF-8"?&gt;
+   &lt;!--
+       This is the PojoCache configuration file that specifies:
+         1. Interceptor stack for API
+         2. Annotation binding for POJO (via "prepare" element)
+
+       Basically, this is a variant of jboss-aop.xml. Note that
+       except for the customization of interceptor stack, you should
+       not need to modify this file.
+
+       To run PojoCache, you will need to define a system property:
+       jboss.aop.path that contains the path to this file such that JBoss Aop
+       can locate it.
+   --&gt;
+   &lt;aop&gt;
+
+      &lt;!--
+      This defines the PojoCache 2.0 interceptor stack. Unless necessary, don't modify the stack here!
+      --&gt;
+
+      &lt;!-- Check id range validity --&gt;
+      &lt;interceptor name="CheckId" class="org.jboss.cache.pojo.interceptors.CheckIdInterceptor"
+                   scope="PER_INSTANCE"/&gt;
+
+      &lt;!-- Track Tx undo operation --&gt;
+      &lt;interceptor name="Undo" class="org.jboss.cache.pojo.interceptors.PojoTxUndoInterceptor"
+                   scope="PER_INSTANCE"/&gt;
+
+      &lt;!-- Begining of interceptor chain --&gt;
+      &lt;interceptor name="Start" class="org.jboss.cache.pojo.interceptors.PojoBeginInterceptor"
+                   scope="PER_INSTANCE"/&gt;
+
+      &lt;!-- Check if we need a local tx for batch processing --&gt;
+      &lt;interceptor name="Tx" class="org.jboss.cache.pojo.interceptors.PojoTxInterceptor"
+                   scope="PER_INSTANCE"/&gt;
+
+      &lt;!--
+         Mockup failed tx for testing. You will need to set PojoFailedTxMockupInterceptor.setRollback(true)
+         to activate it.
+       --&gt;
+      &lt;interceptor name="MockupTx" class="org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor"
+                   scope="PER_INSTANCE"/&gt;
+
+      &lt;!-- Perform parent level node locking --&gt;
+      &lt;interceptor name="TxLock" class="org.jboss.cache.pojo.interceptors.PojoTxLockInterceptor"
+                   scope="PER_INSTANCE"/&gt;
+
+      &lt;!-- Interceptor to perform Pojo level rollback --&gt;
+      &lt;interceptor name="TxUndo" class="org.jboss.cache.pojo.interceptors.PojoTxUndoSynchronizationInterceptor"
+                   scope="PER_INSTANCE"/&gt;
+
+      &lt;!-- Interceptor to used to check recursive field interception. --&gt;
+      &lt;interceptor name="Reentrant" class="org.jboss.cache.pojo.interceptors.MethodReentrancyStopperInterceptor"
+                   scope="PER_INSTANCE"/&gt;
+
+      &lt;!-- Whether to allow non-serializable pojo. Default is false. --&gt;
+      &lt;interceptor name="MarshallNonSerializable"
+                   class="org.jboss.cache.pojo.interceptors.CheckNonSerializableInterceptor"
+                   scope="PER_INSTANCE"&gt;
+            &lt;attribute name="marshallNonSerializable"&gt;false&lt;/attribute&gt;
+                   &lt;/interceptor&gt;
+
+      &lt;!-- This defines the stack macro --&gt;
+      &lt;stack name="Attach"&gt;
+         &lt;interceptor-ref name="Start"/&gt;
+         &lt;interceptor-ref name="CheckId"/&gt;
+         &lt;interceptor-ref name="MarshallNonSerializable"/&gt;
+         &lt;interceptor-ref name="Tx"/&gt;
+         &lt;!-- NOTE: You can comment this out during production although leaving it here is OK. --&gt;
+         &lt;interceptor-ref name="MockupTx"/&gt;
+         &lt;interceptor-ref name="TxLock"/&gt;
+         &lt;interceptor-ref name="TxUndo"/&gt;
+      &lt;/stack&gt;
+
+      &lt;stack name="Detach"&gt;
+         &lt;interceptor-ref name="Start"/&gt;
+         &lt;interceptor-ref name="CheckId"/&gt;
+         &lt;interceptor-ref name="Tx"/&gt;
+         &lt;!-- NOTE: You can comment this out during production although leaving it here is OK. --&gt;
+         &lt;interceptor-ref name="MockupTx"/&gt;
+         &lt;interceptor-ref name="TxLock"/&gt;
+         &lt;interceptor-ref name="TxUndo"/&gt;
+      &lt;/stack&gt;
+
+      &lt;stack name="Find"&gt;
+         &lt;interceptor-ref name="Start"/&gt;
+         &lt;interceptor-ref name="CheckId"/&gt;
+      &lt;/stack&gt;
+
+      &lt;!--
+         The following section should be READ-ONLY!! It defines the annotation binding to the stack.
+      --&gt;
+
+      &lt;!-- This binds the jointpoint to specific in-memory operations. Currently in PojoUtil. --&gt;
+      &lt;bind pointcut="execution(*
+         @org.jboss.cache.pojo.annotation.Reentrant-&gt;toString())"&gt;
+         &lt;interceptor-ref name="Reentrant"/&gt;
+      &lt;/bind&gt;
+
+      &lt;bind pointcut="execution(*
+         org.jboss.cache.pojo.PojoUtil-&gt;@org.jboss.cache.pojo.annotation.TxUndo(..))"&gt;
+         &lt;interceptor-ref name="Undo"/&gt;
+      &lt;/bind&gt;
+
+      &lt;bind pointcut="execution(* org.jboss.cache.pojo.impl.PojoCacheImpl-&gt;@org.jboss.cache.pojo.annotation.Attach(..))"&gt;
+         &lt;stack-ref name="Attach"/&gt;
+      &lt;/bind&gt;
+
+      &lt;bind pointcut="execution(* org.jboss.cache.pojo.impl.PojoCacheImpl-&gt;@org.jboss.cache.pojo.annotation.Detach(..))"&gt;
+         &lt;stack-ref name="Detach"/&gt;
+      &lt;/bind&gt;
+
+      &lt;bind pointcut="execution(* org.jboss.cache.pojo.impl.PojoCacheImpl-&gt;@org.jboss.cache.pojo.annotation.Find(..))"&gt;
+         &lt;stack-ref name="Find"/&gt;
+      &lt;/bind&gt;
+
+
+      &lt;!--
+         Following is declaration for JDK50 annotation. You use the specific annotation on your
+         POJO such that it can be instrumented. Idea is user will then need only to annotate like:
+   @org.jboss.cache.pojo.annotation.Replicable
+   in his POJO. There will be no need of jboss-aop.xml from user's side.
+      --&gt;
+
+      &lt;!-- If a POJO has PojoCachable annotation, it will be asepctized. --&gt;
+      &lt;prepare expr="field(* $instanceof{@org.jboss.cache.pojo.annotation.Replicable}-&gt;*)" /&gt;
+
+      &lt;!-- Observer and Observable to monitor field modification --&gt;
+      &lt;bind pointcut="
+         set(* $instanceof{@org.jboss.cache.pojo.annotation.Replicable}-&gt;*)
+         "&gt;
+            &lt;interceptor class="org.jboss.cache.pojo.observable.SubjectInterceptor"/&gt;
+      &lt;/bind&gt;
+
+      &lt;introduction class="$instanceof{@org.jboss.cache.pojo.annotation.Replicable}"&gt;
+         &lt;mixin&gt;
+            &lt;interfaces&gt;org.jboss.cache.pojo.observable.Subject&lt;/interfaces&gt;
+            &lt;class&gt;org.jboss.cache.pojo.observable.SubjectImpl&lt;/class&gt;
+            &lt;construction&gt;new org.jboss.cache.pojo.observable.SubjectImpl(this)&lt;/construction&gt;
+         &lt;/mixin&gt;
+      &lt;/introduction&gt;
+   &lt;/aop&gt;
+
+</programlisting>
+   </sect1>
+</chapter>
+


Property changes on: pojo/trunk/src/main/docbook/userguide/en/modules/appendix.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/architecture.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/architecture.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/architecture.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,498 +0,0 @@
-<chapter id="architecture">
-   <title>Architecture</title>
-   <section id="architecture.tree_structure">
-      <title>Data Structures Within The Cache</title>
-
-
-      <para>
-         A
-         <literal>Cache</literal>
-         consists of a collection of
-         <literal>Node</literal>
-         instances, organised in a tree
-         structure. Each
-         <literal>Node</literal>
-         contains a
-         <literal>Map</literal>
-         which holds the data
-         objects to be cached. It is important to note that the structure is a mathematical tree, and not a graph; each
-         <literal>Node</literal>
-         has one and only one parent, and the root node is denoted by the constant fully qualitied name,
-         <literal>Fqn.ROOT</literal>
-         .
-      </para>
-      <para>
-         The reason for organising nodes as such is to improve concurrent access to data and make replication and
-         persistence
-         more fine-grained.
-      </para>
-      <para>
-         <figure>
-            <title>Data structured as a tree</title>
-
-            <mediaobject>
-               <imageobject>
-                  <imagedata fileref="TreeCacheArchitecture.png"/>
-               </imageobject>
-            </mediaobject>
-         </figure>
-
-         In the diagram above, each box represents a JVM. You see 2 caches in separate JVMs, replicating data to each
-         other.
-         These VMs can be located on the same physical machine, or on 2 different machines connected by a network link.
-         The
-         underlying group communication between networked nodes is done using
-         <ulink url="http://www.jgroups.org">JGroups</ulink>
-         .
-      </para>
-
-      <para>Any modifications (see
-         <link linkend="api">API chapter</link>
-         ) in one cache instance will be replicated to
-         the other cache. Naturally, you can have more than 2 caches in a cluster.
-         Depending on the transactional settings, this replication will occur either after each modification or at the
-         end of a transaction, at commit time. When a new cache is created, it can optionally acquire the contents
-         from one of the existing caches on startup.
-      </para>
-   </section>
-
-   <section id="architecture.SPI_interfaces">
-      <title>SPI Interfaces</title>
-      <para>
-         In addition to
-         <literal>Cache</literal>
-         and
-         <literal>Node</literal>
-         interfaces, JBoss Cache exposes more powerful
-         <literal>CacheSPI</literal>
-         and
-         <literal>NodeSPI</literal>
-         interfaces, which offer more control over the internals
-         of JBoss Cache. These interfaces are not intended for general use, but are designed for people who wish to
-         extend and enhance JBoss Cache, or write custom
-         <literal>Interceptor</literal>
-         or
-         <literal>CacheLoader</literal>
-         instances.
-      </para>
-      <figure>
-         <title>SPI Interfaces</title>
-
-         <mediaobject>
-            <imageobject>
-               <imagedata fileref="SPI.png"/>
-            </imageobject>
-         </mediaobject>
-      </figure>
-      <para>
-         The
-         <literal>CacheSPI</literal>
-         interface cannot be created, but is injected into
-         <literal>Interceptor</literal>
-         and
-         <literal>CacheLoader</literal>
-         implementations by the
-         <literal>setCache(CacheSPI cache)</literal>
-         methods on these interfaces.
-         <literal>CacheSPI</literal>
-         extends
-         <literal>Cache</literal>
-         so all the functionality of the basic API is made available.
-      </para>
-      <para>
-         Similarly, a
-         <literal>NodeSPI</literal>
-         interface cannot be created. Instead, one is obtained by performing operations on
-         <literal>CacheSPI</literal>
-         ,
-         obtained as above. For example,
-         <literal>Cache.getRoot() : Node</literal>
-         is overridden as
-         <literal>CacheSPI.getRoot() : NodeSPI</literal>
-         .
-      </para>
-      <para>
-         It is important to note that directly casting a
-         <literal>Cache</literal>
-         or
-         <literal>Node</literal>
-         to it's SPI
-         counterpart is not recommended and is bad practice, since the inheritace of interfaces it is not a contract
-         that is guaranteed to be upheld moving forward. The exposed public APIs, on the other hand, is guaranteed to
-         be upheld.
-      </para>
-   </section>
-
-   <section id="architecture.invocations">
-      <title>Method Invocations On Nodes</title>
-      <para>
-         Since the cache is essentially a collection of nodes, aspects such as clustering, persistence, eviction, etc.
-         need to be applied to these nodes when operations are invoked on the cache as a whole or on individual nodes.
-         To achieve this in a clean, modular and extensible manner, an interceptor chain is used. The chain is built
-         up of a series of interceptors, each one adding an aspect or particular functionality. The chain is built
-         when the cache is created, based on the configuration used.
-      </para>
-      <para>
-         It is important to note that the
-         <literal>NodeSPI</literal>
-         offers some methods (such as the
-         <literal>xxxDirect()</literal>
-         method
-         family) that operate on a node directly without passing through the interceptor stack. Plugin authors should
-         note
-         that using such methods will affect the aspects of the cache that may need to be applied, such as locking,
-         replication, etc. Basically, don't use such methods unless you
-         <emphasis>really</emphasis>
-         know what you're doing!
-      </para>
-      <section id="architecture.interceptors">
-         <title>Interceptors</title>
-         <para>
-            An
-            <literal>Interceptor</literal>
-            is an abstract class, several of which comprise an interceptor chain. It
-            exposes an
-            <literal>invoke()</literal>
-            method, which must be overridden by implementing classes to add behaviour
-            to a call before passing the call down the chain by calling
-            <literal>super.invoke()</literal>
-            .
-         </para>
-         <figure>
-            <title>SPI Interfaces</title>
-
-            <mediaobject>
-               <imageobject>
-                  <imagedata fileref="Interceptor.png"/>
-               </imageobject>
-            </mediaobject>
-         </figure>
-         <para>
-            JBoss Cache ships with several interceptors, representing different configuration options, some of which
-            are:
-            <itemizedlist>
-               <listitem>
-                  <literal>TxInterceptor</literal>
-                  - looks for ongoing transactions and registers with transaction managers to participate in
-                  synchronization events
-               </listitem>
-               <listitem>
-                  <literal>ReplicationInterceptor</literal>
-                  - replicates state across a cluster using a JGroups channel
-               </listitem>
-               <listitem>
-                  <literal>CacheLoaderInterceptor</literal>
-                  - loads data from a persistent store if the data requested is not available in memory
-               </listitem>
-            </itemizedlist>
-            The interceptor chain configured for your cache instance can be obtained and inspected by calling
-            <literal>CacheSPI.getInterceptorChain()</literal>
-            ,
-            which returns an ordered
-            <literal>List</literal>
-            of interceptors.
-         </para>
-         <section id="architecture.custom_interceptors">
-            <title>Writing Custom Interceptors</title>
-            <para>
-               Custom interceptors to add specific aspects or features can be written by extending
-               <literal>Interceptor</literal>
-               and overriding
-               <literal>invoke()</literal>
-               . The custom interceptor will need to be added to the interceptor chain by using the
-               <literal>CacheSPI.addInterceptor()</literal>
-               method.
-            </para>
-            <para>
-               Adding custom interceptors via XML is not supported at this time.
-            </para>
-         </section>
-      </section>
-
-      <section id="architecture.methodcalls">
-         <title>MethodCalls</title>
-         <para>
-            <literal>org.jboss.cache.marshall.MethodCall</literal>
-            is a class that encapsulates a
-            <literal>java.lang.reflection.Method</literal>
-            and an
-            <literal>Object[]</literal>
-            representing the method's arguments. It is an extension of the
-            <literal>org.jgroups.blocks.MethodCall</literal>
-            class, that adds a mechanism for identifying known methods using magic numbers and method ids,
-            which makes marshalling and unmarshalling more efficient and performant.
-         </para>
-         <para>
-            This is central to the
-            <literal>Interceptor</literal>
-            architecture, and is the only parameter passed in to
-            <literal>Interceptor.invoke()</literal>
-            .
-         </para>
-      </section>
-
-      <section id="architecture.invocationcontext">
-         <title>InvocationContexts</title>
-         <para>
-            <literal>InvocationContext</literal>
-            holds intermediate state for the duration of a single invocation, and is set up and
-            destroyed by the
-            <literal>InvocationContextInterceptor</literal>
-            which sits at the start of the chain.
-         </para>
-         <para>
-            <literal>InvocationContext</literal>
-            , as its name implies, holds contextual information associated with a single cache
-            method invocation. Contextual information includes associated
-            <literal>javax.transaction.Transaction</literal>
-            or
-            <literal>org.jboss.cache.transaction.GlobalTransaction</literal>
-            ,
-            method invocation origin (
-            <literal>InvocationContext.isOriginLocal()</literal>
-            ) as well as
-            <link
-                  linkend="configuration.options">
-               <literal>Option</literal>
-               overrides
-            </link>
-            .
-         </para>
-         <para>
-            The
-            <literal>InvocationContext</literal>
-            can be obtained by calling
-            <literal>Cache.getInvocationContext()</literal>
-            .
-         </para>
-      </section>
-   </section>
-
-   <section id="architecture.managers">
-      <title>Managers For Subsystems</title>
-      <para>
-         Some aspects and functionality is shared by more than a single interceptor. Some of these have been
-         encapsulated
-         into managers, for use by various interceptors, and are made available by the
-         <literal>CacheSPI</literal>
-         interface.
-      </para>
-
-      <section id="architecture.rpcmanager">
-         <title>RpcManager</title>
-         <para>
-            This class is responsible for calls made via the JGroups channel for all RPC calls to remote caches, and
-            encapsulates the JGroups channel used.
-         </para>
-      </section>
-
-      <section id="architecture.buddymanager">
-         <title>BuddyManager</title>
-         <para>
-            This class manages buddy groups and invokes group organisation remote calls to organise a cluster of
-            caches into smaller sub-groups.
-         </para>
-      </section>
-
-      <section id="architecture.cacheloadermanager">
-         <title>CacheLoaderManager</title>
-         <para>
-            Sets up and configures cache loaders. This class wraps individual
-            <literal>CacheLoader</literal>
-            instances
-            in delegating classes, such as
-            <literal>SingletonStoreCacheLoader</literal>
-            or
-            <literal>AsyncCacheLoader</literal>
-            ,
-            or may add the
-            <literal>CacheLoader</literal>
-            to a chain using the
-            <literal>ChainingCacheLoader</literal>
-            .
-         </para>
-      </section>
-
-   </section>
-
-   <section id="architecture.marshalling">
-      <title>Marshalling And Wire Formats</title>
-      <para>
-         Early versions of JBoss Cache simply wrote cached data to the network by writing to an
-         <literal>ObjectOutputStream</literal>
-         during replication. Over various releases in the JBoss Cache 1.x.x series this approach was gradually
-         deprecated
-         in favour of a more mature marshalling framework. In the JBoss Cache 2.x.x series, this is the only officially
-         supported and recommended mechanism for writing objects to datastreams.
-      </para>
-      <figure>
-         <title>The Marshaller interface</title>
-
-         <mediaobject>
-            <imageobject>
-               <imagedata fileref="Marshaller.png"/>
-            </imageobject>
-         </mediaobject>
-      </figure>
-      <section>
-         <title>The Marshaller Interface</title>
-         <para>
-            The
-            <literal>Marshaller</literal>
-            interface extends
-            <literal>RpcDispatcher.Marshaller</literal>
-            from JGroups.
-            This interface has two main implementations - a delegating
-            <literal>VersionAwareMarshaller</literal>
-            and a
-            concrete
-            <literal>CacheMarshaller200</literal>
-            .
-         </para>
-         <para>
-            The marshaller can be obtained by calling
-            <literal>CacheSPI.getMarshaller()</literal>
-            , and defaults to the
-            <literal>VersionAwareMarshaller</literal>
-            .
-            Users may also write their own marshallers by implementing the
-            <literal>Marshaller</literal>
-            interface and
-            adding it to their configuration, by using the
-            <literal>MarshallerClass</literal>
-            configuration attribute.
-         </para>
-      </section>
-
-      <section>
-         <title>VersionAwareMarshaller</title>
-         <para>
-            As the name suggests, this marshaller adds a version
-            <literal>short</literal>
-            to the start of any stream when
-            writing, enabling similar
-            <literal>VersionAwareMarshaller</literal>
-            instances to read the version short and
-            know which specific marshaller implementation to delegate the call to.
-            For example,
-            <literal>CacheMarshaller200</literal>
-            , is the marshaller for JBoss Cache 2.0.x.
-            JBoss Cache 2.1.x, say, may ship with
-            <literal>CacheMarshaller210</literal>
-            with an improved wire protocol.
-            Using a
-            <literal>VersionAwareMarshaller</literal>
-            helps achieve wire protocol compatibility between minor
-            releases but still affords us the flexibility to tweak and improve the wire protocol between minor or micro
-            releases.
-         </para>
-
-         <section>
-            <title>CacheLoaders</title>
-            <para>
-               Some of the existing cache loaders, such as the
-               <literal>JDBCCacheLoader</literal>
-               and the
-               <literal>FileCacheLoader</literal>
-               relied on persisting data using
-               <literal>ObjectOutputStream</literal>
-               as well, but now, they are using the
-               <literal>VersionAwareMarshaller</literal>
-               to marshall the persisted
-               data to their cache stores.
-            </para>
-         </section>
-
-      </section>
-
-      <section>
-         <title>CacheMarshaller200</title>
-         <para>
-            This marshaller treats well-known objects that need marshalling - such as
-            <literal>MethodCall</literal>
-            ,
-            <literal>Fqn</literal>
-            ,
-            <literal>DataVersion</literal>
-            , and even some JDK objects such as
-            <literal>String</literal>
-            ,
-            <literal>List</literal>
-            ,
-            <literal>Boolean</literal>
-            and others as types that do not need complete class definitions.
-            Instead, each of these well-known types are represented by a
-            <literal>short</literal>
-            , which is a lot more efficient.
-         </para>
-         <para>
-            In addition, reference counting is done to reduce duplication of writing certain objects multiple times, to
-            help
-            keep the streams small and efficient.
-         </para>
-         <para>
-            Also, if
-            <literal>UseRegionBasedMarshalling</literal>
-            is enabled (disabled by default) the marshaller adds region
-            information to the stream before writing any data. This region information is in the form of a
-            <literal>String</literal>
-            representation of an
-            <literal>Fqn</literal>
-            . When unmarshalling, the
-            <literal>RegionManager</literal>
-            can be used to
-            find the relevant
-            <literal>Region</literal>
-            , and use a region-specific
-            <literal>ClassLoader</literal>
-            to unmarshall
-            the stream. This is specifically useful when used to cluster state for application servers, where each
-            deployment has
-            it's own
-            <literal>ClassLoader</literal>
-            . See the section below on
-            <link linkend="architecture.regions">regions</link>
-            for more information.
-         </para>
-      </section>
-
-   </section>
-   <section id="architecture.regions">
-      <title>Class Loading and Regions</title>
-      <para>
-         When used to cluster state of application servers, applications deployed in the application tend to put
-         instances
-         of objects specific to their application in the cache (or in an
-         <literal>HttpSession</literal>
-         object) which
-         would require replication. It is common for application servers to assign separate
-         <literal>ClassLoader</literal>
-         instances to each application deployed, but have JBoss Cache libraries referenced by the application server's
-         <literal>ClassLoader</literal>
-         .
-      </para>
-      <para>
-         To enable us to successfully marshall and unmarshall objects from such class loaders, we use a concept called
-         regions. A region is a portion of the cache which share a common class loader (a region also has other uses -
-         see
-         <link linkend="eviction_policies">eviction policies</link>
-         ).
-      </para>
-      <para>
-         A region is created by using the
-         <literal>Cache.getRegion(Fqn fqn, boolean createIfNotExists)</literal>
-         method,
-         and returns an implementation of the
-         <literal>Region</literal>
-         interface. Once a region is obtained, a
-         class loader for the region can be set or unset, and the region can be activated/deactivated. By default,
-         regions
-         are active unless the
-         <literal>InactiveOnStartup</literal>
-         configuration attribute is set to
-         <literal>true</literal>
-         .
-      </para>
-   </section>
-
-</chapter>

Added: pojo/trunk/src/main/docbook/userguide/en/modules/architecture.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/architecture.xml	                        (rev 0)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/architecture.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -0,0 +1,488 @@
+<chapter id="architecture">
+
+   <title>Architecture</title>
+
+      <para>POJO Cache internally uses the JBoss Aop framework to both intercept object field access, and 
+         to provide an internal interceptor stack for centralizing common behavior (e.g. locking, transactions). </para>
+
+      <para>The following figure is a simple overview of the POJO Cache architecture. From the top, it can be can seen that
+      when a call comes in (e.g., <literal>attach</literal> or <literal>detach</literal>), it will go through
+      the POJO Cache interceptor stack first. After that, it will store the object's fields into the underlying Core Cache,  
+      which will be replicated (if enabled) using JGroups.</para>
+      <figure>
+         <title>POJO Cache architecture overview</title>
+
+         <mediaobject>
+            <imageobject>
+               <imagedata fileref="images/pojocache_architecture.png"/>
+            </imageobject>
+         </mediaobject>
+      </figure>
+
+   <sect1>
+      <title>POJO Cache interceptor stack</title>
+
+      <para>As mentioned, the JBoss Aop framework is used to provide a configurable interceptor stack.
+         In the current implementation, the main POJO Cache methods have their own independant stack. These are specified in <literal>META-INF/pojocache-aop.xml</literal>
+         In most cases, this file should be left alone, although advanced users may wish to add their own interceptors.
+         The Following is the default configuration:</para>
+<programlisting>
+   &lt;!-- Check id range validity --&gt;
+   &lt;interceptor name="CheckId" class="org.jboss.cache.pojo.interceptors.CheckIdInterceptor"
+         scope="PER_INSTANCE"/&gt;
+
+   &lt;!-- Track Tx undo operation --&gt;
+   &lt;interceptor name="Undo" class="org.jboss.cache.pojo.interceptors.PojoTxUndoInterceptor"
+         scope="PER_INSTANCE"/&gt;
+
+   &lt;!-- Begining of interceptor chain --&gt;
+   &lt;interceptor name="Start" class="org.jboss.cache.pojo.interceptors.PojoBeginInterceptor"
+         scope="PER_INSTANCE"/&gt;
+
+   &lt;!-- Check if we need a local tx for batch processing --&gt;
+   &lt;interceptor name="Tx" class="org.jboss.cache.pojo.interceptors.PojoTxInterceptor"
+         scope="PER_INSTANCE"/&gt;
+
+   &lt;!--
+      Mockup failed tx for testing. You will need to set PojoFailedTxMockupInterceptor.setRollback(true)
+      to activate it.
+   --&gt;
+   &lt;interceptor name="MockupTx" class="org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor"
+         scope="PER_INSTANCE"/&gt;
+
+   &lt;!-- Perform parent level node locking --&gt;
+   &lt;interceptor name="TxLock" class="org.jboss.cache.pojo.interceptors.PojoTxLockInterceptor"
+         scope="PER_INSTANCE"/&gt;
+
+   &lt;!-- Interceptor to perform Pojo level rollback --&gt;
+   &lt;interceptor name="TxUndo" class="org.jboss.cache.pojo.interceptors.PojoTxUndoSynchronizationInterceptor"
+                scope="PER_INSTANCE"/&gt;
+
+   &lt;!-- Interceptor to used to check recursive field interception. --&gt;
+   &lt;interceptor name="Reentrant" class="org.jboss.cache.pojo.interceptors.MethodReentrancyStopperInterceptor"
+                scope="PER_INSTANCE"/&gt;
+
+   &lt;!-- Whether to allow non-serializable pojo. Default is false. --&gt;
+   &lt;interceptor name="MarshallNonSerializable" class="org.jboss.cache.pojo.interceptors.CheckNonSerializableInterceptor"
+                scope="PER_INSTANCE"&gt;
+         &lt;attribute name="marshallNonSerializable"&gt;false&lt;/attribute&gt;
+                &lt;/interceptor&gt;
+
+   &lt;stack name="Attach"&gt;
+      &lt;interceptor-ref name="Start"/&gt;
+      &lt;interceptor-ref name="CheckId"/&gt;
+      &lt;interceptor-ref name="Tx"/&gt;
+      &lt;interceptor-ref name="TxLock"/&gt;
+      &lt;interceptor-ref name="TxUndo"/&gt;
+   &lt;/stack&gt;
+
+   &lt;stack name="Detach"&gt;
+      &lt;interceptor-ref name="Start"/&gt;
+      &lt;interceptor-ref name="CheckId"/&gt;
+      &lt;interceptor-ref name="Tx"/&gt;
+      &lt;interceptor-ref name="TxLock"/&gt;
+      &lt;interceptor-ref name="TxUndo"/&gt;
+   &lt;/stack&gt;
+
+   &lt;stack name="Find"&gt;
+      &lt;interceptor-ref name="Start"/&gt;
+      &lt;interceptor-ref name="CheckId"/&gt;
+   &lt;/stack&gt;
+</programlisting>
+<para>
+         The stack should be self-explanatory. For example, for the <literal>Attach</literal> stack,
+         we currently have <literal>Start, CheckId, Tx, TxLock</literal>, and
+         <literal>TxUndo</literal> interceptors. The stack always starts with a
+         <literal>Start</literal> interceptor such that initialization can be done properly.
+         <literal>CheckId</literal> is to ensure the validity of the Id (e.g., it didn't use any internal
+         Id string). Finally, <literal>Tx, TxLock</literal>, and <literal>TxUndo</literal> are handling the
+         the proper transaction locking and rollback behavior (if needed).
+</para>
+   </sect1>
+      <sect1>
+         <title>Field interception</title>
+
+         <para>POJO Cache currently uses JBoss AOP to intercept field operations. If a class has been properly instrumented (by either 
+            using the <literal>@Replicable</literal> annotation, or if the object has already been advised by JBoss AOP), then a cache
+            interceptor is added during an <literal>attach()</literal> call.  
+            Afterward, any field modification will invoke the corresponding <literal>CacheFieldInterceptor</literal>
+            instance. Below is a schematic illustration of this process.
+         </para>
+
+         <para>Only fields, and not methods are intercepted, since this is the most efficient and accurate way to gaurantee the same data is visible on all nodes in the cluster. Further, this allows for objects that do not conform to the JavaBean specficiation to be replicable.
+            There are two important aspects of field interception:
+            <itemizedlist>
+               <listitem>
+                  All access qualifiers are intercepted. In other words, all <literal>private</literal>, all <literal>protected</literal>, all default, and all <literal>public</literal> fields will be intercepted.
+               </listitem>
+               <listitem>
+                   Any field with <literal>final</literal>, <literal>static</literal>, and/or <literal>transient</literal> qualifiers,  <emphasis role="bold">will be skipped</emphasis>. Therefore, they will not be replicated, passivated, or manipulated in any way by POJO Cache.
+               </listitem>
+            </itemizedlist>
+         </para>
+<para>The figure below illustrates both field read and write operations. 
+            Once an POJO is managed by POJO Cache (i.e., after an
+            <literal>attach()</literal>
+            method has been called), JBoss Aop will invoke the 
+            <literal>CacheFieldInterceptor</literal> every time a class operates on a field. The cache is always consulted, since it is in control
+            of the mapped data (i.e. it gaurantess the state changes made by other nodes in the cluster are visible).  Afterwords, the in-memmory copy is 
+            updated. This is mainly to allow transaction rollbacks to restore the previous state of the object.              
+         </para>
+
+         <figure>
+            <title>POJO Cache field interception</title>
+
+            <mediaobject>
+               <imageobject>
+                  <imagedata fileref="images/set.png"/>
+               </imageobject>
+            </mediaobject>
+         </figure>
+      </sect1>
+
+
+      <sect1>
+         <title>Object relationship management</title>
+
+         <para>As previously mentioned, unlike a traditional cache system, POJO Cache preserves object identity. This allows
+            for any type of object relationship available in the Java language to be transparently handled.  </para>
+
+         <para>During the mapping process, all object references are checked to see if they are already stored in the cache. If already stored, instead of duplicating the data, a reference to the original object is written in the cache. All referenced objects are reference counted, so they will be removed once they are no longer referenced.  
+         </para>
+
+         <para>To look at one example, let's say that multiple
+            <literal>Person</literal>s ("joe" and "mary")
+            objects can own the same
+            <literal>Address</literal>
+            (e.g., a household). The following diagram is a graphical representation of the pysical cache data.
+            As can be seen, the "San Jose" address is only stored once.
+         </para>
+
+         <figure>
+            <title>Schematic illustration of object relationship mapping</title>
+
+            <mediaobject>
+               <imageobject>
+                  <imagedata fileref="images/reference.png"/>
+               </imageobject>
+            </mediaobject>
+         </figure>
+
+         <para>In the following code snippet, we show programmatically the object sharing example.
+         </para>
+
+<programlisting>
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.test.cache.test.standAloneAop.Person;
+import org.jboss.test.cache.test.standAloneAop.Address;
+
+String configFile = "META-INF/replSync-service.xml";
+PojoCache cache = PojoCacheFactory.createCache(configFile); // This will start PojoCache automatically
+
+Person joe = new Person(); // instantiate a Person object named joe
+joe.setName("Joe Black");
+joe.setAge(41);
+
+Person mary = new Person(); // instantiate a Person object named mary
+mary.setName("Mary White");
+mary.setAge(30);
+
+Address addr = new Address(); // instantiate a Address object named addr
+addr.setCity("Sunnyvale");
+addr.setStreet("123 Albert Ave");
+addr.setZip(94086);
+
+joe.setAddress(addr); // set the address reference
+mary.setAddress(addr); // set the address reference
+
+cache.attach("pojo/joe", joe); // add aop sanctioned object (and sub-objects) into cache.
+cache.attach("pojo/mary", mary); // add aop sanctioned object (and sub-objects) into cache.
+
+Address joeAddr = joe.getAddress();
+Address maryAddr = mary.getAddress(); // joeAddr and maryAddr should be the same instance
+
+cache.detach("pojo/joe");
+maryAddr = mary.getAddress(); // Should still have the address.
+</programlisting>
+
+         <para>If 
+            <literal>joe</literal>
+            is removed from
+            the cache,
+            <literal>mary</literal>
+            should still have reference the same
+            <literal>Address</literal>
+            object in the cache store.
+         </para>
+
+         <para>To further illustrate this relationship management, let's examine the Java code under a replicated
+         environment. Imagine two separate cache instances in the cluster now (<literal>cache1</literal>
+            and <literal>cache2</literal>). On the first cache instance, both <literal>joe</literal>
+            and <literal>mary</literal> are attached as above. Then, the application fails over to <literal>cache2.</literal>
+            Here is the code
+            snippet for <literal>cache2</literal> (assume the objects were already attached):
+         </para>
+<programlisting>
+/**
+ * Code snippet on cache2 during fail-over
+ */
+import org.jboss.cache.PropertyConfigurator;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.test.cache.test.standAloneAop.Person;
+import org.jboss.test.cache.test.standAloneAop.Address;
+
+String configFile = "META-INF/replSync-service.xml";
+PojoCache cache2 = PojoCacheFactory.createCache(configFile); // This will start PojoCache automatically
+
+Person joe = cache2.find("pojo/joe"); // retrieve the POJO reference.
+Person mary = cache2.find("pojo/mary"); // retrieve the POJO reference.
+
+Address joeAddr = joe.getAddress();
+Address maryAddr = mary.getAddress(); // joeAddr and maryAddr should be the same instance!!!
+
+maryAddr = mary.getAddress().setZip(95123);
+int zip = joeAddr.getAddress().getZip(); // Should be 95123 as well instead of 94086!
+</programlisting>
+      </sect1>
+
+      <sect1>
+         <title>Object Inheritance</title>
+
+         <para>POJO Cache preserves the inheritance hierarchy of all attached objects.
+            For example, if a
+            <literal>Student</literal>
+            extends
+            <literal>Person</literal>
+            with an additional field
+            <literal>year</literal>, 
+            then once
+            <literal>Student</literal>
+            is put into the cache, all the class
+            attributes of
+            <literal>Person</literal>
+            are mapped to the cache as well.
+         </para>
+
+         <para>Following is a code snippet that illustrates how the inheritance
+            behavior of a POJO is maintained. Again, no special configuration is
+            needed.</para>
+
+<programlisting>
+import org.jboss.test.cache.test.standAloneAop.Student;
+
+Student joe = new Student(); // Student extends Person class
+joe.setName("Joe Black"); // This is base class attributes
+joe.setAge(22); // This is also base class attributes
+joe.setYear("Senior"); // This is Student class attribute
+
+cache.attach("pojo/student/joe", joe);
+
+//...
+
+joe = (Student)cache.attach("pojo/student/joe");
+Person person = (Person)joe; // it will be correct here
+joe.setYear("Junior"); // will be intercepted by the cache
+joe.setName("Joe Black II"); // also intercepted by the cache
+</programlisting>
+      </sect1>
+
+   <sect1>
+      <title>Physical object cache mapping model</title>
+      <para>The previous sections describe the logical object mapping model. In this section, we will explain
+      the physical mapping model, that is, how do we map the POJO into Core Cache
+      for transactional state replication. However, it should be noted that the physical structure of the cache
+      is purely an internal implementation detail, it should not be treated as an API as it may change in future 
+      releases. This information is provided solely to aid in better understanding the mapping process in POJO Cache.</para>
+
+      <para>When an object is first attached in POJO Cache, the Core Cache node representation is created in a special internal 
+            area. The <literal>Id</literal> fqn that is passed to <literal>attach()</literal> is used to create an empty node that
+            references the internal node. Future references to the same object will point to the same internal node location, and that
+            node will remain until all such references have been removed (detached).
+         </para>
+
+      <para>The example below demonstrates the mapping of the <literal>Person</literal> object under id "pojo/joe" and
+         "pojo/mary" as metioned in previous sections.  It is created from a two node replication group where
+         one node is a Beanshell window and the other node is a Swing Gui window (shown here).
+         For clarity, multiple snapshots were taken to highlight the mapping process.</para><para>
+         The first figure illustrates the first step of the mapping approach. From the bottom of the figure,
+         it can be seen that
+      the <literal>PojoReference</literal> field under <literal>pojo/joe</literal> is pointing to an
+         internal location,
+      <literal>/__JBossInternal__/5c4o12-lpaf5g-esl49n5e-1-esl49n5o-2</literal>. That is, under the user-specified
+      Id string, we store only an indirect reference to the internal area. Please note that
+         <literal>Mary</literal> has a similar reference.</para> 
+      <figure>
+         <title>Object cache mapping for <literal>Joe</literal></title>
+
+         <mediaobject>
+            <imageobject>
+               <imagedata fileref="images/guiJoe.png"/>
+            </imageobject>
+         </mediaobject>
+      </figure>
+
+      <figure>
+         <title>Object cache mapping for <literal>Mary</literal></title>
+
+         <mediaobject>
+            <imageobject>
+               <imagedata fileref="images/guiMary.png"/>
+            </imageobject>
+         </mediaobject>
+      </figure>
+
+      <para>Then by clicking on the referenced internal node (from the following figure), it can seen that the
+         primitive fields for <literal>Joe</literal> are stored there. E.g., <literal>Age</literal> is
+         <literal>41</literal> and
+         <literal>Name</literal> is <literal>Joe Black</literal>. And similarly for <literal>Mary</literal> as
+         well.
+      </para>
+      <figure>
+         <title>Object cache mapping for internal node <literal>Joe</literal></title>
+
+         <mediaobject>
+            <imageobject>
+               <imagedata fileref="images/guiJoeInternal.png"/>
+            </imageobject>
+         </mediaobject>
+      </figure>
+      <figure>
+         <title>Object cache mapping for internal node <literal>Mary</literal></title>
+
+         <mediaobject>
+            <imageobject>
+               <imagedata fileref="images/guiMaryInternal.png"/>
+            </imageobject>
+         </mediaobject>
+      </figure>
+
+      <para>Under the <literal>/__JBossInternal__/5c4o12-lpaf5g-esl49n5e-1-esl49n5o-2</literal>, it can be seen that
+      there is an <literal>Address</literal> node. Clicking
+      on the <literal>Address</literal> node shows that it references another internal location:
+       <literal>/__JBossInternal__/5c4o12-lpaf5g-esl49n5e-1-esl49ngs-3</literal> as shown in the following figure.
+      Then by the same token, the <literal>Address</literal> node under
+         <literal>/__JBossInternal__/5c4o12-lpaf5g-esl49n5e-1-esl49na0-4</literal> points to the same
+      address reference. That is, both <literal>Joe</literal> and <literal>Mary</literal> share the same
+      <literal>Address</literal> reference.</para>
+      <figure>
+         <title>Object cache mapping: Joe's internal address</title>
+
+         <mediaobject>
+            <imageobject>
+               <imagedata fileref="images/guiJoeAddress.png"/>
+            </imageobject>
+         </mediaobject>
+      </figure>
+
+      <figure>
+         <title>Object cache mapping: Mary's internal address</title>
+
+         <mediaobject>
+            <imageobject>
+               <imagedata fileref="images/guiMaryAddress.png"/>
+            </imageobject>
+         </mediaobject>
+      </figure>
+
+      <para>Finally, the <literal>/__JBossInternal__/5c4o12-lpaf5g-esl49n5e-1-esl49ngs-3</literal> node
+      contains the various various primitive fields of <literal>Address</literal>, e.g., <literal>Street</literal>,
+      <literal>Zip</literal>, and <literal>City</literal>. This is illustrated in the following figure.</para>
+      <figure>
+         <title>Object cache mapping: Address fields</title>
+
+         <mediaobject>
+            <imageobject>
+               <imagedata fileref="images/guiAddress.png"/>
+            </imageobject>
+         </mediaobject>
+      </figure>
+      </sect1>
+      <sect1>
+         <title>Collection Mapping</title>
+
+         <para>Due to current Java limitations, Collection classes that implement 
+            <literal>Set</literal>, <literal>List</literal>, and <literal>Map</literal>
+            are substituted with a Java proxy.  That is, whenever POJO Cache encounters 
+            any Collection instance, it will:
+            <itemizedlist>
+               <listitem>
+                  Create a Collection proxy instance and place it in the cache (instead of the original reference).
+                  The mapping of the Collection elements will still be carried out recursively as expected.
+               </listitem>
+               <listitem>
+                  If the Collection instance is referenced from another object, POJO Cache will swap out the original reference
+                  with the new proxy, so that operations performed by the refering object will be picked up by the cache. 
+               </listitem>
+            </itemizedlist>
+
+            The drawback to this approach is that the calling application must re-get any collection references that were attached. Otherwise, 
+            the cache will not be aware of future changes. If the collection is referenced from another object, then the calling app can obtain
+            the proxy by using the publishing mechanism provided by the object (e.g. Person.getHobbies()). 
+ 
+            If, however, the collection is directly attached to the cache, then a subsequent <literal>find()</literal> call will need to be made
+            to retrieve the proxy.
+         </para>
+
+         <para>The following code snippet illustrates obtaining a direct Collection proxy reference:
+          </para>
+<programlisting>
+List list = new ArrayList();
+list.add("ONE");
+list.add("TWO");
+
+cache.attach("pojo/list", list);
+list.add("THREE"); // This won't be intercepted by the cache!
+
+List proxyList = cache.find("pojo/list"; // Note that list is a proxy reference
+proxyList.add("FOUR"); // This will be intercepted by the cache
+</programlisting>
+
+         <para>
+            This snippet illustrates obtaining the proxy reference from a refering object:
+         </para>
+<programlisting>
+Person joe = new Person();
+joe.setName("Joe Black"); // This is base class attributes
+List lang = new ArrayList();
+lang.add("English");
+lang.add("Mandarin");
+joe.setLanguages(lang);
+// This will map the languages List automatically and swap it out with the proxy reference.
+cache.attach("pojo/student/joe", joe);
+lang = joe.getLanguages(); // Note that lang is now a proxy reference
+lang.add("French"); // This will be intercepted by the cache
+</programlisting>
+
+         <para>
+            Finally, when a Collection is removed from the cache (e.g., via <literal>detach</literal>),
+             you still can use the proxy reference. POJO Cache will just redirect the call back to the in-memory copy. See below:
+         </para>
+<programlisting>
+List list = new ArrayList();
+list.add("ONE");
+list.add("TWO");
+
+cache.attach("pojo/list", list);
+List proxyList = cache.find("pojo/list"); // Note that list is a proxy reference
+proxyList.add("THREE"); // This will be intercepted by the cache
+
+cache.detach("pojo/list"); // detach from the cache
+proxyList.add("FOUR"); // proxyList has 4 elements still.
+</programlisting>
+         <sect2>
+            <title>Limitations</title>
+            <para>The current implementation has the following
+            limitations with collections:</para>
+            <itemizedlist>
+            <listitem>Only List, Set and Map are supported. Also it should be noted that the Java Collection API does not 
+                  fully describe the behavior of implementations, so the cache versions may differ slightly from the common Java implementations (e.g. handling of NULL)
+            </listitem>
+            <listitem>As of PojoCache 2.0, HashMap keys must be serializable.
+                Prior to PojoCache 2.0, HashMap keys were converted to String.
+                This was fixed as you couldn't get the key back in its original form.  See issue JBCACHE-399 for more details.
+            </listitem>
+            </itemizedlist>
+         </sect2>
+      </sect1>
+</chapter>


Property changes on: pojo/trunk/src/main/docbook/userguide/en/modules/architecture.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/basic_api.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/basic_api.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/basic_api.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,719 +0,0 @@
-<chapter id="api">
-   <title>User API</title>
-   <section>
-      <title>API Classes</title>
-      <para>
-         The
-         <literal>Cache</literal>
-         interface is the primary mechanism for interacting with JBoss Cache. It is
-         constructed and optionally started using the
-         <literal>CacheFactory</literal>
-         . The
-         <literal>CacheFactory</literal>
-         allows you to create a
-         <literal>Cache</literal>
-         either from a
-         <literal>Configuration</literal>
-         object
-         or an XML file. Once you have a reference to a
-         <literal>Cache</literal>
-         , you can use it to look up
-         <literal>Node</literal>
-         objects in the tree structure, and store data in the tree.
-
-         <mediaobject>
-            <imageobject>
-               <imagedata fileref="PublicAPI.png" format="PNG"/>
-            </imageobject>
-         </mediaobject>
-
-      </para>
-
-      <para>
-         Reviewing the javadoc for the above interfaces is the best way
-         to learn the API. Below we cover some of the main points.
-      </para>
-   </section>
-
-   <section id="api.create_start">
-      <title>Instantiating and Starting the Cache</title>
-      <para>
-         An instance of the
-         <literal>Cache</literal>
-         interface can only be created
-         via a
-         <literal>CacheFactory</literal>
-         . (This is unlike JBoss Cache 1.x,
-         where an instance of the old
-         <literal>TreeCache</literal>
-         class could
-         be directly instantiated.)
-      </para>
-      <para>
-         <literal>CacheFactory</literal>
-         provides a number of overloaded methods
-         for creating a
-         <literal>Cache</literal>
-         , but they all do the same thing:
-         <itemizedlist>
-            <listitem>Gain access to a
-               <literal>Configuration</literal>
-               , either
-               by having one passed in as a method parameter, or by parsing XML
-               content and constructing one. The XML content can come from a
-               provided input stream or from a classpath or filesystem location.
-               See the
-               <link linkend="configuration">chapter on Configuration</link>
-               for
-               more on obtaining a
-               <literal>Configuration</literal>
-               .
-            </listitem>
-            <listitem>Instantiate the
-               <literal>Cache</literal>
-               and provide
-               it with a reference to the
-               <literal>Configuration</literal>
-               .
-            </listitem>
-            <listitem>Optionally invoke the cache's
-               <literal>create()</literal>
-               and
-               <literal>start()</literal>
-               methods.
-            </listitem>
-         </itemizedlist>
-      </para>
-
-      <para>
-         An example of the simplest mechanism for creating and starting
-         a cache, using the default configuration values:
-      </para>
-
-      <programlisting>
-         CacheFactory factory = DefaultCacheFactory.getInstance();
-         Cache cache = factory.createCache();
-      </programlisting>
-
-      <para>Here we tell the
-         <literal>CacheFactory</literal>
-         to find and
-         parse a configuration file on the classpath:
-      </para>
-
-      <programlisting>
-         CacheFactory factory = DefaultCacheFactory.getInstance();
-         Cache cache = factory.createCache("cache-configuration.xml");
-      </programlisting>
-
-      <para>Here we configure the cache from a file, but want to programatically
-         change a configuration element. So, we tell the factory not to start
-         the cache, and instead do it ourselves:
-      </para>
-
-      <programlisting>
-         CacheFactory factory = DefaultCacheFactory.getInstance();
-         Cache cache = factory.createCache("cache-configuration.xml", false);
-         Configuration config = cache.getConfiguration();
-         config.setClusterName(this.getClusterName());
-
-         // Have to create and start cache before using it
-         cache.create();
-         cache.start();
-      </programlisting>
-
-   </section>
-
-   <section>
-      <title>Caching and Retrieving Data</title>
-
-      <para>Next, let's use the
-         <literal>Cache</literal>
-         API to access
-         a
-         <literal>Node</literal>
-         in the cache and then do some
-         simple reads and writes to that node.
-      </para>
-      <programlisting>
-         // Let's get ahold of the root node.
-         Node rootNode = cache.getRoot();
-
-         // Remember, JBoss Cache stores data in a tree structure.
-         // All nodes in the tree structure are identified by Fqn objects.
-         Fqn peterGriffinFqn = Fqn.fromString("/griffin/peter");
-
-         // Create a new Node
-         Node peterGriffin = rootNode.addChild(peterGriffinFqn);
-
-         // let's store some data in the node
-         peterGriffin.put("isCartoonCharacter", Boolean.TRUE);
-         peterGriffin.put("favouriteDrink", new Beer());
-
-         // some tests (just assume this code is in a JUnit test case)
-         assertTrue(peterGriffin.get("isCartoonCharacter"));
-         assertEquals(peterGriffinFqn, peterGriffin.getFqn());
-         assertTrue(rootNode.hasChild(peterGriffinFqn));
-
-         Set keys = new HashSet();
-         keys.add("isCartoonCharacter");
-         keys.add("favouriteDrink");
-
-         assertEquals(keys, peterGriffin.getKeys());
-
-         // let's remove some data from the node
-         peterGriffin.remove("favouriteDrink");
-
-         assertNull(peterGriffin.get("favouriteDrink");
-
-         // let's remove the node altogether
-         rootNode.removeChild(peterGriffinFqn);
-
-         assertFalse(rootNode.hasChild(peterGriffinFqn));
-      </programlisting>
-
-      <para>
-         The
-         <literal>Cache</literal>
-         interface also exposes put/get/remove
-         operations that take an
-         <link linkend="basic_api.fqn">Fqn</link>
-         as an argument:
-      </para>
-
-      <programlisting>
-         Fqn peterGriffinFqn = Fqn.fromString("/griffin/peter");
-
-         cache.put(peterGriffinFqn, "isCartoonCharacter", Boolean.TRUE);
-         cache.put(peterGriffinFqn, "favouriteDrink", new Beer());
-
-         assertTrue(peterGriffin.get(peterGriffinFqn, "isCartoonCharacter"));
-         assertTrue(cache.getRootNode().hasChild(peterGriffinFqn));
-
-         cache.remove(peterGriffinFqn, "favouriteDrink");
-
-         assertNull(cache.get(peterGriffinFqn, "favouriteDrink");
-
-         cache.removeNode(peterGriffinFqn);
-
-         assertFalse(cache.getRootNode().hasChild(peterGriffinFqn));
-      </programlisting>
-   </section>
-
-   <section id="basic_api.fqn">
-      <title>The
-         <literal>Fqn</literal>
-         Class
-      </title>
-
-      <para>
-         The previous section used the
-         <literal>Fqn</literal>
-         class in its
-         examples; now let's learn a bit more about that class.
-      </para>
-
-      <para>
-         A Fully Qualified Name (Fqn) encapsulates a list of names which represent
-         a path to a particular location in the cache's tree structure. The
-         elements in the list are typically
-         <literal>String</literal>
-         s but can be
-         any
-         <literal>Object</literal>
-         or a mix of different types.
-      </para>
-
-      <para>
-         This path can be absolute (i.e., relative to the root node), or relative
-         to any node in the cache. Reading the documentation on each API call that
-         makes use of
-         <literal>Fqn</literal>
-         will tell you whether the API expects
-         a relative or absolute
-         <literal>Fqn</literal>
-         .
-      </para>
-
-      <para>
-         The
-         <literal>Fqn</literal>
-         class provides are variety of constructors;
-         see the javadoc for all the possibilities. The following illustrates the
-         most commonly used approaches to creating an Fqn:
-      </para>
-
-      <programlisting>
-         <![CDATA[
-	    // Create an Fqn pointing to node 'Joe' under parent node 'Smith'
-	    // under the 'people' section of the tree
-	    
-	    // Parse it from a String
-	    Fqn<String> abc = Fqn.fromString("/people/Smith/Joe/");
-	    
-	    // Build it directly. A bit more efficient to construct than parsing
-	    String[] strings = new String[] { "people", "Smith", "Joe" };
-	    Fqn<String> abc = new Fqn<String>(strings);
-	    
-	    // Here we want to use types other than String
-	    Object[] objs = new Object[]{ "accounts", "NY", new Integer(12345) };
-	    Fqn<Object> acctFqn = new Fqn<Object>(objs);
-     ]]>
-      </programlisting>
-
-      <para>Note that</para>
-      <para>
-         <programlisting><![CDATA[Fqn<String> f = new Fqn<String>("/a/b/c");]]></programlisting>
-      </para>
-      <para>is
-         <emphasis>not</emphasis>
-         the same as
-      </para>
-      <para>
-         <programlisting><![CDATA[Fqn<String> f = Fqn.fromString("/a/b/c");]]></programlisting>
-      </para>
-
-      <para>
-         The former will result in an Fqn with a single element, called "/a/b/c"
-         which hangs directly under the cache root. The latter will result
-         in a 3 element Fqn, where "c" idicates a child of "b", which is a child
-         of "a", and "a" hangs off the cache root. Another way to
-         look at it is that the "/" separarator is only parsed when it forms
-         part of a String passed in to
-         <literal>Fqn.fromString()</literal>
-         and not
-         otherwise.
-      </para>
-
-      <para>
-         The JBoss Cache API in the 1.x releases included many overloaded
-         convenience methods that took a string in the "/a/b/c" format in place
-         of an
-         <literal>Fqn</literal>
-         . In the interests of API simplicity, no
-         such convenience methods are available in the JBC 2.x API.
-      </para>
-
-   </section>
-
-   <section>
-      <title>Stopping and Destroying the Cache</title>
-      <para>
-         It is good practice to stop and destroy your cache when you are done
-         using it, particularly if it is a clustered cache and has thus
-         used a JGroups channel. Stopping and destroying a cache ensures
-         resources like the JGroups channel are properly cleaned up.
-      </para>
-
-      <programlisting>
-         cache.stop();
-         cache.destroy();
-      </programlisting>
-
-      <para>
-         Not also that a cache that has had
-         <literal>stop()</literal>
-         invoked
-         on it can be started again with a new call to
-         <literal>start()</literal>
-         .
-         Similarly, a cache that has had
-         <literal>destroy()</literal>
-         invoked
-         on it can be created again with a new call to
-         <literal>create()</literal>
-         (and then started again with a
-         <literal>start()</literal>
-         call).
-      </para>
-   </section>
-
-   <section>
-      <title>Cache Modes</title>
-      <para>
-         Although technically not part of the API, the
-         <emphasis>mode</emphasis>
-         in which the cache is configured to operate affects the cluster-wide
-         behavior of any
-         <literal>put</literal>
-         or
-         <literal>remove</literal>
-         operation, so we'll briefly mention the various modes here.
-      </para>
-      <para>
-         JBoss Cache modes are denoted by the
-         <literal>org.jboss.cache.config.Configuration.CacheMode</literal>
-         enumeration.
-         They consist of:
-         <itemizedlist>
-            <listitem>
-               <emphasis>LOCAL</emphasis>
-               - local, non-clustered cache. Local caches don't join a cluster and don't
-               communicate with other caches in a cluster. Therefore their contents don't need to be Serializable;
-               however, we recommend making them Serializable, allowing you the flexibility to change the cache mode at
-               any time.
-            </listitem>
-            <listitem>
-               <emphasis>REPL_SYNC</emphasis>
-               - synchronous replication. Replicated caches replicate all changes to the other
-               caches in the cluster. Synchronous replication means that changes are replicated and the caller blocks
-               until replication acknowledgements are received.
-            </listitem>
-            <listitem>
-               <emphasis>REPL_ASYNC</emphasis>
-               - asynchronous replication. Similar to REPL_SYNC above, replicated caches replicate
-               all changes to the other caches in the cluster. Being asynchronous, the caller does not block until
-               replication acknowledgements are received.
-            </listitem>
-            <listitem>
-               <emphasis>INVALIDATION_SYNC</emphasis>
-               - if a cache is configured for invalidation rather than replication,
-               every time data is changed in a cache other caches in the cluster
-               receive a message informing them that their data is now stale and should
-               be evicted from memory. This reduces replication overhead while still being able to invalidate stale data
-               on remote caches.
-            </listitem>
-            <listitem>
-               <emphasis>INVALIDATION_ASYNC</emphasis>
-               - as above, except this invalidation mode causes invalidation messages
-               to be broadcast asynchronously.
-            </listitem>
-         </itemizedlist>
-      </para>
-      <para>See the
-         <link linkend="clustering">chapter on Clustering</link>
-         for
-         more details on how the cache's mode affects behavior. See the
-         <link linkend="configuration">chapter on Configuration</link>
-         for info
-         on how to configure things like the cache's mode.
-      </para>
-   </section>
-
-   <section id="api.listener">
-      <title>
-         Adding a CacheListener
-      </title>
-      <para>
-         The
-         <literal>@org.jboss.cache.notifications.annotation.CacheListener</literal>
-         annotation is a convenient
-         mechanism for receiving notifications from a cache about events that happen in the cache. Classes annotated
-         with
-         <literal>@CacheListener</literal>
-         need to be public classes. In addition, the class needs to have one or
-         more methods annotated with one of the method-level annotations (in the
-         <literal>org.jboss.cache.notifications.annotation</literal>
-         package). Methods annotated as such need to be public, have a void return type, and accept a single parameter
-         of
-         type
-         <literal>org.jboss.cache.notifications.event.Event</literal>
-         or one of it's subtypes.
-
-         <itemizedlist>
-            <listitem>
-               <para>
-                  <literal>@CacheStarted</literal>
-                  - methods annotated such receive a notification when the cache is
-                  started. Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.CacheStartedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@CacheStopped</literal>
-                  - methods annotated such receive a notification when the cache is
-                  stopped. Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.CacheStoppedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@NodeCreated</literal>
-                  - methods annotated such receive a notification when a node is
-                  created. Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.NodeCreatedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@NodeRemoved</literal>
-                  - methods annotated such receive a notification when a node is
-                  removed. Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.NodeRemovedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@NodeModified</literal>
-                  - methods annotated such receive a notification when a node is
-                  modified. Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.NodeModifiedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@NodeMoved</literal>
-                  - methods annotated such receive a notification when a node is
-                  moved. Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.NodeMovedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@NodeVisited</literal>
-                  - methods annotated such receive a notification when a node is
-                  started. Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.NodeVisitedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@NodeLoaded</literal>
-                  - methods annotated such receive a notification when a node is
-                  loaded from a
-                  <literal>CacheLoader</literal>
-                  . Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.NodeLoadedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@NodeEvicted</literal>
-                  - methods annotated such receive a notification when a node is
-                  evicted from memory. Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.NodeEvictedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@NodeActivated</literal>
-                  - methods annotated such receive a notification when a node is
-                  activated. Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.NodeActivatedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@NodePassivated</literal>
-                  - methods annotated such receive a notification when a node is
-                  passivated. Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.NodePassivatedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@TransactionRegistered</literal>
-                  - methods annotated such receive a notification when the cache
-                  registers a
-                  <literal>javax.transaction.Synchronization</literal>
-                  with a registered transaction manager.
-                  Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.TransactionRegisteredEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@TransactionCompleted</literal>
-                  - methods annotated such receive a notification when the cache
-                  receives a commit or rollback call from a registered transaction manager.
-                  Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.TransactionCompletedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@ViewChanged</literal>
-                  - methods annotated such receive a notification when the group structure
-                  of the cluster changes. Methods need to accept a parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.ViewChangedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@CacheBlocked</literal>
-                  - methods annotated such receive a notification when the cluster
-                  requests that cache operations are blocked for a state transfer event. Methods need to accept a
-                  parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.CacheBlockedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>@CacheUnblocked</literal>
-                  - methods annotated such receive a notification when the cluster
-                  requests that cache operations are unblocked after a state transfer event. Methods need to accept a
-                  parameter type which is assignable from
-                  <literal>org.jboss.cache.notifications.event.CacheUnblockedEvent</literal>
-                  .
-               </para>
-            </listitem>
-
-         </itemizedlist>
-      </para>
-      <para>
-         Refer to the javadocs on the annotations as well as the
-         <literal>Event</literal>
-         subtypes
-         for details of what is passed in to your method, and when.
-      </para>
-      <para>
-         Example:
-         <programlisting><![CDATA[
-
-   @CacheListener
-   public class MyListener
-   {
-
-      @CacheStarted
-      @CacheStopped
-      public void cacheStartStopEvent(Event e)
-      {
-         switch (e.getType())
-         {
-            case Event.Type.CACHE_STARTED:
-               System.out.println("Cache has started");
-               break;
-            case Event.Type.CACHE_STOPPED:
-               System.out.println("Cache has stopped");
-               break;
-         }
-      }
-
-      @NodeCreated
-      @NodeRemoved
-      @NodeVisited
-      @NodeModified
-      @NodeMoved
-      public void logNodeEvent(NodeEvent ne)
-      {
-         log("An event on node " + ne.getFqn() + " has occured");
-      }
-   }
-
-         ]]></programlisting>
-      </para>
-   </section>
-
-   <section>
-      <title>Using Cache Loaders</title>
-      <para>
-         Cache loaders are an important part of JBoss Cache. They allow persistence of nodes to disk or to remote cache
-         clusters, and allow for passivation when caches run out of memory. In addition, cache loaders allow JBoss Cache
-         to perform 'warm starts', where in-memory state can be preloaded from persistent storage. JBoss Cache ships
-         with a number of cache loader implementations.
-         <itemizedlist>
-            <listitem>
-               <literal>org.jboss.cache.loader.FileCacheLoader</literal>
-               - a basic, filesystem based cache loader that persists data to disk. Non-transactional and not very
-               performant, but a very simple solution. Used mainly for testing and not recommended for production use.
-            </listitem>
-            <listitem>
-               <literal>org.jboss.cache.loader.JDBCCacheLoader</literal>
-               - uses a JDBC connection to store data. Connections could be created and maintained in an internal pool
-               (uses the c3p0 pooling library)
-               or from a configured DataSource. The database this CacheLoader connects to could be local or remotely
-               located.
-            </listitem>
-            <listitem>
-               <literal>org.jboss.cache.loader.BdbjeCacheLoader</literal>
-               - uses Oracle's BerkeleyDB file-based transactional database to persist data. Transactional and very
-               performant, but potentially restrictive license.
-            </listitem>
-            <listitem>
-               <literal>org.jboss.cache.loader.JdbmCacheLoader</literal>
-               - an upcoming open source alternative to the BerkeleyDB.
-            </listitem>
-            <listitem>
-               <literal>org.jboss.cache.loader.tcp.TcpCacheLoader</literal>
-               - uses a TCP socket to "persist" data to a remote cluster, using a "far cache" pattern.
-               <footnote>
-                  <para>http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossClusteringPatternFarCache</para>
-               </footnote>
-            </listitem>
-            <listitem>
-               <literal>org.jboss.cache.loader.ClusteredCacheLoader</literal>
-               - used as a "read-only" CacheLoader, where other nodes in the cluster are queried for state.
-            </listitem>
-         </itemizedlist>
-         These CacheLoaders, along with advanced aspects and tuning issues, are discussed in the
-         <link linkend="cache_loaders">chapter dedicated to CacheLoaders</link>
-         .
-      </para>
-   </section>
-
-   <section>
-      <title>Using Eviction Policies</title>
-      <para>
-         Eviction policies are the counterpart to CacheLoaders. They are necessary to make sure the cache does not run
-         out of memory and when the cache starts to fill,
-         the eviction algorithm running in a separate thread offloads in-memory state to the CacheLoader and frees up
-         memory. Eviction policies can be configured
-         on a per-region basis, so different subtrees in the cache could have different eviction preferences.
-
-         JBoss Cache ships with several eviction policies:
-         <itemizedlist>
-            <listitem>
-               <literal>org.jboss.cache.eviction.LRUPolicy</literal>
-               - an eviction policy that evicts the least recently used nodes when thresholds are hit.
-            </listitem>
-            <listitem>
-               <literal>org.jboss.cache.eviction.LFUPolicy</literal>
-               - an eviction policy that evicts the least frequently used nodes when thresholds are hit.
-            </listitem>
-            <listitem>
-               <literal>org.jboss.cache.eviction.MRUPolicy</literal>
-               - an eviction policy that evicts the most recently used nodes when thresholds are hit.
-            </listitem>
-            <listitem>
-               <literal>org.jboss.cache.eviction.FIFOPolicy</literal>
-               - an eviction policy that creates a first-in-first-out queue and evicts the oldest nodes when thresholds
-               are hit.
-            </listitem>
-            <listitem>
-               <literal>org.jboss.cache.eviction.ExpirationPolicy</literal>
-               - an eviction policy that selects nodes for eviction based on an expiry time each node is configured
-               with.
-            </listitem>
-            <listitem>
-               <literal>org.jboss.cache.eviction.ElementSizePolicy</literal>
-               - an eviction policy that selects nodes for eviction based on the number of key/value pairs held in the
-               node.
-            </listitem>
-         </itemizedlist>
-         Detailed configuration and implementing custom eviction policies are discussed in the
-         <link linkend="eviction_policies">chapter dedicated to eviction policies.</link>
-         .
-      </para>
-   </section>
-</chapter>

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/cache_loaders.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/cache_loaders.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/cache_loaders.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,1325 +0,0 @@
-<chapter id="cache_loaders">
-   <title>Cache Loaders</title>
-   <para>JBoss Cache can use a
-      <literal>CacheLoader</literal>
-      to back up the in-memory cache to a backend datastore.
-      If JBoss Cache is configured with a cache loader, then the following features are provided:
-      <itemizedlist>
-         <listitem>Whenever a cache element is accessed, and that element is not in
-            the cache (e.g. due to eviction or due to server restart), then the cache loader transparently
-            loads the element into the cache if found in the backend
-            store.
-         </listitem>
-
-         <listitem>Whenever an element is modified, added or removed, then that
-            modification is persisted in the backend store via the cache loader. If
-            transactions are used, all modifications created within a transaction
-            are persisted. To this end, the
-            <literal>CacheLoader</literal>
-            takes part in the two
-            phase commit protocol run by the transaction manager, although it does not do so explicitly.
-         </listitem>
-      </itemizedlist>
-   </para>
-
-   <section>
-      <title>The CacheLoader Interface and Lifecycle</title>
-
-      <figure>
-         <title>The CacheLoader interface</title>
-
-         <mediaobject>
-            <imageobject>
-               <imagedata fileref="CacheLoader.png"/>
-            </imageobject>
-         </mediaobject>
-      </figure>
-
-
-      <para>The interaction between JBoss Cache and a
-         <literal>CacheLoader</literal>
-         implementation is as follows. When
-         <literal>CacheLoaderConfiguration</literal>
-         (see below) is non-null, an
-         instance of each configured
-         <literal>CacheLoader</literal>
-         is created when the cache is created, and started when the cache is started.
-      </para>
-
-      <para>
-         <literal>CacheLoader.create()</literal>
-         and
-         <literal>CacheLoader.start()</literal>
-         are called when the cache is
-         started. Correspondingly,
-         <literal>stop()</literal>
-         and
-         <literal>destroy()</literal>
-         are called when the cache is
-         stopped.
-      </para>
-
-      <para>Next,
-         <literal>setConfig()</literal>
-         and
-         <literal>setCache()</literal>
-         are called. The latter can be used to
-         store a reference to the cache, the former is used to configure this
-         instance of the
-         <literal>CacheLoader</literal>
-         . For example, here a database cache loader
-         could establish a connection to the database.
-      </para>
-
-      <para>The
-         <literal>CacheLoader</literal>
-         interface has a set of methods that are called
-         when no transactions are used:
-         <literal>get()</literal>
-         ,
-         <literal>put()</literal>
-         ,
-         <literal>remove()</literal>
-         and
-         <literal>removeData()</literal>
-         : they get/set/remove the value
-         immediately. These methods are described as javadoc comments in the
-         interface.
-      </para>
-
-      <para>Then there are three methods that are used with transactions:
-         <literal>prepare()</literal>
-         ,
-         <literal>commit()</literal>
-         and
-         <literal>rollback()</literal>
-         . The
-         <literal>prepare()</literal>
-         method
-         is called when a transaction is to be committed. It has a transaction
-         object and a list of modfications as argument. The transaction object
-         can be used as a key into a hashmap of transactions, where the values
-         are the lists of modifications. Each modification list has a number of
-         <literal>Modification</literal>
-         elements, which represent the changes
-         made to a cache for a given transaction. When
-         <literal>prepare()</literal>
-         returns successfully, then the cache loader
-         <emphasis>must</emphasis>
-         be able to commit (or rollback) the
-         transaction successfully.
-      </para>
-
-      <para>
-         JBoss Cache takes care of calling prepare(), commit()
-         and rollback() on the cache loaders at the right time.
-      </para>
-
-      <para>The
-         <literal>commit()</literal>
-         method tells the cache loader to
-         commit the transaction, and the
-         <literal>rollback()</literal>
-         method
-         tells the cache loader to discard the changes associated with that
-         transaction.
-      </para>
-
-      <para>See the javadocs on this interface for a detailed explanation on each method and the contract
-         implementations
-         would need to fulfil.
-      </para>
-
-   </section>
-
-   <section>
-      <title>Configuration</title>
-
-      <para>Cache loaders are configured as follows in the JBoss Cache XML
-         file. Note that you can define several cache loaders, in
-         a chain. The impact is that the cache will look at all of the cache
-         loaders in the order they've been configured, until it finds a valid,
-         non-null element of data. When performing writes, all cache loaders are
-         written to (except if the
-         <literal>ignoreModifications</literal>
-         element has been set to
-         <literal>true</literal>
-         for a specific cache loader. See the configuration section below for
-         details.
-      </para>
-
-      <programlisting>
-         <![CDATA[
-
-...
-
-<!-- Cache loader config block -->
-<attribute name="CacheLoaderConfiguration">
-   <config>
-      <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
-      <passivation>false</passivation>
-      <!-- comma delimited FQNs to preload -->
-      <preload>/</preload>
-      <!-- are the cache loaders shared in a cluster? -->
-      <shared>false</shared>
-
-      <!-- we can now have multiple cache loaders, which get chained -->
-      <!-- the 'cacheloader' element may be repeated -->
-      <cacheloader>
-
-         <class>org.jboss.cache.loader.JDBCCacheLoader</class>
-
-         <!-- properties to pass in to the cache loader -->
-         <properties>
-            cache.jdbc.driver=com.mysql.jdbc.Driver
-            cache.jdbc.url=jdbc:mysql://localhost:3306/jbossdb
-            cache.jdbc.user=root
-            cache.jdbc.password=
-            cache.jdbc.sql-concat=concat(1,2)
-         </properties>
-
-         <!-- whether the cache loader writes are asynchronous -->
-         <async>false</async>
-
-         <!-- only one cache loader in the chain may set fetchPersistentState to true.
-              An exception is thrown if more than one cache loader sets this to true. -->
-         <fetchPersistentState>true</fetchPersistentState>
-
-         <!-- determines whether this cache loader ignores writes - defaults to false. -->
-         <ignoreModifications>false</ignoreModifications>
-
-         <!-- if set to true, purges the contents of this cache loader when the cache starts up.
-              Defaults to false. -->
-         <purgeOnStartup>false</purgeOnStartup>
-
-         <!-- defines the cache loader as a singleton store where only the coordinator of the
-              cluster will store modifications. -->
-         <singletonStore>
-            <!-- if true, singleton store functionality is enabled, defaults to false -->
-            <enabled>false</enabled>
-
-            <!-- implementation class for singleton store functionality which must extend
-                 org.jboss.cache.loader.AbstractDelegatingCacheLoader. Default implementation
-                 is org.jboss.cache.loader.SingletonStoreCacheLoader -->
-            <class>org.jboss.cache.loader.SingletonStoreCacheLoader</class>
-
-            <!-- properties and default values for the default singleton store functionality
-                 implementation -->
-            <properties>
-               pushStateWhenCoordinator=true
-               pushStateWhenCoordinatorTimeout=20000
-            </properties>
-         </singletonStore>
-      </cacheloader>
-
-   </config>
-</attribute>
-]]>
-      </programlisting>
-
-      <para>The
-         <literal>class</literal>
-         element defines the
-         class of the cache loader implementation. (Note that, because of a bug in
-         the properties editor in JBoss AS, backslashes in variables for Windows
-         filenames might not get expanded correctly, so replace="false" may be
-         necessary). Note that an implementation of cache loader has to have an empty
-         constructor.
-      </para>
-
-      <para>The
-         <literal>properties</literal>
-         element defines a configuration
-         specific to the given implementation. The filesystem-based
-         implementation for example defines the root directory to be used,
-         whereas a database implementation might define the database URL, name
-         and password to establish a database connection. This configuration is
-         passed to the cache loader implementation via
-         <literal>CacheLoader.setConfig(Properties)</literal>
-         . Note that
-         backspaces may have to be escaped.
-      </para>
-
-      <para>
-         <literal>preload</literal>
-         allows us to define a list of nodes, or
-         even entire subtrees, that are visited by the cache on startup, in order
-         to preload the data associated with those nodes. The default ("/") loads
-         the entire data available in the backend store into the cache, which is
-         probably not a good idea given that the data in the backend store might
-         be large. As an example,
-         <literal>/a,
-            /product/catalogue
-         </literal>
-         loads the subtrees
-         <literal>/a</literal>
-         and
-         <literal>/product/catalogue</literal>
-         into the cache, but nothing
-         else. Anything else is loaded lazily when accessed. Preloading makes
-         sense when one anticipates using elements under a given subtree
-         frequently.
-         .
-      </para>
-
-      <para>
-         <literal>fetchPersistentState</literal>
-         determines whether or not
-         to fetch the persistent state of a cache when joining a cluster. Only
-         one configured cache loader may set this property to true; if more than
-         one cache loader does so, a configuration exception will be thrown when
-         starting your cache service.
-      </para>
-
-      <para>
-         <literal>async</literal>
-         determines whether writes to the cache
-         loader block until completed, or are run on a separate thread so writes
-         return immediately. If this is set to true, an instance of
-         <literal>org.jboss.cache.loader.AsyncCacheLoader</literal>
-         is
-         constructed with an instance of the actual cache loader to be used. The
-         <literal>AsyncCacheLoader</literal>
-         then delegates all requests to the
-         underlying cache loader, using a separate thread if necessary. See the
-         Javadocs on
-         <literal>AsyncCacheLoader</literal>
-         for more details. If unspecified, the
-         <literal>async</literal>
-         element
-         defaults to
-         <literal>false</literal>
-         .
-      </para>
-
-      <para>
-         <emphasis role="bold">Note on using the
-            <literal>async</literal>
-            element:
-         </emphasis>
-         there is always the possibility of dirty reads since
-         all writes are performed asynchronously, and it is thus impossible to
-         guarantee when (and even if) a write succeeds. This needs to be kept in
-         mind when setting the
-         <literal>async</literal>
-         element to true.
-      </para>
-
-      <para>
-         <literal>ignoreModifications</literal>
-         determines whether write
-         methods are pushed down to the specific cache loader. Situations may
-         arise where transient application data should only reside in a file
-         based cache loader on the same server as the in-memory cache, for
-         example, with a further shared
-         <literal>JDBCCacheLoader</literal>
-         used by all servers in
-         the network. This feature allows you to write to the 'local' file cache
-         loader but not the shared
-         <literal>JDBCCacheLoader</literal>
-         . This property defaults to
-         <literal>false</literal>
-         , so writes are propagated to all cache loaders
-         configured.
-      </para>
-
-      <para>
-         <literal>purgeOnStatup</literal>
-         empties the specified cache loader
-         (if
-         <literal>ignoreModifications</literal>
-         is
-         <literal>false</literal>
-         )
-         when the cache loader starts up.
-      </para>
-
-      <para>
-         <literal>shared</literal>
-         indicates that the cache loader is shared among different cache instances, for example where all instances in a
-         cluster use the same JDBC settings t talk to the same remote, shared database. Setting this to
-         <literal>true</literal>
-         prevents repeated and unnecessary writes of the same data to the cache loader by different cache instances.
-         Default value is
-         <literal>false</literal>
-         .
-      </para>
-
-      <section>
-         <title>Singleton Store Configuration</title>
-
-         <para>
-            <literal>singletonStore</literal>
-            element enables modifications to be stored by only one node in the cluster,
-            the coordinator. Essentially, whenever any data comes in to some node
-            it is always replicated so as to keep the caches' in-memory states in
-            sync; the coordinator, though, has the sole responsibility of pushing
-            that state to disk. This functionality can be activated setting the
-            <literal>enabled</literal>
-            subelement to true in all nodes, but
-            again only the coordinator of the cluster will store the modifications
-            in the underlying cache loader as defined in
-            <literal>cacheloader</literal>
-            element. You cannot define a cache loader as
-            <literal>shared</literal>
-            and with
-            <literal>singletonStore</literal>
-            enabled at the same time.
-            Default value for
-            <literal>enabled</literal>
-            is
-            <literal>false</literal>
-            .
-         </para>
-
-         <para>            
-            Optionally, within the
-            <literal>singletonStore</literal>
-            element, you can define a
-            <literal>class</literal>
-            element that specifies the implementation class that provides the
-            singleton store functionality. This class must extend
-            <literal>org.jboss.cache.loader.AbstractDelegatingCacheLoader</literal>
-            , and if absent, it defaults to
-            <literal>org.jboss.cache.loader.SingletonStoreCacheLoader</literal>
-            .
-         </para>
-
-         <para>
-            The
-            <literal>properties</literal>
-            subelement defines properties that allow changing the behaivour of the
-            class providing the singleton store functionality. By default,
-            <literal>pushStateWhenCoordinator</literal>
-            and
-            <literal>pushStateWhenCoordinatorTimeout</literal>
-            properties have been defined, but more could be added as
-            required by the user-defined class providing singleton store
-            functionality.
-         </para>
-
-         <para>
-            <literal>pushStateWhenCoordinator</literal>
-            allows the in-memory
-            state to be pushed to the cache store when a node becomes the
-            coordinator, as a result of the new election of coordinator due to a
-            cluster topology change. This can be very useful in situations where the
-            coordinator crashes and there's a gap in time until the new coordinator
-            is elected. During this time, if this property was set to
-            <literal>false</literal>
-            and the
-            cache was updated, these changes would never be persisted. Setting this
-            property to
-            <literal>true</literal>
-            would ensure that any changes during this process also
-            get stored in the cache loader. You would also want to set this property
-            to
-            <literal>true</literal>
-            if each node's cache loader is configured with a different
-            location. Default value is
-            <literal>true</literal>
-            .
-         </para>
-
-         <para>
-            <literal>pushStateWhenCoordinatorTimeout</literal>
-            is only relevant if
-            <literal>pushStateWhenCoordinator</literal>
-            is
-            <literal>true</literal>
-            in which case, sets the maximum number of milliseconds that the process
-            of pushing the in-memory state to the underlying cache loader should take,
-            reporting a
-            <literal>PushStateException</literal>
-            if exceeded. Default value is 20000.
-         </para>
-   
-         <para>
-            <emphasis role="bold">Note on using the
-               <literal>singletonStore</literal>
-               element:
-            </emphasis>
-            setting
-            up a cache loader as a singleton and using cache passivation (via
-            evictions) can lead to undesired effects. If a node is to be passivated
-            as a result of an eviction, while the cluster is in the process of
-            electing a new coordinator, the data will be lost. This is because no
-            coordinator is active at that time and therefore, none of the nodes in
-            the cluster will store the passivated node. A new coordinator is elected
-            in the cluster when either, the coordinator leaves the cluster, the
-            coordinator crashes or stops responding.
-         </para>
-      </section>
-   </section>
-
-   <section id="cl.impls">
-
-      <title>Shipped Implementations</title>
-
-      <para>The currently available implementations shipped with JBoss Cache are as follows.</para>
-
-      <section>
-         <title>File system based cache loaders</title>
-         <para>
-            JBoss Cache ships with several cache loaders that utilise the file system as a data store. They all require
-            that the
-            <literal><![CDATA[<cacheloader><properties>]]></literal>
-            configuration element
-            contains a
-            <literal>location</literal>
-            property, which maps to a directory to be used as a persistent store.
-            (e.g.,
-            <literal>location=/tmp/myDataStore</literal>
-            ). Used mainly for testing and not recommended for production use.
-         </para>
-         <itemizedlist>
-            <listitem>
-               <para>
-                  <literal>FileCacheLoader</literal>
-                  , which is a simple filesystem-based implementation. By default, this cache
-                  loader checks for any potential character portability issues in the
-                  location or tree node names, for example invalid characters, producing
-                  warning messages. These checks can be disabled adding
-                  <literal>check.character.portability</literal>
-                  property to the
-                  <literal><![CDATA[<properties>]]></literal>
-                  element and setting it to
-                  <literal>false</literal>
-                  (e.g.,
-                  <literal>check.character.portability=false</literal>
-                  ).
-               </para>
-               <para>
-                  The FileCacheLoader has some severe limitations which restrict it's use in a production
-                  environment, or if used in such an environment, it should be used with due care and sufficient
-                  understanding of these limitations.
-                  <itemizedlist>
-                     <listitem>Due to the way the FileCacheLoader represents a tree structure on disk (directories and
-                        files) traversal is inefficient for deep trees.
-                     </listitem>
-                     <listitem>Usage on shared filesystems like NFS, Windows shares, etc. should be avoided as these do
-                        not implement proper file locking and can cause data corruption.
-                     </listitem>
-                     <listitem>Usage with an isolation level of NONE can cause corrupt writes as multiple threads
-                        attempt to write to the same file.
-                     </listitem>
-                     <listitem>File systems are inherently not transactional, so when attempting to use your cache in a
-                        transactional context, failures when writing to the file (which happens during the commit phase)
-                        cannot be recovered.
-                     </listitem>
-                  </itemizedlist>
-
-                  As a rule of thumb, it is recommended that the FileCacheLoader not be used in a highly concurrent,
-                  transactional or stressful environment, and it's use is restricted to testing.
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>BdbjeCacheLoader</literal>
-                  , which is a cache loader implementation based on the Oracle/Sleepycat's
-                  <ulink url="http://www.oracle.com/database/berkeley-db/index.html">BerkeleyDB Java Edition</ulink>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>
-                  <literal>JdbmCacheLoader</literal>
-                  , which is a cache loader
-                  implementation based on the
-                  <ulink url="http://jdbm.sourceforge.net/">JDBM engine</ulink>
-                  , a fast and free alternative to
-                  BerkeleyDB.
-               </para>
-            </listitem>
-         </itemizedlist>
-
-         <para>Note that the BerkeleyDB implementation is much more efficient than
-            the filesystem-based implementation, and provides transactional
-            guarantees, but requires a commercial license if distributed with an
-            application (see http://www.oracle.com/database/berkeley-db/index.html for
-            details).
-         </para>
-
-      </section>
-
-      <section>
-         <title>Cache loaders that delegate to other caches</title>
-         <itemizedlist>
-            <listitem>
-               <para>
-                  <literal>LocalDelegatingCacheLoader</literal>
-                  , which enables
-                  loading from and storing to another local (same JVM) cache.
-               </para>
-            </listitem>
-            <listitem>
-               <para>
-                  <literal>ClusteredCacheLoader</literal>
-                  , which allows querying
-                  of other caches in the same cluster for in-memory data via the same
-                  clustering protocols used to replicate data. Writes are
-                  <emphasis>not</emphasis>
-                  'stored' though, as replication would
-                  take care of any updates needed. You need to specify a property
-                  called
-                  <literal>timeout</literal>
-                  , a long value telling the cache
-                  loader how many milliseconds to wait for responses from the cluster
-                  before assuming a null value. For example,
-                  <literal>timeout = 3000</literal>
-                  would use a timeout value of 3 seconds.
-               </para>
-            </listitem>
-         </itemizedlist>
-      </section>
-
-
-      <section id="cl.jdbc">
-         <title>JDBCCacheLoader</title>
-
-         <para>JBossCache is distributed with a JDBC-based cache loader
-            implementation that stores/loads nodes' state into a relational database.
-            The implementing class is
-            <literal>org.jboss.cache.loader.JDBCCacheLoader</literal>
-            .
-         </para>
-
-         <para>The current implementation uses just one table. Each row in the table
-            represents one node and contains three columns:
-            <itemizedlist>
-               <listitem>column for
-                  <literal>Fqn</literal>
-                  (which is also a primary key
-                  column)
-               </listitem>
-
-               <listitem>column for node contents (attribute/value
-                  pairs)
-               </listitem>
-
-               <listitem>column for parent
-                  <literal>Fqn</literal>
-               </listitem>
-            </itemizedlist>
-         </para>
-
-         <para>
-            <literal>Fqn</literal>
-            's are stored as strings. Node content is stored
-            as a BLOB.
-            <emphasis>WARNING:</emphasis>
-            JBoss Cache does not impose any
-            limitations on the types of objects used in
-            <literal>Fqn</literal>
-            but this implementation of
-            cache loader requires
-            <literal>Fqn</literal>
-            to contain only objects of type
-            <literal>java.lang.String</literal>
-            . Another limitation for
-            <literal>Fqn</literal>
-            is its
-            length. Since
-            <literal>Fqn</literal>
-            is a primary key, its default column type is
-            <literal>VARCHAR</literal>
-            which can store text values up to some
-            maximum length determined by the database in use.
-         </para>
-
-         <para>See
-            <ulink
-                  url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JDBCCacheLoader">
-               http://wiki.jboss.org/wiki/Wiki.jsp?page=JDBCCacheLoader
-            </ulink>
-            for configuration tips with specific database systems.
-         </para>
-
-         <section>
-            <title>JDBCCacheLoader configuration</title>
-
-            <section>
-               <title>Table configuration</title>
-
-               <para>Table and column names as well as column types are
-                  configurable with the following properties.
-                  <itemizedlist>
-                     <listitem>
-                        <emphasis>cache.jdbc.table.name</emphasis>
-                        - the name
-                        of the table. The default value is 'jbosscache'.
-                     </listitem>
-
-                     <listitem>
-                        <emphasis>cache.jdbc.table.primarykey</emphasis>
-                        - the
-                        name of the primary key for the table. The default value is
-                        'jbosscache_pk'.
-                     </listitem>
-
-                     <listitem>
-                        <emphasis>cache.jdbc.table.create</emphasis>
-                        - can be
-                        true or false. Indicates whether to create the table during startup.
-                        If true, the table is created if it doesn't already exist. The
-                        default value is true.
-                     </listitem>
-
-                     <listitem>
-                        <emphasis>cache.jdbc.table.drop</emphasis>
-                        - can be
-                        true or false. Indicates whether to drop the table during shutdown. The
-                        default value is true.
-                     </listitem>
-
-                     <listitem>
-                        <emphasis>cache.jdbc.fqn.column</emphasis>
-                        - FQN
-                        column name. The default value is 'fqn'.
-                     </listitem>
-
-                     <listitem>
-                        <emphasis>cache.jdbc.fqn.type</emphasis>
-                        - FQN column
-                        type. The default value is 'varchar(255)'.
-                     </listitem>
-
-                     <listitem>
-                        <emphasis>cache.jdbc.node.column</emphasis>
-                        - node
-                        contents column name. The default value is 'node'.
-                     </listitem>
-
-                     <listitem>
-                        <emphasis>cache.jdbc.node.type</emphasis>
-                        - node
-                        contents column type. The default value is 'blob'. This type must specify
-                        a valid binary data type for the database being used.
-                     </listitem>
-                  </itemizedlist>
-               </para>
-            </section>
-
-            <section>
-               <title>DataSource</title>
-
-               <para>If you are using JBossCache in a managed environment (e.g., an
-                  application server) you can specify the JNDI name of the DataSource
-                  you want to use.
-                  <itemizedlist>
-                     <listitem>
-                        <emphasis>cache.jdbc.datasource</emphasis>
-                        - JNDI name
-                        of the DataSource. The default value is
-                        <literal>java:/DefaultDS</literal>
-                        .
-                     </listitem>
-                  </itemizedlist>
-               </para>
-            </section>
-
-            <section>
-               <title>JDBC driver</title>
-
-               <para>If you are
-                  <emphasis>not</emphasis>
-                  using DataSource you have
-                  the following properties to configure database access using a JDBC
-                  driver.
-                  <itemizedlist>
-                     <listitem>
-                        <emphasis>cache.jdbc.driver</emphasis>
-                        - fully
-                        qualified JDBC driver name.
-                     </listitem>
-
-                     <listitem>
-                        <emphasis>cache.jdbc.url</emphasis>
-                        - URL to connect
-                        to the database.
-                     </listitem>
-
-                     <listitem>
-                        <emphasis>cache.jdbc.user</emphasis>
-                        - user name to
-                        connect to the database.
-                     </listitem>
-
-                     <listitem>
-                        <emphasis>cache.jdbc.password</emphasis>
-                        - password to
-                        connect to the database.
-                     </listitem>
-                  </itemizedlist>
-               </para>
-            </section>
-
-            <section>
-               <title>c3p0 connection pooling</title>
-
-               <para>JBoss Cache implements JDBC connection pooling when running outside of an application server
-                  standalone using
-                  the c3p0:JDBC DataSources/Resource Pools library. In order to enable it, just edit the following
-                  property:
-                  <itemizedlist>
-                     <listitem>
-                        <emphasis>cache.jdbc.connection.factory</emphasis>
-                        - Connection factory class name.
-                        If not set, it defaults to standard non-pooled implementation. To enable c3p0 pooling, just set
-                        the
-                        connection factory class for c3p0. See example below.
-                     </listitem>
-                  </itemizedlist>
-               </para>
-
-               <para>You can also set any c3p0 parameters in the same cache loader properties section but don't forget
-                  to
-                  start the property name with 'c3p0.'. To find a list of available properties, please check the
-                  c3p0 documentation for the c3p0 library version distributed in
-                  <ulink url="http://sourceforge.net/projects/c3p0">c3p0:JDBC DataSources/Resource Pools</ulink>
-                  .
-                  Also, in order to provide quick and easy way to try out different pooling
-                  parameters, any of these properties can be set via a System property overriding any values these
-                  properties might have in the JBoss Cache XML configuration file, for example:
-                  <literal>-Dc3p0.maxPoolSize=20</literal>
-                  .
-                  If a c3p0 property is not defined in either the configuration file or as a System property, default
-                  value, as indicated in the c3p0 documentation, will apply.
-               </para>
-            </section>
-
-            <section>
-               <title>Configuration example</title>
-
-               <para>Below is an example of a JDBCCacheLoader using Oracle as
-                  database. The CacheLoaderConfiguration XML element contains an
-                  arbitrary set of properties which define the database-related
-                  configuration.
-               </para>
-
-               <para>
-                  <programlisting>
-                     <![CDATA[
-<attribute name="CacheLoaderConfiguration">
-<config>
-   <passivation>false</passivation>
-   <preload>/some/stuff</preload>
-   <cacheloader>
-      <class>org.jboss.cache.loader.JDBCCacheLoader</class>
-
-      <properties>
-         cache.jdbc.table.name=jbosscache
-         cache.jdbc.table.create=true
-         cache.jdbc.table.drop=true
-         cache.jdbc.table.primarykey=jbosscache_pk
-         cache.jdbc.fqn.column=fqn
-         cache.jdbc.fqn.type=varchar(255)
-         cache.jdbc.node.column=node
-         cache.jdbc.node.type=blob
-         cache.jdbc.parent.column=parent
-         cache.jdbc.driver=oracle.jdbc.OracleDriver
-         cache.jdbc.url=jdbc:oracle:thin:@localhost:1521:JBOSSDB
-         cache.jdbc.user=SCOTT
-         cache.jdbc.password=TIGER
-         cache.jdbc.sql-concat=concat(1,2)
-      </properties>
-
-      <async>false</async>
-      <fetchPersistentState>true</fetchPersistentState>
-      <ignoreModifications>false</ignoreModifications>
-      <purgeOnStartup>false</purgeOnStartup>
-   </cacheloader>
-</config>
-</attribute>
-]]>
-                  </programlisting>
-               </para>
-
-               <para>As an alternative to configuring the entire JDBC connection,
-                  the name of an existing data source can be given:
-               </para>
-
-               <programlisting>
-                  <![CDATA[
-<attribute name="CacheLoaderConfiguration">
-<config>
-   <passivation>false</passivation>
-   <preload>/some/stuff</preload>
-   <cacheloader>
-      <class>org.jboss.cache.loader.JDBCCacheLoader</class>
-
-      <properties>
-         cache.jdbc.datasource=java:/DefaultDS
-      </properties>
-
-      <async>false</async>
-      <fetchPersistentState>true</fetchPersistentState>
-      <ignoreModifications>false</ignoreModifications>
-      <purgeOnStartup>false</purgeOnStartup>
-   </cacheloader>
-</config>
-</attribute>
-]]>
-               </programlisting>
-
-               <para>Cconfiguration example for a cache loader using c3p0 JDBC connection pooling:</para>
-
-               <programlisting>
-                  <![CDATA[
-<attribute name="CacheLoaderConfiguration">
-<config>
-   <passivation>false</passivation>
-   <preload>/some/stuff</preload>
-   <cacheloader>
-      <class>org.jboss.cache.loader.JDBCCacheLoader</class>
-
-      <properties>
-         cache.jdbc.table.name=jbosscache
-         cache.jdbc.table.create=true
-         cache.jdbc.table.drop=true
-         cache.jdbc.table.primarykey=jbosscache_pk
-         cache.jdbc.fqn.column=fqn
-         cache.jdbc.fqn.type=varchar(255)
-         cache.jdbc.node.column=node
-         cache.jdbc.node.type=blob
-         cache.jdbc.parent.column=parent
-         cache.jdbc.driver=oracle.jdbc.OracleDriver
-         cache.jdbc.url=jdbc:oracle:thin:@localhost:1521:JBOSSDB
-         cache.jdbc.user=SCOTT
-         cache.jdbc.password=TIGER
-         cache.jdbc.sql-concat=concat(1,2)
-         cache.jdbc.connection.factory=org.jboss.cache.loader.C3p0ConnectionFactory
-         c3p0.maxPoolSize=20
-         c3p0.checkoutTimeout=5000
-      </properties>
-
-      <async>false</async>
-      <fetchPersistentState>true</fetchPersistentState>
-      <ignoreModifications>false</ignoreModifications>
-      <purgeOnStartup>false</purgeOnStartup>
-   </cacheloader>
-</config>
-</attribute>
-]]>
-               </programlisting>
-
-            </section>
-         </section>
-      </section>
-
-      <section id="cl.tcp">
-         <title>TcpDelegatingCacheLoader</title>
-
-         <para>This cache loader allows to delegate loads and stores to another
-            instance of JBoss Cache, which could reside (a) in the same address
-            space, (b) in a different process on the same host, or (c) in a
-            different process on a different host.
-         </para>
-
-         <para>A TcpDelegatingCacheLoader talks to a remote
-            <literal>org.jboss.cache.loader.tcp.TcpCacheServer</literal>
-            ,
-            which can be a standalone process started on the command line, or embedded as an MBean inside
-            JBoss AS. The
-            <literal>TcpCacheServer</literal>
-            has a reference to another JBoss Cache instance, which
-            it can create itself, or which is given to it (e.g. by JBoss, using
-            dependency injection).
-         </para>
-
-         <para>The TcpDelegatingCacheLoader is configured with the host and
-            port of the remote TcpCacheServer, and uses this to communicate to
-            it.
-         </para>
-
-         <para>The configuration looks as follows:</para>
-
-         <programlisting>
-            <![CDATA[
-<attribute name="CacheLoaderConfiguration">
-<config>
-   <cacheloader>
-      <class>org.jboss.cache.loader.TcpDelegatingCacheLoader</class>
-      <properties>
-         host=myRemoteServer
-         port=7500
-      </properties>
-   </cacheloader>
-</config>
-</attribute>
-]]>
-         </programlisting>
-
-         <para>This means this instance of JBoss Cache will delegate all load
-            and store requests to the remote TcpCacheServer running on
-            <literal>myRemoteServer:7500</literal>
-            .
-         </para>
-
-         <para>A typical use case could be multiple replicated instances of
-            JBoss Cache in the same cluster, all delegating to the same
-            TcpCacheServer instance. The TcpCacheServer might itself delegate to a
-            database via JDBCCacheLoader, but the point here is that - if we have
-            5 nodes all accessing the same dataset - they will load the data from
-            the TcpCacheServer, which has do execute one SQL statement per
-            unloaded data set. If the nodes went directly to the database, then
-            we'd have the same SQL executed multiple times. So TcpCacheServer
-            serves as a natural cache in front of the DB (assuming that a network
-            round trip is faster than a DB access (which usually also include a
-            network round trip)).
-         </para>
-
-         <para>To alleviate single point of failure, we could configure several cache loaders.
-            The first cache loader is a ClusteredCacheLoader, the second a TcpDelegatingCacheLoader, and the
-            last a JDBCacheLoader, effectively defining our cost of access to a
-            cache in increasing order.
-         </para>
-
-      </section>
-
-      <section id="cl.transforming">
-         <title>Transforming Cache Loaders</title>
-
-         <para>The way cached data is written to
-            <literal>FileCacheLoader</literal>
-            and
-            <literal>JDBCCacheLoader</literal>
-            based cache stores has changed in JBoss Cache 2.0 in such way that
-            these cache loaders now write and read data using the same marhalling framework used to replicate data
-            accross the network. Such change is trivial for replication purpouses as it just requires the rest of the
-            nodes to understand this format. However, changing the format of the data in cache stores brings up a new
-            problem: how do users, which have their data stored in JBoss Cache 1.x.x format, migrate their stores to
-            JBoss Cache 2.0 format?
-         </para>
-
-         <para>With this in mind, JBoss Cache 2.0 comes with two cache loader implementations called
-            <literal>org.jboss.cache.loader.TransformingFileCacheLoader</literal>
-            and
-            <literal>org.jboss.cache.loader.TransformingJDBCCacheLoader</literal>
-            located within the optional
-            jbosscache-cacheloader-migration.jar file. These are one-off cache loaders that read data from the
-            cache store in JBoss Cache 1.x.x format and write data to cache stores in JBoss Cache 2.0 format.
-         </para>
-
-         <para>The idea is for users to modify their existing cache configuration file(s) momentarily to use these
-            cache loaders and for them to create a small Java application that creates an instance of this cache,
-            recursively reads the entire cache and writes the data read back into the cache. Once the data is
-            transformed, users can revert back to their original cache configuration file(s). In order to help the users
-            with this task, a cache loader migration example has been constructed which can be located under the
-            <literal>examples/cacheloader-migration</literal>
-            directory within the JBoss Cache distribution. This
-            example, called
-            <literal>examples.TransformStore</literal>
-            , is independent of the actual data stored in
-            the cache as it writes back whatever it was read recursively. It is highly recommended that anyone
-            interested in porting their data run this example first, which contains a
-            <literal>readme.txt</literal>
-            file with detailed information about the example itself, and also use it as base for their own application.
-         </para>
-
-      </section>
-
-   </section>
-
-
-   <section id="cl.pass">
-      <title>Cache Passivation</title>
-
-      <para>A cache loader can be used to enforce node passivation and
-         activation on eviction in a cache.
-      </para>
-
-      <para>
-         <emphasis>Cache Passivation</emphasis>
-         is the process of removing
-         an object from in-memory cache and writing it to a secondary data store
-         (e.g., file system, database) on eviction.
-         <emphasis>Cache
-            Activation
-         </emphasis>
-         is the process of restoring an object from the
-         data store into the in-memory cache when it's needed to be used. In both
-         cases, the configured cache loader will be used to read from the data
-         store and write to the data store.
-      </para>
-
-      <para>When an eviction policy in effect evicts a node
-         from the cache, if passivation is enabled, a notification that the node
-         is being passivated will be emitted to the cache listeners and the
-         node and its children will be stored in the cache loader store. When a
-         user attempts to retrieve a node that was evicted earlier, the node is loaded
-         (lazy loaded) from the cache loader store into memory. When
-         the node and its children have been loaded, they're removed from the
-         cache loader and a notification is emitted to the cache listeners
-         that the node has been activated.
-      </para>
-
-      <para>To enable cache passivation/activation, you can set
-         <literal>passivation</literal>
-         to true. The default is
-         <literal>false</literal>
-         .
-         When passivation is used, only the first cache loader configured is
-         used and all others are ignored.
-      </para>
-   </section>
-
-   <section>
-      <title>Strategies</title>
-      <para>
-         This section discusses different patterns of combining different cache loader types and configuration
-         options to achieve specific outcomes.
-      </para>
-
-      <section>
-         <title>Local Cache With Store</title>
-
-         <para>This is the simplest case. We have a JBoss Cache instance, whose
-            cache mode is
-            <literal>LOCAL</literal>
-            , therefore no replication is going
-            on. The cache loader simply loads non-existing elements from the store
-            and stores modifications back to the store. When the cache is started,
-            depending on the
-            <literal>preload</literal>
-            element, certain data can
-            be preloaded, so that the cache is partly warmed up.
-         </para>
-      </section>
-
-      <section>
-         <title>Replicated Caches With All Caches Sharing The Same Store</title>
-
-         <para>The following figure shows 2 JBoss Cache instances sharing the same
-            backend store:
-         </para>
-
-         <figure>
-            <title>2 nodes sharing a backend store</title>
-
-            <mediaobject>
-               <imageobject>
-                  <imagedata fileref="SharedCacheLoader.png"/>
-               </imageobject>
-            </mediaobject>
-         </figure>
-
-         <para>Both nodes have a cache loader that accesses a common shared
-            backend store. This could for example be a shared filesystem (using
-            the FileCacheLoader), or a shared database. Because both nodes access
-            the same store, they don't necessarily need state transfer on
-            startup.
-            <footnote>
-               <para>Of course they can enable state transfer, if they want to
-                  have a warm or hot cache after startup.
-               </para>
-            </footnote>
-            Rather, the
-            <literal>FetchInMemoryState</literal>
-            attribute could be set to false, resulting in a 'cold' cache, that
-            gradually warms up as elements are accessed and loaded for the first
-            time. This would mean that individual caches in a cluster might have
-            different in-memory state at any given time (largely depending on
-            their preloading and eviction strategies).
-         </para>
-
-         <para>When storing a value, the writer takes care of storing the
-            change in the backend store. For example, if node1 made change C1 and
-            node2 C2, then node1 would tell its cache loader to store C1, and node2
-            would tell its cache loader to store C2.
-         </para>
-      </section>
-
-      <section>
-         <title>Replicated Caches With Only One Cache Having A Store</title>
-
-         <figure>
-            <title>2 nodes but only one accesses the backend store</title>
-
-            <mediaobject>
-               <imageobject>
-                  <imagedata fileref="OnlyOneCacheLoader.png"/>
-               </imageobject>
-            </mediaobject>
-         </figure>
-
-         <para>This is a similar case to the previous one, but here only one
-            node in the cluster interacts with a backend store via its
-            cache loader. All other nodes perform in-memory replication. The idea
-            here is all application state is kept in memory in each node, with
-            the existence of multiple caches making the data highly available. 
-            (This assumes that a client that needs the data is able to somehow 
-            fail over from one cache to another.) The single persistent backend 
-            store then provides a backup copy of the data in case all caches in 
-            the cluster fail or need to be restarted.
-         </para>
-         <para>
-            Note that here it may make sense for the cache loader to store 
-            changes asynchronously, that is <emphasis>not</emphasis>
-            on the caller's thread, in order not to slow
-            down the cluster by accessing (for example) a database. This is a
-            non-issue when using asynchronous replication.
-         </para>
-         <para>
-            A weakness with this architecture is that the cache with access
-            to the cache loader becomes a single point of failure. Furthermore,
-            if the cluster is restarted, the cache with the cache loader must
-            be started first (easy to forget).  A solution to the first problem
-            is to configure a cache loader on each node, but set the
-            <literal>singletonStore</literal> configuration to 
-            <literal>true</literal>. With this kind of setup, one but only one 
-            node will always be writing to a persistent store. However, this 
-            complicates the restart problem, as before restarting you need
-            to determine which cache was writing before the shutdown/failure
-            and then start that cache first.
-         </para>
-      </section>
-
-      <section>
-         <title>Replicated Caches With Each Cache Having Its Own Store</title>
-
-         <figure>
-            <title>2 nodes each having its own backend store</title>
-
-            <mediaobject>
-               <imageobject>
-                  <imagedata fileref="LocalCacheLoader.png"/>
-               </imageobject>
-            </mediaobject>
-         </figure>
-
-         <para>Here, each node has its own datastore. Modifications to the
-            cache are (a) replicated across the cluster and (b) persisted using
-            the cache loader. This means that all datastores have exactly the same
-            state. When replicating changes synchronously and in a transaction,
-            the two phase commit protocol takes care that all modifications are
-            replicated and persisted in each datastore, or none is replicated and
-            persisted (atomic updates).
-         </para>
-
-         <para>Note that JBoss Cache is
-            <emphasis>not</emphasis>
-            an
-            XA Resource, that means it doesn't implement recovery. When used with a
-            transaction manager that supports recovery, this functionality is not
-            available.
-         </para>
-
-         <para>The challenge here is state transfer: when a new node starts it
-            needs to do the following:
-         </para>
-
-         <orderedlist>
-            <listitem>
-               <para>Tell the coordinator (oldest node in a cluster) to send it
-                  the state. This is always a full state transfer, overwriting
-                  any state that may already be present.
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>The coordinator then needs to wait until all in-flight
-                  transactions have completed. During this time, it will not allow
-                  for new transactions to be started.
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>Then the coordinator asks its cache loader for the entire
-                  state using
-                  <literal>loadEntireState()</literal>
-                  . It then sends
-                  back that state to the new node.
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>The new node then tells its cache loader to store that state
-                  in its store, overwriting the old state. This is the
-                  <literal>CacheLoader.storeEntireState()</literal>
-                  method
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>As an option, the transient (in-memory) state can be
-                  transferred as well during the state transfer.
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>The new node now has the same state in its backend store as
-                  everyone else in the cluster, and modifications received from
-                  other nodes will now be persisted using the local
-                  cache loader.
-               </para>
-            </listitem>
-         </orderedlist>
-
-
-      </section>
-
-      <section>
-         <title>Hierarchical Caches</title>
-
-         <para>If you need to set up a hierarchy within a single JVM, you can
-            use the
-            <literal>LocalDelegatingCacheLoader</literal>
-            . This type of
-            hierarchy can currently only be set up programmatically.
-         </para>
-
-         <para>
-            Hierarchical caches could also be set up spanning more than one JVM or server, using the
-            <literal>TcpDelegatingCacheLoader</literal>
-            .
-            <figure>
-               <title>TCP delegating cache loader</title>
-
-               <mediaobject>
-                  <imageobject>
-                     <imagedata fileref="DelegatingCacheLoader.png"/>
-                  </imageobject>
-               </mediaobject>
-            </figure>
-
-         </para>
-
-      </section>
-
-
-      <section>
-         <title>Multiple Cache Loaders</title>
-
-         <para>
-            You can set up more than one cache loader in a chain. Internally, a delegating
-            <literal>ChainingCacheLoader</literal>
-            is used, with references to each
-            cache loader you have configured. Use cases vary depending on the type of cache loaders used in the chain.
-            One example is
-            using a filesystem based cache loader, colocated on the same host as the JVM, used as an overflow for
-            memory. This ensures
-            data is available relatively easily and with low cost. An additional remote cache loader, such as a
-            <literal>TcpDelegatingCacheLoader</literal>
-            provides resilience between server restarts.
-         </para>
-
-         <figure>
-            <title>Multiple cache loaders in a chain</title>
-
-            <mediaobject>
-               <imageobject>
-                  <imagedata fileref="MultipleCacheLoaders.png"/>
-               </imageobject>
-            </mediaobject>
-         </figure>
-
-      </section>
-
-
-   </section>
-
-
-</chapter>

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/compatibility.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/compatibility.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/compatibility.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,37 +0,0 @@
-<chapter id="compatibility">
-   <title>Version Compatibility and Interoperability</title>
-
-   <para>
-      Within a major version, releases of JBoss Cache are meant to be compatible and
-      interoperable. Compatible in the sense that it should be possible to
-      upgrade an application from one version to another by simply replacing the
-      jars. Interoperable in the sense that if two different versions of
-      JBoss Cache are used in the same cluster, they should be able to exchange
-      replication and state transfer messages. Note however that interoperability
-      requires use of the same JGroups version in all nodes in the cluster.
-      In most cases, the version of JGroups used by a version of JBoss Cache can
-      be upgraded.
-   </para>
-
-   <para>
-      As such, JBoss Cache 2.x.x is not API or binary compatible with prior 1.x.x versions.
-      However, JBoss Cache 2.1.x will be API and binary compatible with 2.0.x.
-   </para>
-
-   <para>
-      A configuration attribute, <literal>ReplicationVersion</literal>, is available and is used
-      to control the wire format of inter-cache communications.  They can be wound back from more
-      efficient and newer protocols to "compatible" versions when talking to older releases.
-      This mechanism allows us to improve JBoss Cache by using more efficient wire formats while
-      still providing a means to preserve interoperability.
-   </para>
-
-   <section>
-      <title>Compatibility Matrix</title>
-      <para>
-         A <ulink url="http://labs.jboss.com/portal/jbosscache/compatibility/index.html">compatibility matrix</ulink> is maintained on the JBoss Cache website, which contains information on 
-         different versions of JBoss Cache, JGroups and JBoss AS.
-      </para>
-   </section>
-   
-</chapter>
\ No newline at end of file

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/configuration.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/configuration.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/configuration.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,447 +0,0 @@
-<chapter id="configuration">
-   <title>Configuration</title>
-
-   <section>
-      <title>Configuration Overview</title>
-
-      <para>
-         The
-         <literal>org.jboss.cache.config.Configuration</literal>
-         class
-         (along with its
-         <link linkend="configuration.elements">component parts</link>
-         )
-         is a Java Bean that encapsulates the configuration of the
-         <literal>Cache</literal>
-         and all of its architectural elements
-         (cache loaders, evictions policies, etc.)
-      </para>
-
-      <para>
-         The
-         <literal>Configuration</literal>
-         exposes numerous properties which
-         are summarized in the
-         <link linkend="configuration_reference">configuration reference</link>
-         section of this book and many of which are discussed in later
-         chapters. Any time you see a configuration option
-         discussed in this book, you can assume that the
-         <literal>Configuration</literal>
-         class or one of its component parts exposes a simple property setter/getter for that configuration option.
-      </para>
-
-   </section>
-
-   <section id="configuration.creation">
-      <title>Creating a
-         <literal>Configuration</literal>
-      </title>
-
-      <para>
-         As discussed in the
-         <link linkend="api.create_start">User API section</link>
-         ,
-         before a
-         <literal>Cache</literal>
-         can be created, the
-         <literal>CacheFactory</literal>
-         must be provided with a
-         <literal>Configuration</literal>
-         object or with a file name or
-         input stream to use to parse a
-         <literal>Configuration</literal>
-         from XML. The following sections describe how to accomplish this.
-      </para>
-
-      <section>
-         <title>Parsing an XML-based Configuration File</title>
-         <para>
-            The most convenient way to configure JBoss Cache is via an XML file. The JBoss Cache distribution ships
-            with a number of configuration files for common use cases. It is recommended that these files be used as
-            a starting point, and tweaked to meet specific needs.
-         </para>
-
-         <para>
-            Here is a simple example configuration file:
-         </para>
-         <programlisting>
-            <![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  Sample JBoss Cache Service Configuration                             -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<server>
-   
-   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper" name="jboss.cache:service=Cache">
-   
-      <!-- Configure the TransactionManager -->
-      <attribute name="TransactionManagerLookupClass">
-         org.jboss.cache.transaction.GenericTransactionManagerLookup
-      </attribute>
-
-      <!-- Node locking level : SERIALIZABLE
-                                REPEATABLE_READ (default)
-                                READ_COMMITTED
-                                READ_UNCOMMITTED
-                                NONE             -->
-      <attribute name="IsolationLevel">READ_COMMITTED</attribute>
-
-      <!-- Lock parent before doing node additions/removes -->
-      <attribute name="LockParentForChildInsertRemove">true</attribute>
-
-      <!-- Valid modes are LOCAL (default)
-                           REPL_ASYNC
-                           REPL_SYNC
-                           INVALIDATION_ASYNC
-                           INVALIDATION_SYNC   -->
-      <attribute name="CacheMode">LOCAL</attribute>
-
-      <!-- Max number of milliseconds to wait for a lock acquisition -->
-      <attribute name="LockAcquisitionTimeout">15000</attribute>
-
-
-      <!-- Specific eviction policy configurations. This is LRU -->
-      <attribute name="EvictionConfig">
-         <config>
-            <attribute name="wakeUpIntervalSeconds">5</attribute>
-            <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
-
-            <!-- Cache wide default -->
-            <region name="/_default_">
-               <attribute name="maxNodes">5000</attribute>
-               <attribute name="timeToLiveSeconds">1000</attribute>
-            </region>
-         </config>
-      </attribute>
-   </mbean>
-</server>
-]]>
-         </programlisting>
-
-         <para>
-            Another, more complete, sample XML file is included in the
-            <link linkend="sample_xml_file">configuration reference</link>
-            section of this book,
-            along with
-            <link linkend="configuration_reference">a handy look-up table</link>
-            explaining the various options.
-         </para>
-
-         <para>
-            For historical reasons, the format of the JBoss Cache configuraton
-            file follows that of a JBoss AS Service Archive (SAR) deployment
-            descriptor (and still can be used as such
-            <link linkend="deployment.microkernel">inside JBoss AS</link>
-            ). Because
-            of this dual usage, you may see elements in some configuration files
-            (such as
-            <literal>depends</literal>
-            or
-            <literal>classpath</literal>
-            ) that are
-            not relevant outside JBoss AS. These can safely be ignored.
-         </para>
-
-         <para>
-            Here's how you tell the
-            <literal>CacheFactory</literal>
-            to create
-            and start a cache by finding and parsing a configuration file on the
-            classpath:
-         </para>
-
-         <programlisting>
-            CacheFactory factory = DefaultCacheFactory.getInstance();
-            Cache cache = factory.createCache("cache-configuration.xml");
-         </programlisting>
-
-      </section>
-
-      <section>
-         <title>Programmatic Configuration</title>
-         <para>
-            In addition to the XML-based configuration above, the
-            <literal>Configuration</literal>
-            can be built up programatically,
-            using the simple property mutators exposed by
-            <literal>Configuration</literal>
-            and its components. When constructed,
-            the
-            <literal>Configuration</literal>
-            object is preset with JBoss Cache
-            defaults and can even be used as-is for a quick start.
-         </para>
-
-         <para>
-            Following is an example of programatically creating a
-            <literal>Configuration</literal>
-            configured to match the one produced
-            by the XML example above, and then using it to create a
-            <literal>Cache</literal>
-            :
-         </para>
-
-         <programlisting>
-            <![CDATA[
-            Configuration config = new Configuration();
-            String tmlc = GenericTransactionManagerLookup.class.getName();
-            config.setTransactionManagerLookupClass(tmlc);
-            config.setIsolationLevel(IsolationLevel.READ_COMMITTED);
-            config.setCacheMode(CacheMode.LOCAL);
-            config.setLockParentForChildInsertRemove(true);
-            config.setLockAcquisitionTimeout(15000);
-            
-            EvictionConfig ec = new EvictionConfig();
-            ec.setWakeupIntervalSeconds(5);
-            ec.setDefaultEvictionPolicyClass(LRUPolicy.class.getName());
-            
-            EvictionRegionConfig erc = new EvictionRegionConfig();
-            erc.setRegionName("_default_");
-            
-            LRUConfiguration lru = new LRUConfiguration();
-            lru.setMaxNodes(5000);
-            lru.setTimeToLiveSeconds(1000);
-            
-            erc.setEvictionPolicyConfig(lru);
-            
-            List<EvictionRegionConfig> ercs = new ArrayList<EvictionRegionConfig>();
-            ercs.add(erc);
-            ec.setEvictionRegionConfigs(erc);
-            
-            config.setEvictionConfig(ec);
-            
-            CacheFactory factory = DefaultCacheFactory.getInstance();
-            Cache cache = factory.createCache(config);         
-]]>
-         </programlisting>
-
-         <para>
-            Even the above fairly simple configuration is pretty tedious programming;
-            hence the preferred use of XML-based configuration. However, if your
-            application requires it, there is no reason not to use XML-based
-            configuration for most of the attributes, and then access the
-            <literal>Configuration</literal>
-            object to programatically change
-            a few items from the defaults, add an eviction region, etc.
-         </para>
-
-         <para>
-            Note that configuration values may not be changed programmatically when a cache is running,
-            except those annotated as
-            <literal>@Dynamic</literal>
-            . Dynamic properties are also marked as such in the
-            <link linkend="configuration_reference">configuration reference</link>
-            table. Attempting to change a non-dynamic
-            property will result in a
-            <literal>ConfigurationException</literal>
-            .
-         </para>
-      </section>
-
-      <section>
-         <title>Using an IOC Framework</title>
-
-         <para>
-            The
-            <literal>Configuration</literal>
-            class and its
-            <link linkend="configuration.elements">component parts</link>
-            are all Java Beans that expose all config elements via simple setters
-            and getters. Therefore, any good IOC framework should be able to
-            build up a
-            <literal>Configuration</literal>
-            from an XML file in
-            the framework's own format. See the
-            <link linkend="deployment.microcontainer">deployment via the JBoss micrcontainer</link>
-            section for an example of this.
-         </para>
-      </section>
-   </section>
-
-   <section id="configuration.elements">
-      <title>Composition of a
-         <literal>Configuration</literal>
-         Object
-      </title>
-
-      <para>
-         A
-         <literal>Configuration</literal>
-         is composed of a number of
-         subobjects:
-
-         <mediaobject>
-            <imageobject>
-               <imagedata fileref="Configuration.png"/>
-            </imageobject>
-         </mediaobject>
-      </para>
-
-      <para>
-         Following is a brief overview of the components of a
-         <literal>Configuration</literal>
-         . See the javadoc and the linked
-         chapters in this book for a more complete explanation of the
-         configurations associated with each component.
-
-         <itemizedlist>
-            <listitem>
-               <literal>Configuration</literal>
-               : top level object
-               in the hierarchy; exposes the configuration properties listed in the
-               <link linkend="configuration_reference">configuration reference</link>
-               section of this book.
-            </listitem>
-
-            <listitem>
-               <literal>BuddyReplicationConfig</literal>
-               : only relevant if
-               <link linkend="br">buddy replication</link>
-               is used. General
-               buddy replication configuration options. Must include a:
-            </listitem>
-
-            <listitem>
-               <literal>BuddyLocatorConfig</literal>
-               : implementation-specific
-               configuration object for the
-               <literal>BuddyLocator</literal>
-               implementation
-               being used. What configuration elements are exposed depends on
-               the needs of the
-               <literal>BuddyLocator</literal>
-               implementation.
-            </listitem>
-
-            <listitem>
-               <literal>EvictionConfig</literal>
-               : only relevant if
-               <link linkend="eviction_policies">eviction</link>
-               is used. General
-               eviction configuration options. Must include at least one:
-            </listitem>
-
-            <listitem>
-               <literal>EvictionRegionConfig</literal>
-               : one for each
-               eviction region; names the region, etc. Must include a:
-            </listitem>
-
-            <listitem>
-               <literal>EvictionPolicyConfig</literal>
-               : implementation-specific
-               configuration object for the
-               <literal>EvictionPolicy</literal>
-               implementation
-               being used. What configuration elements are exposed depends on
-               the needs of the
-               <literal>EvictionPolicy</literal>
-               implementation.
-            </listitem>
-
-            <listitem>
-               <literal>CacheLoaderConfig</literal>
-               : only relevant if a
-               <link linkend="cache_loaders">cache loader</link>
-               is used. General
-               cache loader configuration options. Must include at least one:
-            </listitem>
-
-            <listitem>
-               <literal>IndividualCacheLoaderConfig</literal>
-               : implementation-specific
-               configuration object for the
-               <literal>CacheLoader</literal>
-               implementation
-               being used. What configuration elements are exposed depends on
-               the needs of the
-               <literal>CacheLoader</literal>
-               implementation.
-            </listitem>
-
-            <listitem>
-               <literal>RuntimeConfig</literal>
-               : exposes to cache clients
-               certain information about the cache's runtime environment (e.g. membership
-               in buddy replication groups if
-               <link linkend="br">buddy replication</link>
-               is used.) Also allows
-               direct injection into the cache of needed external services like a
-               JTA
-               <literal>TransactionManager</literal>
-               or a JGroups
-               <literal>ChannelFactory</literal>
-               .
-            </listitem>
-         </itemizedlist>
-      </para>
-   </section>
-
-   <section>
-      <title>Dynamic Reconfiguration</title>
-      <para>
-         Dynamically changing the configuration of
-         <emphasis>some</emphasis>
-         options while the cache is running is supported,
-         by programmatically obtaining the
-         <literal>Configuration</literal>
-         object from the running cache and changing values. E.g.,
-         <programlisting>
-
-            Configuration liveConfig = cache.getConfiguration();
-            liveConfig.setLockAcquisitionTimeout(2000);
-
-         </programlisting>
-         A complete listing of which options may be changed dynamically is in the
-         <link linkend="configuration_reference">configuration reference</link>
-         section. An
-         <literal>org.jboss.cache.config.ConfigurationException</literal>
-         will be thrown if you attempt to change a
-         setting that is not dynamic.
-      </para>
-   </section>
-
-   <section id="configuration.options">
-      <title>Overriding the Configuration Via the Option API</title>
-      <para>
-         The Option API allows you to override certain behaviours of the cache on a per invocation basis.
-         This involves creating an instance of
-         <literal>org.jboss.cache.config.Option</literal>
-         , setting the options
-         you wish to override on the
-         <literal>Option</literal>
-         object and passing it in the
-         <literal>InvocationContext</literal>
-         before invoking your method on the cache.
-      </para>
-      <para>
-         E.g., to override the default node versioning used with optimistic locking:
-         <programlisting>
-
-            DataVersion v = new MyCustomDataVersion();
-            cache.getInvocationContext().getOptionOverrides().setDataVersion(v);
-            Node ch = cache.getRoot().addChild(Fqn.fromString("/a/b/c"));
-
-         </programlisting>
-      </para>
-      <para>
-         E.g., to suppress replication of a put call in a REPL_SYNC cache:
-         <programlisting>
-
-            Node node = cache.getChild(Fqn.fromString("/a/b/c"));
-            cache.getInvocationContext().getOptionOverrides().setLocalOnly(true);
-            node.put("localCounter", new Integer(2));
-
-         </programlisting>
-      </para>
-      <para>
-         See the javadocs on the
-         <literal>Option</literal>
-         class for details on the options available.
-      </para>
-   </section>
-</chapter>

Added: pojo/trunk/src/main/docbook/userguide/en/modules/configuration.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/configuration.xml	                        (rev 0)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/configuration.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -0,0 +1,502 @@
+<chapter id="configuration">
+
+
+      <title>Configuration and Deployment</title>
+
+      <para>Since POJO Cache uses Core Cache for the underlying node replication, transaction,
+         locking, and passivation behavior, the configuration is mostly the same.</para>
+
+   <section>
+      <title>Cache configuration xml file</title>
+      <para>When a PojoCache instance is obtained from a PojoCacheFactory, it is required that the
+      either a <literal>org.jboss.cache.config.Configuration</literal> object is passed, or more typically
+      a String indicating the location on the classpath or filesystem of an xml configuration file is provided. 
+      In the latter case, PojoCacheFactory will parse the xml to create a <literal>Configuration</literal>.  
+      PojoCache will simply pass the resulting <literal>Configuration</literal> to the underlying Core Cache 
+      implementation.
+   
+      For details on the configuration please see the "Configuration" chapter in the
+      the JBoss Cache User Guide.</para>
+   </section>
+
+   <section>
+      <title>Passivation</title>
+      <para>A common use-case is to configure the underlying Core Cache to enable passivation. Passivation is a feature
+         used to reduce cache memory usage by evicting stale data that can later be reloaded. 
+         In JBoss Cache, it is done via a combination of an eviction
+         policy and a cache loader. That is, when a node is evicted from the Cache's in-memory store, it will 
+         be stored in a persistent store by the cache loader. When the node is requested again, it will be loaded 
+         from the persistent store and stored into memory.
+         </para>
+         <para>There is a restriction, however. Since POJO Cache maps object data into an internal area, there are 
+         two places that have object information. One is under the regular String ID that the user specifies, and
+         the other is located under <code>/__JBossInternal__</code>. Therefore, to maintain consistentency, 
+         when you specify the eviction region, you can only specify one global (i.e., <code>/_default_</code>)
+         region. This way, when the nodes associated with a POJO are passivated, they will do so across the whole
+         region.
+      </para>
+      <para>
+         Below is a snippet from a cache configuration xml
+      illustrating how the eviction policy along with cache loader can be configured. Please note that this is
+         simply an aspect of the underlying Cache. That is, PojoCache layer is agnostic to this behavior.
+<programlisting>
+         <![CDATA[
+<attribute name="EvictionPolicyConfig">
+   <config>
+      <attribute name="wakeUpIntervalSeconds">5</attribute>
+      <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+      <!-- Cache wide default -->
+      <region name="/_default_">
+          <attribute name="maxNodes">5000</attribute>
+          <attribute name="timeToLiveSeconds">3</attribute>
+      </region>
+   </config>
+</attribute>
+
+<attribute name="CacheLoaderConfiguration">
+   <config>
+      <passivation>true</passivation>
+      <preload>/</preload>
+      <shared>false</shared>
+
+      <!-- we can now have multiple cache loaders, which get chained -->
+      <cacheloader>
+         <class>org.jboss.cache.loader.FileCacheLoader</class>
+         <!-- whether the cache loader writes are asynchronous -->
+         <async>false</async>
+         <!-- only one cache loader in the chain may set fetchPersistentState to true.
+              An exception is thrown if more than one cache loader sets this to true. -->
+         <fetchPersistentState>true</fetchPersistentState>
+         <!-- determines whether this cache loader ignores writes - defaults to false. -->
+         <ignoreModifications>false</ignoreModifications>
+      </cacheloader>
+   </config>
+</attribute>
+]]>
+</programlisting>
+      </para>
+      <para>Another way to support multiple regions in eviction is to use region-based marshalling. 
+      See the "Architecture" chapter in the JBoss Cache User Guide for more information on region-based marshalling.
+      When the Cache uses region-based marshalling, POJO Cache will store internal node data on the region that is 
+      specified. This allows for a more flexible eviction policy. </para>
+   </section>
+
+
+   <section>
+      <title>AOP Configuration</title>
+      <para>POJO Cache supplies a <literal>pojocache-aop.xml</literal> that is required to be set via a
+      system property: <literal>jboss.aop.path</literal> during compile- or load-time, or placed in
+         the user's classpath. The file now consists
+      of the interceptor stack specification, as well as annotations for POJO instrumentation. It is listed fully in the
+      Appendix section. Note that the file should not normally need to be modified. Only an advanced use-case
+      would require changes.</para>
+   </section>
+
+   <section>
+      <title>Deployment Options</title>
+      <para>There are a number of ways to deploy POJO Cache:</para>
+      
+      <section>
+         <title>Programatic Deployment</title>
+         <para>Simply instantiate a PojoCacheFactory and invoke one of the
+         overloaded <literal>createCache</literal> methods shown in the
+         <link linkend="api">API Overview</link>.</para>
+      </section>
+      
+      <section id="deployment.microkernel">
+         <title>JMX-Based Deployment in JBoss AS (JBoss AS 5.x and 4.x)</title>
+         <para>If PojoCache is run in JBoss AS then your cache can be deployed as an
+         MBean simply by copying a standard cache configuration file to the server's
+         <literal>deploy</literal> directory.  The standard format of PojoCache's
+         standard XML configuration file (as shown in the
+         <link linkend="xml">Appendix</link>) is the same
+         as a JBoss AS MBean deployment descriptor, so the AS's SAR Deployer has
+         no trouble handling it.  Also, you don't have to place the configuration
+         file directly in <literal>deploy</literal>; you can package it along
+         with other services or JEE components in a SAR or EAR.
+      </para>
+
+      <para>
+         In AS 5, if you're using a server config based on the standard
+         <literal>all</literal> config, then that's all you need to do; all required
+         jars will be on the classpath. Otherwise, you will need to ensure 
+         <literal>pojocache.jar</literal>, <literal>jbosscache.jar</literal> 
+         and <literal>jgroups-all.jar</literal> are on the classpath. You may 
+         need to add other jars if you're using
+         things like <literal>JdbmCacheLoader</literal>. The simplest way to do 
+         this is to copy the jars from the PojoCache distribution's 
+         <literal>lib</literal> directory to the server config's <literal>lib</literal>
+         directory.  You could also package the jars with the configuration file 
+         in Service Archive (.sar) file or an EAR. 
+      </para>
+      
+      <para>
+         It is possible, to deploy a POJO Cache 2.0 instance in JBoss AS 4.x
+		 However, the significant API changes between the 2.x and 1.x releases
+		 mean none of the standard AS 4.x clustering services (e.g.
+		 http session replication) that rely on the 1.x API will work with
+		 PojoCache 2.x.  Also, be aware that usage of PojoCache 2.x in AS 4.x is not 
+		 something the cache developers are making any significant effort to test, 
+		 so be sure to test your application well (which of course you're doing anyway.)
+      </para>
+      
+      <para>
+         Note in the <link linkend="xml">example</link> 
+         the value of the <literal>mbean</literal> element's
+         <literal>code</literal> attribute: 
+         <literal>org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper</literal>. This is the
+         class JBoss Cache uses to handle JMX integration; the 
+         PojoCache itself does not expose an MBean
+         interface. See the 
+         <link linkend="jmx.mbeans">JBoss Cache MBeans section</link>
+         for more on the PojoCacheJmxWrapper.
+      </para>
+
+      <para>
+	      Once your cache is deployed, in order to use it with an in-VM client 
+	      such as a servlet, a JMX proxy can be used to get a reference to
+	      the cache:
+	  </para>
+	
+	  <programlisting>
+         <![CDATA[
+      MBeanServer server = MBeanServerLocator.locateJBoss();
+      ObjectName on = new ObjectName("jboss.cache:service=PojoCache");
+      PojoCacheJmxWrapperMBean cacheWrapper = 
+        (PojoCacheJmxWrapperMBean) MBeanServerInvocationHandler.newProxyInstance(server, on, 
+                                                PojoCacheJmxWrapperMBean.class, false);
+      PojoCache cache = cacheWrapper.getPojoCache();
+   ]]>
+      </programlisting>
+
+      <para>The MBeanServerLocator class is a helper to find the (only) JBoss
+         MBean server inside the current JVM. The 
+         <literal>javax.management.MBeanServerInvocationHandler</literal> class'
+         <literal>newProxyInstance</literal> method creates a
+         dynamic proxy implementing the given interface and uses JMX to
+         dynamically dispatch methods invoked against the generated interface
+         to the MBean. The name used to look up the MBean is the same as defined 
+         in the cache's configuration file.
+      </para>
+      
+      <para>
+         Once the proxy to the <literal>PojoCacheJmxWrapper</literal> is obtained,
+         the <literal>getPojoCache()</literal> will return a reference to the 
+         PojoCache itself.
+      </para>
+      </section> 
+      
+      <section id="deployment.microcontainer">
+      <title>Via JBoss Microcontainer (JBoss AS 5.x)</title>
+      
+      <para>
+         Beginning with AS 5, JBoss AS also supports deployment of POJO services via 
+         deployment of a file whose name ends with <literal>-beans.xml</literal>.  
+         A POJO service is one whose implementation is via a "Plain Old Java Object", 
+         meaning a simple java bean that isn't required to implement any special 
+         interfaces or extend any particular superclass. A PojoCache 
+         is a POJO service, and all the components in a <literal>Configuration</literal> 
+         are also POJOS, so deploying a cache in this way is a natural step.
+      </para>
+      <para>
+         Deployment of the cache is done using the JBoss Microcontainer that forms the
+         core of JBoss AS.  JBoss Microcontainer is a sophisticated IOC framework 
+         (similar to Spring). A <literal>-beans.xml</literal> file is basically 
+         a descriptor that tells the IOC framework how to assemble the various
+         beans that make up a POJO service.
+      </para>
+      <para>  
+         The rules for how to deploy the file, how to package it, how to
+         ensure the required jars are on the classpath, etc. are the same
+         as for a <link linkend="deployment.microkernel">JMX-based deployment</link>.
+      </para>
+      
+      <para>
+         Following is an abbreviated example <literal>-beans.xml</literal> file.
+         The details of building up the Configuration are omitted; see the 
+         "Deploying JBoss Cache" chapter in the JBoss Cache User Guide for
+         a more complete example. If you look in the 
+         <literal>server/all/deploy</literal> directory of an AS 5
+         installation, you can find several more examples.
+      </para>
+      
+      <programlisting>
+      <![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- First we create a Configuration object for the cache -->
+   <bean name="ExampleCacheConfig"
+   		 class="org.jboss.cache.config.Configuration">
+      
+      ... details omitted
+      
+   </bean>
+   
+   <!-- The cache itself. -->
+   <bean name="ExampleCache" class="org.jboss.cache.pojo.impl.PojoCacheImpl">
+      
+      <constructor factoryClass="org.jboss.cache.pojo.PojoCacheFactory
+                   factoryMethod="createCache">
+          <parameter><inject bean="ExampleCacheConfig"/></parameter>
+          <parameter>false</false>
+      </constructor>
+          
+   </bean>
+
+</deployment>      
+]]>
+      </programlisting>
+      
+      <para>
+         An interesting thing to note in the above example is the difference
+         between POJO Cache and a plain Cache in the use of a factory to
+         create the cache. (See the "Deploying JBoss Cache" chapter in the 
+         JBoss Cache User Guide for the comparable plain Cache example.) The
+         PojoCacheFactory exposes static methods for creating a PojoCache;
+         as a result there is no need to add a separate <literal>bean</literal>
+         element for the factory.  Core Cache's 
+         <literal>DefaultCacheFactory</literal> creates caches from a singleton
+         instance, requiring a bit more boilerplate in the config file.
+      </para>
+      </section>
+   </section>
+   
+      <section id="jmx.mbeans">
+         <title>POJO Cache MBeans</title>
+         <para>
+            POJO Cache provides an MBean that can be registered with your environment's JMX server to allow access 
+            to the cache instance via JMX. This MBean is the <literal>org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper</literal>.
+            It is a StandardMBean, so it's MBean interface is <literal>org.jboss.cache.pojo.jmx.PojoCacheJmxWrapperMBean</literal>.
+            This MBean can be used to:
+            <itemizedlist>
+               <listitem>Get a reference to the underlying PojoCache.</listitem>
+               <listitem>Invoke create/start/stop/destroy lifecycle operations on 
+               the underlying PojoCache.</listitem>
+               <listitem>See numerous details about the cache's configuration, and 
+               change those configuration items that can be changed when the 
+               cache has already been started.</listitem>
+            </itemizedlist>
+            See the <literal>PojoCacheJmxWrapperMBean</literal> javadoc for more details.
+         </para>
+         <para>
+            It is important to note a significant architectural difference between PojoCache 1.x and 2.x. In 1.x,
+            the old <literal>TreeCacheAop</literal> class was itself an MBean, and essentially exposed the cache's entire
+            API via JMX.  In 2.x, JMX has been returned to it's fundamental role as a management layer.  The 
+            PojoCache object itself is completely unaware of JMX; instead JMX functionality is added
+            through a wrapper class designed for that purpose.  Furthermore, the interface exposed through JMX
+            has been limited to management functions; the general PojoCache API is no longer exposed 
+            through JMX.  For example, it is no longer possible to invoke a cache <literal>attach</literal> or 
+            <literal>detach</literal> via the JMX interface.
+         </para>
+         <para>
+            If a <literal>PojoCacheJmxWrapper</literal> is registered, the wrapper also registers MBeans 
+            for the underlying plain Cache and for each interceptor configured in the cache's interceptor stack. 
+            These MBeans are used to capture and expose statistics related to cache operations; see the 
+            JBoss Cache User Guide for more. They are hierarchically
+            associated with the <literal>PojoCacheJmxWrapper</literal> MBean and have service names that 
+            reflect this relationship. For
+            example, a plain Cache associated with a <literal>jboss.cache:service=PojoCache</literal> will be
+            accessible through an mbean named <literal>jboss.cache:service=PojoCache,cacheType=Cache</literal>.
+            The replication interceptor MBean for that cache will be accessible through the mbean named 
+            <literal>jboss.cache:service=PojoCache,cacheType=Cache,cache-interceptor=ReplicationInterceptor</literal>.
+         </para>
+      </section>
+      
+      <section id="jmx.registration">
+      	<title>Registering the PojoCacheJmxWrapper</title>
+      	
+      	<para>
+      	   The best way to ensure the <literal>PojoCacheJmxWrapper</literal> is registered
+      	   in JMX depends on how you are deploying your cache:
+      	</para>
+      	
+      	<section id="jmx.registration.programatic">
+      	   <title>Programatic Registration</title>
+      	   
+      	   <para>
+      	      Simplest way to do this is to create your <literal>PojoCache</literal>
+      	      and pass it to the <literal>PojoCacheJmxWrapper</literal> constructor.
+      	   </para>
+      	   
+      	   <programlisting>
+            // Build but don't start the cache 
+            // (although it would work OK if we started it)
+            PojoCache cache = PojoCacheFactory.createCache("cache-configuration.xml", false);
+            
+            PojoCacheJmxWrapperMBean wrapper = new PojoCacheJmxWrapper(cache);
+            MBeanServer server = getMBeanServer(); // however you do it
+            ObjectName on = new ObjectName("jboss.cache:service=PojoCache");
+            server.registerMBean(wrapper, on);
+            
+            // Invoking lifecycle methods on the wrapper results
+            // in a call through to the cache
+            wrapper.create();
+            wrapper.start();
+            
+            ... use the cache
+            
+            ... on application shutdown
+            
+            // Invoking lifecycle methods on the wrapper results
+            // in a call through to the cache
+            wrapper.stop();
+            wrapper.destroy();
+      	   </programlisting>
+      	   
+      	   <para>
+      	      Alternatively, build a <literal>Configuration</literal> object
+      	      and pass it to the <literal>PojoCacheJmxWrapper</literal>. The wrapper
+      	      will construct the <literal>PojoCache</literal>:
+      	   </para>
+      	   
+      	   <programlisting>
+            Configuration config = buildConfiguration(); // whatever it does
+            
+            PojoCacheJmxWrapperMBean wrapper = new PojoCacheJmxWrapper(config);
+            MBeanServer server = getMBeanServer(); // however you do it
+            ObjectName on = new ObjectName("jboss.cache:service=TreeCache");
+            server.registerMBean(wrapper, on);
+            
+            // Call to wrapper.create() will build the Cache if one wasn't injected
+            wrapper.create();
+            wrapper.start();
+            
+            // Now that it's built, created and started, get the cache from the wrapper
+            PojoCache cache = wrapper.getPojoCache();
+            
+            ... use the cache
+            
+            ... on application shutdown
+            
+            wrapper.stop();
+            wrapper.destroy();
+            
+      	   </programlisting>
+      	</section>
+      	
+      	<section>
+      	   <title>JMX-Based Deployment in JBoss AS (JBoss AS 4.x and 5.x)</title>
+      	   
+      	   <para>
+      	      When you 
+      	      <link linkend="deployment.microkernel">deploy your cache in JBoss AS using a -service.xml file</link>,
+      	      a <literal>PojoCacheJmxWrapper</literal> is automatically registered.  There is no need
+      	      to do anything further. The <literal>PojoCacheJmxWrapper</literal> is accessible  
+      	      through the service name specified in the cache configuration file's <literal>mbean</literal> element.
+      	   </para>
+      	</section>
+      	
+      	<section>
+      	   <title>Via JBoss Microcontainer (JBoss AS 5.x)</title>
+      	   
+      	   <para>
+      	      <literal>PojoCacheJmxWrapper</literal> is a POJO, so the microcontainer 
+      	      has no problem creating one.  The trick is 
+      	      getting it to register your bean in JMX.  This can be done by
+      	      specifying the <literal>org.jboss.aop.microcontainer.aspects.jmx.JMX</literal>
+      	      annotation on the <literal>PojoCacheJmxWrapper</literal> bean:
+      	   </para>
+      
+      <programlisting>
+      <![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- First we create a Configuration object for the cache -->
+   <bean name="ExampleCacheConfig"
+   		 class="org.jboss.cache.config.Configuration">
+      
+      ... build up the Configuration
+      
+   </bean>
+   
+   <!-- The cache itself. -->
+   <bean name="ExampleCache" class="org.jboss.cache.pojo.impl.PojoCacheImpl">
+      
+      <constructor factoryClass="org.jboss.cache.pojo.PojoCacheFactory
+                   factoryMethod="createCache">
+          <parameter><inject bean="ExampleCacheConfig"/></parameter>
+          <parameter>false</false>
+      </constructor>
+          
+   </bean>
+   
+   <!-- JMX Management -->
+   <bean name="ExampleCacheJmxWrapper" class="org.jboss.cache.jmx.CacheJmxWrapper">
+      
+      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(
+            name="jboss.cache:service=ExamplePojoCache", 
+            exposedInterface=org.jboss.cache.pojo.jmx.PojoCacheJmxWrapperMBean.class, 
+            registerDirectly=true)
+      </annotation>
+      
+      <constructor>
+          <parameter><inject bean="ExampleCache"/></parameter>
+      </constructor>
+          
+   </bean>
+
+</deployment>      
+]]>
+      </programlisting>
+      
+      <para>
+         As discussed in the <link linkend="jmx.registration.programatic">Programatic Registration</link>
+         section, <literal>PojoCacheJmxWrapper</literal> can do the work of building,
+         creating and starting the PojoCache if it is provided with a <literal>Configuration</literal>:
+      </para>
+      
+      <programlisting>
+      <![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- First we create a Configuration object for the cache -->
+   <bean name="ExampleCacheConfig"
+   		 class="org.jboss.cache.config.Configuration">
+      
+      ... build up the Configuration
+      
+   </bean>
+    
+   <bean name="ExampleCache" class="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper">
+      
+      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(
+            name="jboss.cache:service=ExamplePojoCache", 
+            exposedInterface=org.jboss.cache.pojo.jmx.PojoCacheJmxWrapperMBean.class, 
+            registerDirectly=true)
+      </annotation>
+      
+      <constructor>
+          <parameter><inject bean="ExampleCacheConfig"/></parameter>
+      </constructor>
+          
+   </bean>
+
+</deployment>      
+]]>
+      </programlisting>
+      	</section>
+      	
+      </section>
+
+    <section>
+      <title>Runtime Statistics and JMX Notifications</title>
+      
+      <para>As mentioned above, the cache exposes a variety of statistical
+      information through its MBeans.  It also emits JMX notifications when
+      events occur in the cache.  See the JBoss Cache User Guide for more
+      on the statistics and notifications that are available.
+      </para>
+      <para>The only PojoCache addition to the plain JBoss Cache behavior
+      described in the User Guide is that you can register with the 
+      PojoCacheJmxWrapper to get the notifications.  There is no
+      requirement to figure out the ObjectName of the underlying 
+      cache's CacheJmxWrapper and register with that.
+      </para>
+    </section>
+</chapter>


Property changes on: pojo/trunk/src/main/docbook/userguide/en/modules/configuration.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,665 +0,0 @@
-<chapter id="configuration_reference_chapter">
-   <title>Configuration References</title>
-   <section id="sample_xml_file">
-      <title>Sample XML Configuration File</title>
-      <para>
-         This is what a typical XML configuration file looks like. It is recommended that you use one of the
-         configurations
-         shipped with the JBoss Cache distribution and tweak according to your needs rather than write one from scratch.
-      </para>
-      <programlisting>
-         <![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  Sample JBoss Cache Service Configuration                             -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<server>
-   
-   <!-- ==================================================================== -->
-   <!-- Defines JBoss Cache configuration                                      -->
-   <!-- ==================================================================== -->
-
-   <!-- Note the value of the 'code' attribute has changed since JBC 1.x -->
-   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper" name="jboss.cache:service=Cache">
-   
-      <!-- Ensure JNDI and the TransactionManager are started before the
-           cache.  Only works inside JBoss AS; ignored otherwise -->
-      <depends>jboss:service=Naming</depends>
-      <depends>jboss:service=TransactionManager</depends>
-
-      <!-- Configure the TransactionManager -->
-      <attribute name="TransactionManagerLookupClass">
-         org.jboss.cache.transaction.GenericTransactionManagerLookup
-      </attribute>
-
-      <!-- Node locking level : SERIALIZABLE
-                                REPEATABLE_READ (default)
-                                READ_COMMITTED
-                                READ_UNCOMMITTED
-                                NONE             -->
-      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
-
-      <!-- Lock parent before doing node additions/removes -->
-      <attribute name="LockParentForChildInsertRemove">true</attribute>
-
-      <!-- Valid modes are LOCAL (default)
-                           REPL_ASYNC
-                           REPL_SYNC
-                           INVALIDATION_ASYNC
-                           INVALIDATION_SYNC   -->
-      <attribute name="CacheMode">REPL_ASYNC</attribute>
-
-      <!-- Name of cluster. Needs to be the same for all JBoss Cache nodes in a
-           cluster in order to find each other. 
-      -->
-      <attribute name="ClusterName">JBossCache-Cluster</attribute>
-
-      <!--Uncomment next three statements to use the JGroups multiplexer.
-         This configuration is dependent on the JGroups multiplexer being
-         registered in an MBean server such as JBossAS.  This type of
-         dependency injection only works in the AS; outside it's up to
-         your code to inject a ChannelFactory if you want to use one. 
-      -->
-      <!--
-      <depends optional-attribute-name="MultiplexerService" 
-      		proxy-type="attribute">jgroups.mux:name=Multiplexer</depends>
-      <attribute name="MultiplexerStack">tcp</attribute>
-      -->
-
-      <!-- JGroups protocol stack properties.
-         ClusterConfig isn't used if the multiplexer is enabled above.
-      -->
-      <attribute name="ClusterConfig">
-         <config>
-            <!-- UDP: if you have a multihomed machine, set the bind_addr 
-                 attribute to the appropriate NIC IP address -->
-            <!-- UDP: On Windows machines, because of the media sense feature
-                 being broken with multicast (even after disabling media sense)
-                 set the loopback attribute to true -->
-            <UDP mcast_addr="228.1.2.3" mcast_port="48866"
-                 ip_ttl="64" ip_mcast="true"
-                 mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
-                 ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
-                 loopback="false"/>
-            <PING timeout="2000" num_initial_members="3"/>
-            <MERGE2 min_interval="10000" max_interval="20000"/>
-            <FD shun="true"/>
-            <FD_SOCK/>
-            <VERIFY_SUSPECT timeout="1500"/>
-            <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
-                           max_xmit_size="8192"/>
-            <UNICAST timeout="600,1200,2400",4800/>
-            <pbcast.STABLE desired_avg_gossip="400000"/>
-            <FC max_credits="2000000" min_threshold="0.10"/>
-            <FRAG2 frag_size="8192"/>
-            <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
-                        shun="true" print_local_addr="true"/>
-            <pbcast.STATE_TRANSFER/>
-         </config>
-      </attribute>
-      
-      <!--
-          The max amount of time (in milliseconds) we wait until the
-          initial state (ie. the contents of the cache) are retrieved from
-          existing members in a clustered environment
-      -->
-      <attribute name="StateRetrievalTimeout">20000</attribute>
-
-      <!--
-          Number of milliseconds to wait until all responses for a
-          synchronous call have been received.
-      -->
-      <attribute name="SyncReplTimeout">20000</attribute>
-
-      <!-- Max number of milliseconds to wait for a lock acquisition -->
-      <attribute name="LockAcquisitionTimeout">15000</attribute>
-
-
-      <!-- Specific eviction policy configurations. This is LRU -->
-      <attribute name="EvictionConfig">
-         <config>
-            <attribute name="wakeUpIntervalSeconds">5</attribute>
-            <!-- This defaults to 200000 if not specified -->
-            <attribute name="eventQueueSize">200000</attribute>
-            <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
-
-            <!-- Cache wide default -->
-            <region name="/_default_">
-               <attribute name="maxNodes">5000</attribute>
-               <attribute name="timeToLiveSeconds">1000</attribute>
-            </region>
-            <region name="/org/jboss/data">
-               <attribute name="maxNodes">5000</attribute>
-               <attribute name="timeToLiveSeconds">1000</attribute>
-            </region>
-            <region name="/org/jboss/test/data">
-               <attribute name="maxNodes">5</attribute>
-               <attribute name="timeToLiveSeconds">4</attribute>
-            </region>
-            <region name="/test">
-               <attribute name="maxNodes">10000</attribute>
-               <attribute name="timeToLiveSeconds">4</attribute>
-            </region>
-            <region name="/maxAgeTest">
-               <attribute name="maxNodes">10000</attribute>
-               <attribute name="timeToLiveSeconds">8</attribute>
-               <attribute name="maxAgeSeconds">10</attribute>
-            </region>
-         </config>
-      </attribute>
-   </mbean>
-</server>
-]]>
-      </programlisting>
-   </section>
-
-
-   <section id="configuration_reference">
-      <title>
-         Reference table of XML attributes
-      </title>
-      <para>A list of definitions of each of the XML attributes used above. If the
-         description of an attribute states that it is
-         <emphasis>dynamic</emphasis>
-         ,
-         that means it can be changed after the cache is created and started.
-      </para>
-
-      <informaltable frame="all">
-         <tgroup cols="2">
-            <tbody>
-               <row>
-                  <entry>
-                     <para>Name</para>
-                  </entry>
-
-                  <entry>
-                     <para>Description</para>
-                  </entry>
-               </row>
-               <row>
-                  <entry>
-                     <para>BuddyReplicationConfig</para>
-                  </entry>
-
-                  <entry>
-                     <para>An XML element that contains detailed buddy replication
-                        configuration. See
-                        <link linkend="br">section on Buddy Replication</link>
-                        for details.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>CacheLoaderConfig</para>
-                  </entry>
-
-                  <entry>
-                     <para>An XML element that contains detailed cache loader
-                        configuration. See
-                        <link linkend="cache_loaders">chapter on Cache Loaders</link>
-                        for details.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>CacheLoaderConfiguration</para>
-                  </entry>
-
-                  <entry>
-                     <para>
-                        <emphasis>Deprecated</emphasis>
-                        . Use
-                        <literal>CacheLoaderConfig</literal>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>CacheMode</para>
-                  </entry>
-
-                  <entry>
-                     <para>LOCAL, REPL_SYNC, REPL_ASYNC, INVALIDATION_SYNC or
-                        INVALIDATION_ASYNC. Defaults to LOCAL. See the
-                        <link linkend="clustering">chapter on Clustering</link>
-                        for details.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>ClusterConfig</para>
-                  </entry>
-
-                  <entry>
-                     <para>The configuration of the underlying JGroups stack.
-                        Ignored if
-                        <literal>MultiplexerService</literal>
-                        and
-                        <literal>MultiplexerStack</literal>
-                        are used.
-                        See the various *-service.xml files in the source distribution
-                        <literal>etc/META-INF</literal>
-                        folder for examples.
-                        See the
-                        <ulink url="http://www.jgroups.org">JGroups documentation</ulink>
-                        or the
-                        <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups">JGroups wiki page</ulink>
-                        for more information.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>ClusterName</para>
-                  </entry>
-
-                  <entry>
-                     <para>Name of cluster. Needs to be the same for all nodes in a
-                        cluster in order for them to communicate with each other.
-                     </para>
-                  </entry>
-               </row>
-               <row>
-                  <entry>
-                     <para>EvictionPolicyConfig</para>
-                  </entry>
-
-                  <entry>
-                     <para>Configuration parameter for the specified eviction policy.
-                        See
-                        <link linkend="eviction_policies">chapter on eviction policies</link>
-                        for details. This property is
-                        <emphasis>dynamic</emphasis>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>ExposeManagementStatistics</para>
-                  </entry>
-
-                  <entry>
-                     <para>
-                        Specifies whether interceptors that provide statistics should have statistics
-                        gathering enabled at startup. Also controls whether a
-                        <literal>CacheMgmtInterceptor</literal>
-                        (whose sole purpose is gathering
-                        statistics) should be added to the interceptor chain. Default value is
-                        <emphasis>true</emphasis>
-                        . See the
-                        <link linkend="jmx.statistics">JBoss Cache Statistics section</link>
-                        section for more details.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>FetchInMemoryState
-                     </para>
-                  </entry>
-
-                  <entry>
-                     <para>Whether or not to acquire the initial in-memory state from
-                        existing members. Allows for hot caches when enabled. Also
-                        see the
-                        <literal>fetchPersistentState</literal>
-                        element in
-                        <literal>CacheLoaderConfig</literal>
-                        . Defaults to
-                        <literal>true</literal>
-                        . This property is
-                        <emphasis>dynamic</emphasis>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>InactiveOnStartup</para>
-                  </entry>
-
-                  <entry>
-                     <para>Whether or not the entire tree is inactive upon startup,
-                        only responding to replication messages after
-                        <literal>activateRegion()</literal>
-                        is called to activate one or
-                        more parts of the tree. If true, property
-                        <literal>FetchInMemoryState</literal>
-                        is ignored. This property
-                        should only be set to true if
-                        <literal>UseRegionBasedMarshalling</literal>
-                        is also
-                        <literal>true</literal>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>StateRetrievalTimeout</para>
-                  </entry>
-
-                  <entry>
-                     <para>Time in milliseconds to wait for state
-                        retrieval. This should be longer than
-                        <literal>LockAcquisitionTimeout</literal>
-                        as the node
-                        providing state may need to wait that long to acquire
-                        necessary read locks on the cache. This property is
-                        <emphasis>dynamic</emphasis>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-
-               <row>
-                  <entry>
-                     <para>IsolationLevel</para>
-                  </entry>
-
-                  <entry>
-                     <para>Node locking isolation level : SERIALIZABLE, REPEATABLE_READ
-                        (default), READ_COMMITTED, READ_UNCOMMITTED, and NONE. Note that this is ignored if
-                        NodeLockingScheme is OPTIMISTIC. Case doesn't matter. See documentation on Transactions and
-                        Concurrency for more details.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>LockAcquisitionTimeout</para>
-                  </entry>
-
-                  <entry>
-                     <para>Time in milliseconds to wait for a lock to be acquired. If
-                        a lock cannot be acquired an exception will be thrown. This property is
-                        <emphasis>dynamic</emphasis>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>LockParentForChildInsertRemove</para>
-                  </entry>
-
-                  <entry>
-                     <para>Controls whether inserting or removing a node requires a write
-                        lock on the node's parent (when pessimistic locking is used) or whether
-                        it results in an update of the parent node's version (when optimistic
-                        locking is used). The default value is
-                        <code>false</code>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>MarshallerClass</para>
-                  </entry>
-
-                  <entry>
-                     <para>An instance of
-                        <literal>org.jboss.cache.marshall.Marshaller</literal>
-                        used to serialize data to byte streams.
-                        Defaults to
-                        <literal>org.jboss.cache.marshall.VersionAwareMarshaller</literal>
-                        if not specified.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>MultiplexerService</para>
-                  </entry>
-
-                  <entry>
-                     <para>The JMX object name of the service that defines the JGroups multiplexer.
-                        In JBoss AS 5.0 this service is normally defined in the jgroups-multiplexer.sar.
-                        This XML attribute can only be handled by the JBoss AS MBean deployment services;
-                        if it is included in a file passed to a
-                        <literal>CacheFactory</literal>
-                        the
-                        factory's creation of the cache will fail. Inside JBoss AS, the attribute should
-                        be specified using the "depends optional-attribute-name" syntax shown in
-                        the example above. Inside the AS if this attribute
-                        is defined, an instance of
-                        <literal>org.jgroups.jmx.JChannelFactoryMBean</literal>
-                        will be injected into the
-                        <literal>CacheJmxWrapper</literal>
-                        which will use
-                        it to obtain a multiplexed JGroups channel. The configuration
-                        of the channel will be that associated with
-                        <literal>MultiplexerStack</literal>
-                        .
-                        The
-                        <literal>ClusterConfig</literal>
-                        attribute will be ignored.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>MultiplexerStack</para>
-                  </entry>
-
-                  <entry>
-                     <para>The name of the JGroups stack to be used with the cache cluster.
-                        Stacks are defined in the configuration of the external
-                        <literal>MultiplexerService</literal>
-                        discussed above. In JBoss AS 5 this is normally done in the
-                        jgroups-multiplexer.sar/META-INF/multiplexer-stacks.xml file.
-                        The default stack is
-                        <literal>udp</literal>
-                        . This attribute is used in conjunction with
-                        <literal>MultiplexerService</literal>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>NodeLockingScheme</para>
-                  </entry>
-
-                  <entry>
-                     <para>May be PESSIMISTIC (default) or OPTIMISTIC.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>ReplicationVersion</para>
-                  </entry>
-                  <entry>
-                     <para>Tells the cache to serialize cluster traffic
-                        in a format consistent with that used by the given release
-                        of JBoss Cache. Different JBoss Cache versions use different
-                        wire formats; setting this attribute tells a cache from a later
-                        release to serialize data using the format from an earlier
-                        release. This allows caches from different releases to
-                        interoperate. For example, a 2.1.0 cache could have this
-                        value set to "2.0.0", allowing it to interoperate with a 2.0.0
-                        cache. Valid values are a dot-separated release number, with
-                        any final qualifer also separated by a dot, e.g. "2.0.0" or "2.0.0.GA".
-                        Values that indicate a 1.x release are not supported in the 2.x series.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>ReplQueueInterval</para>
-                  </entry>
-
-                  <entry>
-                     <para>Time in milliseconds for elements from the replication
-                        queue to be replicated. Only used if
-                        <literal>UseReplQueue</literal>
-                        is enabled. This property is
-                        <emphasis>dynamic</emphasis>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>ReplQueueMaxElements</para>
-                  </entry>
-
-                  <entry>
-                     <para>Max number of elements in the replication queue until
-                        replication kicks in. Only used if
-                        <literal>UseReplQueue</literal>
-                        is enabled. This property is
-                        <emphasis>dynamic</emphasis>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>SyncCommitPhase</para>
-                  </entry>
-
-                  <entry>
-                     <para>This option is used to control the behaviour of the commit part of a 2-phase commit protocol,
-                        when
-                        using REPL_SYNC (does not apply to other cache modes). By default this is set to
-                        <literal>false</literal>
-                        . There is a performance penalty to enabling this, especially when running
-                        in a large cluster, but the upsides are greater cluster-wide data integrity. See the chapter on
-                        clustered caches for more information on this. This property is
-                        <emphasis>dynamic</emphasis>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>SyncReplTimeout</para>
-                  </entry>
-
-                  <entry>
-                     <para>For synchronous replication: time in milliseconds to wait
-                        until replication acks have been received from all nodes in the
-                        cluster. It is usually best that this is greater than
-                        <literal>LockAcquisitionTimeout</literal>
-                        .
-                        This property is
-                        <emphasis>dynamic</emphasis>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>SyncRollbackPhase</para>
-                  </entry>
-
-                  <entry>
-                     <para>This option is used to control the behaviour of the rollback part of a 2-phase commit
-                        protocol, when
-                        using REPL_SYNC (does not apply to other cache modes). By default this is set to
-                        <literal>false</literal>
-                        . There is a performance penalty to enabling this, especially when running
-                        in a large cluster, but the upsides are greater cluster-wide data integrity. See the chapter on
-                        clustered caches for more information on this. This property is
-                        <emphasis>dynamic</emphasis>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>TransactionManagerLookupClass</para>
-                  </entry>
-
-                  <entry>
-                     <para>The fully qualified name of a class implementing
-                        TransactionManagerLookup. Default is
-                        JBossTransactionManagerLookup. There is also an option of
-                        GenericTransactionManagerLookup for example.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>UseInterceptorMbeans</para>
-                  </entry>
-
-                  <entry>
-                     <para>
-                        <emphasis>Deprecated</emphasis>
-                        . Use
-                        <literal>ExposeManagementStatistics</literal>
-                        .
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>UseRegionBasedMarshalling</para>
-                  </entry>
-
-                  <entry>
-                     <para>When unmarshalling replicated data, this option specifies whether or not to
-                        support use of different classloaders for different cache regions. This defaults to
-                        <literal>false</literal>
-                        if unspecified.
-                     </para>
-                  </entry>
-               </row>
-
-               <row>
-                  <entry>
-                     <para>UseReplQueue</para>
-                  </entry>
-
-                  <entry>
-                     <para>For asynchronous replication: whether or not to use a
-                        replication queue. Defaults to
-                        <literal>false</literal>
-                        .
-                     </para>
-                  </entry>
-               </row>
-            </tbody>
-         </tgroup>
-      </informaltable>
-   </section>
-</chapter>
\ No newline at end of file

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/deployment.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/deployment.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/deployment.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,901 +0,0 @@
-<chapter id="deployment">
-   <title>Deploying JBoss Cache</title>
-   <section id="deployment.standalone">
-      <title>Standalone Use / Programatic Deployment</title>
-      <para>
-         When used in a standalone Java program, all that needs to be done is to instantiate the cache using the
-         <literal>CacheFactory</literal>
-         and a
-         <literal>Configuration</literal>
-         instance or an XML file, as discussed
-         in the
-         <link linkend="api.create_start">User API</link>
-         and
-         <link linkend="configuration.creation">Configuration</link>
-         chapters.
-      </para>
-
-      <para>
-         The same techniques can be used when an application running in an application
-         server wishes to programatically deploy a cache rather than relying on an application server's
-         deployment features. An example of this would be
-         a webapp deploying a cache via a
-         <literal>javax.servlet.ServletContextListener</literal>
-         .
-      </para>
-
-      <para>
-         If, after deploying your cache you wish to expose a management interface
-         to it in JMX, see the
-         <link linkend="jmx.registration.programatic">section on Programatic Registration in JMX</link>
-         .
-      </para>
-   </section>
-
-   <section id="deployment.microkernel">
-      <title>JMX-Based Deployment in JBoss AS (JBoss AS 5.x and 4.x)</title>
-      <para>If JBoss Cache is run in JBoss AS then the cache can be deployed as an
-         MBean simply by copying a standard cache configuration file to the server's
-         <literal>deploy</literal>
-         directory. The standard format of JBoss Cache's
-         standard XML configuration file (as shown in the
-         <link linkend="sample_xml_file">Configuration Reference</link>
-         ) is the same
-         as a JBoss AS MBean deployment descriptor, so the AS's SAR Deployer has
-         no trouble handling it. Also, you don't have to place the configuration
-         file directly in
-         <literal>deploy</literal>
-         ; you can package it along
-         with other services or JEE components in a SAR or EAR.
-      </para>
-
-      <para>
-         In AS 5, if you're using a server config based on the standard
-         <literal>all</literal>
-         config, then that's all you need to do; all required
-         jars will be on the classpath. Otherwise, you will need to ensure
-         <literal>jbosscache.jar</literal>
-         and
-         <literal>jgroups-all.jar</literal>
-         are on the classpath. You may need to add other jars if you're using
-         things like
-         <literal>JdbmCacheLoader</literal>
-         . The simplest way to do
-         this is to copy the jars from the JBoss Cache distribution's
-         <literal>lib</literal>
-         directory to the server config's
-         <literal>lib</literal>
-         directory. You could also package the jars with the configuration file
-         in Service Archive (.sar) file or an EAR.
-      </para>
-
-      <para>
-         It is possible to deploy a JBoss Cache 2.0 instance in JBoss AS 4.x
-         (at least in 4.2.0.GA; other AS releases are completely untested).
-         However, the significant API changes between the JBoss Cache 2.x and 1.x releases
-         mean none of the standard AS 4.x clustering services (e.g.
-         http session replication) that rely on JBoss Cache will work with
-         JBoss Cache 2.x. Also, be aware that usage of JBoss Cache 2.x in AS 4.x is not
-         something the JBoss Cache developers are making any significant effort to test,
-         so be sure to test your application well (which of course you're doing anyway.)
-      </para>
-
-      <para>
-         Note in the
-         <link linkend="sample_xml_file">example</link>
-         the value of the
-         <literal>mbean</literal>
-         element's
-         <literal>code</literal>
-         attribute:
-         <literal>org.jboss.cache.jmx.CacheJmxWrapper</literal>
-         . This is the
-         class JBoss Cache uses to handle JMX integration; the
-         <literal>Cache</literal>
-         itself does not expose an MBean
-         interface. See the
-         <link linkend="jmx.mbeans">JBoss Cache MBeans section</link>
-         for more on the
-         <literal>CacheJmxWrapper</literal>
-         .
-      </para>
-
-      <para>
-         Once your cache is deployed, in order to use it with an in-VM client
-         such as a servlet, a JMX proxy can be used to get a reference to
-         the cache:
-      </para>
-
-      <programlisting>
-         <![CDATA[
-      MBeanServer server = MBeanServerLocator.locateJBoss();
-      ObjectName on = new ObjectName("jboss.cache:service=Cache");
-      CacheJmxWrapperMBean cacheWrapper = 
-        (CacheJmxWrapperMBean) MBeanServerInvocationHandler.newProxyInstance(server, on, 
-                                                CacheJmxWrapperMBean.class, false);
-      Cache cache = cacheWrapper.getCache();
-      Node root = cache.getRoot(); // etc etc
-   ]]>
-      </programlisting>
-
-      <para>The MBeanServerLocator class is a helper to find the (only) JBoss
-         MBean server inside the current JVM. The
-         <literal>javax.management.MBeanServerInvocationHandler</literal>
-         class'
-         <literal>newProxyInstance</literal>
-         method creates a
-         dynamic proxy implementing the given interface and uses JMX to
-         dynamically dispatch methods invoked against the generated interface
-         to the MBean. The name used to look up the MBean is the same as defined
-         in the cache's configuration file.
-      </para>
-
-      <para>
-         Once the proxy to the
-         <literal>CacheJmxWrapper</literal>
-         is obtained,
-         the
-         <literal>getCache()</literal>
-         will return a reference to the
-         <literal>Cache</literal>
-         itself.
-      </para>
-
-   </section>
-
-   <section id="deployment.microcontainer">
-      <title>Via JBoss Microcontainer (JBoss AS 5.x)</title>
-
-      <para>
-         Beginning with AS 5, JBoss AS also supports deployment of POJO services via
-         deployment of a file whose name ends with
-         <literal>-beans.xml</literal>
-         .
-         A POJO service is one whose implementation is via a "Plain Old Java Object",
-         meaning a simple java bean that isn't required to implement any special
-         interfaces or extend any particular superclass. A
-         <literal>Cache</literal>
-         is a POJO service, and all the components in a
-         <literal>Configuration</literal>
-         are also POJOS, so deploying a cache in this way is a natural step.
-      </para>
-      <para>
-         Deployment of the cache is done using the JBoss Microcontainer that forms the
-         core of JBoss AS. JBoss Microcontainer is a sophisticated IOC framework
-         (similar to Spring). A
-         <literal>-beans.xml</literal>
-         file is basically
-         a descriptor that tells the IOC framework how to assemble the various
-         beans that make up a POJO service.
-      </para>
-      <para>
-         The rules for how to deploy the file, how to package it, how to
-         ensure the required jars are on the classpath, etc. are the same
-         as for a
-         <link linkend="deployment.microkernel">JMX-based deployment</link>
-         .
-      </para>
-
-      <para>
-         Following is an example
-         <literal>-beans.xml</literal>
-         file. If you
-         look in the
-         <literal>server/all/deploy</literal>
-         directory of an AS 5
-         installation, you can find several more examples.
-      </para>
-
-      <programlisting>
-         <![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
-   <!-- First we create a Configuration object for the cache -->
-   <bean name="ExampleCacheConfig"
-   		 class="org.jboss.cache.config.Configuration">
-      
-      <!-- Externally injected services -->  
-      <property name="runtimeConfig">
-         <bean name="ExampleCacheRuntimeConfig" class="org.jboss.cache.config.RuntimeConfig">
-            <property name="transactionManager">
-               <inject bean="jboss:service=TransactionManager" 
-                       property="TransactionManager"/>
-            </property>
-            <property name="muxChannelFactory"><inject bean="JChannelFactory"/></property>
-         </bean>
-      </property>
-      
-      <property name="multiplexerStack">udp</property>
-
-      <property name="clusterName">Example-EntityCache</property>
-        
-      <!--
-              Node locking level : SERIALIZABLE
-                                   REPEATABLE_READ (default)
-                                   READ_COMMITTED
-                                   READ_UNCOMMITTED
-                                   NONE
-      -->
-      <property name="isolationLevel">REPEATABLE_READ</property>
-
-      <!--     Valid modes are LOCAL
-                               REPL_ASYNC
-                               REPL_SYNC
-      -->
-      <property name="cacheMode">REPL_SYNC</property>
-
-      <!--  The max amount of time (in milliseconds) we wait until the
-            initial state (ie. the contents of the cache) are retrieved from
-            existing members in a clustered environment
-      -->
-      <property name="initialStateRetrievalTimeout">15000</property>
-
-      <!--    Number of milliseconds to wait until all responses for a
-              synchronous call have been received.
-      -->
-      <property name="syncReplTimeout">20000</property>
-
-      <!--  Max number of milliseconds to wait for a lock acquisition -->
-      <property name="lockAcquisitionTimeout">15000</property>
-        
-      <property name="exposeManagementStatistics">true</property>
-      
-      <!-- Must be true if any entity deployment uses a scoped classloader -->
-      <property name="useRegionBasedMarshalling">true</property>
-      <!-- Must match the value of "useRegionBasedMarshalling" -->
-      <property name="inactiveOnStartup">true</property>
-
-      <!--  Specific eviction policy configurations. This is LRU -->
-      <property name="evictionConfig">
-      	 <bean name="ExampleEvictionConfig" 
-      	       class="org.jboss.cache.config.EvictionConfig">
-      	    <property name="defaultEvictionPolicyClass">
-      	       org.jboss.cache.eviction.LRUPolicy
-      	    </property>
-            <property name="wakeupIntervalSeconds">5</property>
-            <property name="evictionRegionConfigs">
-               <list>
-                  <bean name="ExampleDefaultEvictionRegionConfig" 
-                        class="org.jboss.cache.config.EvictionRegionConfig">
-                     <property name="regionName">/_default_</property>
-            	     <property name="evictionPolicyConfig">
-                        <bean name="ExampleDefaultLRUConfig" 
-                              class="org.jboss.cache.eviction.LRUConfiguration">
-                           <property name="maxNodes">5000</property>
-                           <property name="timeToLiveSeconds">1000</property>
-                        </bean>
-                     </property>
-                  </bean>
-               </list>
-            </property>
-         </bean>
-      </property>
-      
-   </bean>
-   
-   <!-- Factory to build the Cache. -->
-   <bean name="DefaultCacheFactory" class="org.jboss.cache.DefaultCacheFactory">      
-      <constructor factoryClass="org.jboss.cache.DefaultCacheFactory" 
-                   factoryMethod="getInstance"/>
-   </bean>
-   
-   <!-- The cache itself -->
-   <bean name="ExampleCache" class="org.jboss.cache.CacheImpl">
-      
-      <constructor factoryMethod="createCache">
-          <factory bean="DefaultCacheFactory"/>
-          <parameter><inject bean="ExampleCacheConfig"/></parameter>
-          <parameter>false</false>
-      </constructor>
-          
-   </bean>
-
-</deployment>      
-]]>
-      </programlisting>
-
-      <para>
-         See the JBoss Microcontainer documentation
-         <footnote>
-            <para>http://labs.jboss.com/jbossmc/docs</para>
-         </footnote>
-         for details on the above syntax. Basically, each
-         <literal>bean</literal>
-         element represents an object; most going to create a
-         <literal>Configuration</literal>
-         and its
-         <link linkend="configuration.elements">constituent parts</link>
-         .
-      </para>
-      <para>
-         An interesting thing to note in the above example is the use of the
-         <literal>RuntimeConfig</literal>
-         object. External resources like
-         a
-         <literal>TransactionManager</literal>
-         and a JGroups
-         <literal>ChannelFactory</literal>
-         that are visible to the
-         microcontainer are dependency injected into the
-         <literal>RuntimeConfig</literal>
-         .
-         The assumption here is that in some other deployment descriptor in the AS,
-         the referenced beans have been described.
-      </para>
-   </section>
-
-   <section>
-      <title>Binding to JNDI in JBoss AS</title>
-      <para>
-         With the 1.x JBoss Cache releases, a proxy to the cache could be bound
-         into JBoss AS's JNDI tree using the AS's
-         <literal>JRMPProxyFactory</literal>
-         service. With JBoss Cache 2.x, this no longer works. An alternative
-         way of doing a similar thing with a POJO (i.e. non-JMX-based) service
-         like a
-         <literal>Cache</literal>
-         is under development by the JBoss AS
-         team
-         <footnote>
-            <para>http://jira.jboss.com/jira/browse/JBAS-4456</para>
-         </footnote>
-         . That feature is not available as of the time of this writing,
-         although it will be completed before AS 5.0.0.GA is released.
-         We will add a wiki page describing how to use it once it becomes available.
-      </para>
-   </section>
-
-   <section>
-      <title>Runtime Management Information</title>
-      <para>JBoss Cache includes JMX MBeans to expose cache functionality and provide statistics that can be
-         used to analyze cache operations. JBoss Cache can also broadcast cache events as MBean notifications for
-         handling
-         via JMX monitoring tools.
-      </para>
-
-      <section id="jmx.mbeans">
-         <title>JBoss Cache MBeans</title>
-         <para>
-            JBoss Cache provides an MBean that can be registered with your environments JMX server to allow access
-            to the cache instance via JMX. This MBean is the
-            <literal>org.jboss.cache.jmx.CacheJmxWrapper</literal>
-            .
-            It is a StandardMBean, so it's MBean interface is
-            <literal>org.jboss.cache.jmx.CacheJmxWrapperMBean</literal>
-            .
-            This MBean can be used to:
-            <itemizedlist>
-               <listitem>Get a reference to the underlying
-                  <literal>Cache</literal>
-                  .
-               </listitem>
-               <listitem>Invoke create/start/stop/destroy lifecycle operations on
-                  the underlying
-                  <literal>Cache</literal>
-                  .
-               </listitem>
-               <listitem>Inspect various details about the cache's current state (number of nodes, lock information,
-                  etc.)
-               </listitem>
-               <listitem>See numerous details about the cache's configuration, and
-                  change those configuration items that can be changed when the
-                  cache has already been started.
-               </listitem>
-            </itemizedlist>
-            See the
-            <literal>CacheJmxWrapperMBean</literal>
-            javadoc for more details.
-         </para>
-         <para>
-            It is important to note a significant architectural difference between JBoss Cache 1.x and 2.x. In 1.x,
-            the old
-            <literal>TreeCache</literal>
-            class was itself an MBean, and essentially exposed the cache's entire
-            API via JMX. In 2.x, JMX has been returned to it's fundamental role as a management layer. The
-            <literal>Cache</literal>
-            object itself is completely unaware of JMX; instead JMX functionality is added
-            through a wrapper class designed for that purpose. Furthermore, the interface exposed through JMX
-            has been limited to management functions; the general
-            <literal>Cache</literal>
-            API is no longer exposed
-            through JMX. For example, it is no longer possible to invoke a cache
-            <literal>put</literal>
-            or
-            <literal>get</literal>
-            via the JMX interface.
-         </para>
-         <para>
-            If a
-            <literal>CacheJmxWrapper</literal>
-            is registered, JBoss Cache also provides MBeans
-            for each interceptor configured in the cache's interceptor stack. These
-            MBeans are used to capture and expose statistics related to cache operations. They are hierarchically
-            associated with the
-            <literal>CacheJmxWrapper</literal>
-            MBean and have service names that reflect this relationship. For
-            example, a replication interceptor MBean for the
-            <literal>jboss.cache:service=TomcatClusteringCache</literal>
-            instance will be
-            accessible through the service named
-            <literal>jboss.cache:service=TomcatClusteringCache,cache-interceptor=ReplicationInterceptor</literal>
-            .
-         </para>
-      </section>
-
-      <section id="jmx.registration">
-         <title>Registering the CacheJmxWrapper with the MBeanServer</title>
-
-         <para>
-            The best way to ensure the
-            <literal>CacheJmxWrapper</literal>
-            is registered
-            in JMX depends on how you are deploying your cache:
-         </para>
-
-         <section id="jmx.registration.programatic">
-            <title>Programatic Registration</title>
-
-            <para>
-               Simplest way to do this is to create your
-               <literal>Cache</literal>
-               and pass it to the
-               <literal>CacheJmxWrapper</literal>
-               constructor.
-            </para>
-
-            <programlisting>
-               CacheFactory factory = DefaultCacheFactory.getInstance();
-               // Build but don't start the cache
-               // (although it would work OK if we started it)
-               Cache cache = factory.createCache("cache-configuration.xml", false);
-
-               CacheJmxWrapperMBean wrapper = new CacheJmxWrapper(cache);
-               MBeanServer server = getMBeanServer(); // however you do it
-               ObjectName on = new ObjectName("jboss.cache:service=TreeCache");
-               server.registerMBean(wrapper, on);
-
-               // Invoking lifecycle methods on the wrapper results
-               // in a call through to the cache
-               wrapper.create();
-               wrapper.start();
-
-               ... use the cache
-
-               ... on application shutdown
-
-               // Invoking lifecycle methods on the wrapper results
-               // in a call through to the cache
-               wrapper.stop();
-               wrapper.destroy();
-            </programlisting>
-
-            <para>
-               Alternatively, build a
-               <literal>Configuration</literal>
-               object
-               and pass it to the
-               <literal>CacheJmxWrapper</literal>
-               . The wrapper
-               will construct the
-               <literal>Cache</literal>
-               :
-            </para>
-
-            <programlisting>
-               Configuration config = buildConfiguration(); // whatever it does
-
-               CacheJmxWrapperMBean wrapper = new CacheJmxWrapper(config);
-               MBeanServer server = getMBeanServer(); // however you do it
-               ObjectName on = new ObjectName("jboss.cache:service=TreeCache");
-               server.registerMBean(wrapper, on);
-
-               // Call to wrapper.create() will build the Cache if one wasn't injected
-               wrapper.create();
-               wrapper.start();
-
-               // Now that it's built, created and started, get the cache from the wrapper
-               Cache cache = wrapper.getCache();
-
-               ... use the cache
-
-               ... on application shutdown
-
-               wrapper.stop();
-               wrapper.destroy();
-
-            </programlisting>
-         </section>
-
-         <section>
-            <title>JMX-Based Deployment in JBoss AS (JBoss AS 4.x and 5.x)</title>
-
-            <para>
-               When you
-               <link linkend="deployment.microkernel">deploy your cache in JBoss AS using a -service.xml file</link>
-               ,
-               a
-               <literal>CacheJmxWrapper</literal>
-               is automatically registered. There is no need
-               to do anything further. The
-               <literal>CacheJmxWrapper</literal>
-               is accessible from an MBean server
-               through the service name specified in the cache configuration file's
-               <literal>mbean</literal>
-               element.
-            </para>
-         </section>
-
-         <section>
-            <title>Via JBoss Microcontainer (JBoss AS 5.x)</title>
-
-            <para>
-               <literal>CacheJmxWrapper</literal>
-               is a POJO, so the microcontainer
-               has no problem creating one. The trick is
-               getting it to register your bean in JMX. This can be done by
-               specifying the
-               <literal>org.jboss.aop.microcontainer.aspects.jmx.JMX</literal>
-               annotation on the
-               <literal>CacheJmxWrapper</literal>
-               bean:
-            </para>
-
-            <programlisting>
-               <![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
-   <!-- First we create a Configuration object for the cache -->
-   <bean name="ExampleCacheConfig"
-   		 class="org.jboss.cache.config.Configuration">
-      
-      ... build up the Configuration
-      
-   </bean>
-   
-   <!-- Factory to build the Cache. -->
-   <bean name="DefaultCacheFactory" class="org.jboss.cache.DefaultCacheFactory">      
-      <constructor factoryClass="org.jboss.cache.DefaultCacheFactory" 
-                   factoryMethod="getInstance"/>
-   </bean>
-   
-   <!-- The cache itself -->
-   <bean name="ExampleCache" class="org.jboss.cache.CacheImpl">
-      
-      <constructor factoryMethod="createnewInstance">
-          <factory bean="DefaultCacheFactory"/>
-          <parameter><inject bean="ExampleCacheConfig"/></parameter>
-          <parameter>false</false>
-      </constructor>
-          
-   </bean>
-   
-   <!-- JMX Management -->
-   <bean name="ExampleCacheJmxWrapper" class="org.jboss.cache.jmx.CacheJmxWrapper">
-      
-      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=ExampleTreeCache", 
-                         exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class, 
-                         registerDirectly=true)</annotation>
-      
-      <constructor>
-          <parameter><inject bean="ExampleCache"/></parameter>
-      </constructor>
-          
-   </bean>
-
-</deployment>      
-]]>
-            </programlisting>
-
-            <para>
-               As discussed in the
-               <link linkend="jmx.registration.programatic">Programatic Registration</link>
-               section,
-               <literal>CacheJmxWrapper</literal>
-               can do the work of building,
-               creating and starting the
-               <literal>Cache</literal>
-               if it is provided
-               with a
-               <literal>Configuration</literal>
-               . With the microcontainer,
-               this is the preferred approach, as it saves the boilerplate XML
-               needed to create the
-               <literal>CacheFactory</literal>
-               :
-            </para>
-
-            <programlisting>
-               <![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
-   <!-- First we create a Configuration object for the cache -->
-   <bean name="ExampleCacheConfig"
-   		 class="org.jboss.cache.config.Configuration">
-      
-      ... build up the Configuration
-      
-   </bean>
-    
-   <bean name="ExampleCache" class="org.jboss.cache.jmx.CacheJmxWrapper">
-      
-      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=ExampleTreeCache", 
-                         exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class, 
-                         registerDirectly=true)</annotation>
-      
-      <constructor>
-          <parameter><inject bean="ExampleCacheConfig"/></parameter>
-      </constructor>
-          
-   </bean>
-
-</deployment>      
-]]>
-            </programlisting>
-         </section>
-
-      </section>
-
-      <section id="jmx.statistics">
-         <title>JBoss Cache Statistics</title>
-         <para>
-            JBoss Cache captures statistics in its interceptors and exposes the statistics through interceptor
-            MBeans. Gathering of statistics is enabled by default; this can be disabled for a specific cache
-            instance through the
-            <literal>ExposeManagementStatistics</literal>
-            configuration attribute. Note that
-            the majority of the statistics are provided by the
-            <literal>CacheMgmtInterceptor</literal>
-            ,
-            so this MBean is the most significant in this regard. If you want to disable all statistics for performance
-            reasons, you set
-            <literal>ExposeManagementStatistics</literal>
-            to
-            <literal>false</literal>
-            as this will
-            prevent the
-            <literal>CacheMgmtInterceptor</literal>
-            from being included in the cache's interceptor stack
-            when the cache is started.
-         </para>
-         <para>
-            If a
-            <literal>CacheJmxWrapper</literal>
-            is registered with JMX, the wrapper also ensures that
-            an MBean is registered in JMX for each interceptor that exposes statistics
-            <footnote>
-               <para>
-                  Note that if the
-                  <literal>CacheJmxWrapper</literal>
-                  is not registered in JMX, the
-                  interceptor MBeans will not be registered either. The JBoss Cache 1.4 releases
-                  included code that would try to "discover" an
-                  <literal>MBeanServer</literal>
-                  and
-                  automatically register the interceptor MBeans with it. For JBoss Cache 2.x we decided
-                  that this sort of "discovery" of the JMX environment was beyond the proper scope of
-                  a caching library, so we removed this functionality.
-               </para>
-            </footnote>
-            .
-            Management tools can then access those MBeans to examine the statistics. See the section in the
-            <link linkend="jmx_reference.statistics">JMX Reference chapter</link>
-            pertaining to the
-            statistics that are made available via JMX.
-         </para>
-         <para>
-            The name under which the interceptor MBeans will be registered is derived by taking the
-            <literal>ObjectName</literal>
-            under which the
-            <literal>CacheJmxWrapper</literal>
-            is
-            registered and adding a
-            <literal>cache-interceptor</literal>
-            attribute key whose value
-            is the non-qualified name of the interceptor class. So, for example, if the
-            <literal>CacheJmxWrapper</literal>
-            were registered under
-            <literal>jboss.cache:service=TreeCache</literal>
-            , the name of the
-            <literal>CacheMgmtInterceptor</literal>
-            MBean would be
-            <literal>jboss.cache:service=TreeCache,cache-interceptor=CacheMgmtInterceptor</literal>
-            .
-         </para>
-         <para>
-            Each interceptor's MBean exposes a
-            <literal>StatisticsEnabled</literal>
-            attribute that can be used to disable maintenance of statistics for
-            that interceptor. In addition, each interceptor MBean provides the following common operations and
-            attributes.
-            <itemizedlist>
-               <listitem>
-                  <literal>dumpStatistics</literal>
-                  - returns a
-                  <literal>Map</literal>
-                  containing the interceptor's attributes and values.
-               </listitem>
-               <listitem>
-                  <literal>resetStatistics</literal>
-                  - resets all statistics maintained by the interceptor.
-               </listitem>
-               <listitem>
-                  <literal>setStatisticsEnabled(boolean)</literal>
-                  - allows statistics to be disabled for a specific interceptor.
-               </listitem>
-            </itemizedlist>
-         </para>
-         <para>
-         </para>
-      </section>
-
-      <section>
-         <title>Receiving JMX Notifications</title>
-         <para>
-            JBoss Cache users can register a listener to receive cache events described earlier in the
-            <link linkend="api.listener">User API</link>
-            chapter. Users can alternatively utilize the cache's management information infrastructure to receive these
-            events
-            via JMX notifications. Cache events are accessible as notifications by registering a
-            <literal>NotificationListener</literal>
-            for the
-            <literal>CacheJmxWrapper</literal>
-            .
-         </para>
-
-         <para>
-            See the section in the
-            <link linkend="jmx_reference.notifications">JMX Reference chapter</link>
-            pertaining
-            to JMX notifications for a list of notifications that can be received through the
-            <literal>CacheJmxWrapper</literal>
-            .
-         </para>
-
-
-         <para>
-            The following is an example of how to programmatically receive cache notifications when running in a
-            JBoss AS environment. In this example, the client uses a filter to specify which events are of interest.
-         </para>
-
-         <programlisting>
-            <![CDATA[
-         MyListener listener = new MyListener();
-         NotificationFilterSupport filter = null;
-
-         // get reference to MBean server
-         Context ic = new InitialContext();
-         MBeanServerConnection server = (MBeanServerConnection)ic.lookup("jmx/invoker/RMIAdaptor");
-
-         // get reference to CacheMgmtInterceptor MBean
-         String cache_service = "jboss.cache:service=TomcatClusteringCache";
-         ObjectName mgmt_name = new ObjectName(cache_service);
-
-         // configure a filter to only receive node created and removed events
-         filter = new NotificationFilterSupport();
-         filter.disableAllTypes();
-         filter.enableType(CacheNotificationBroadcaster.NOTIF_NODE_CREATED);
-         filter.enableType(CacheNotificationBroadcaster.NOTIF_NODE_REMOVED);
-
-         // register the listener with a filter
-         // leave the filter null to receive all cache events
-         server.addNotificationListener(mgmt_name, listener, filter, null);
-
-         // ...
-
-         // on completion of processing, unregister the listener
-         server.removeNotificationListener(mgmt_name, listener, filter, null);
-         ]]>
-         </programlisting>
-
-         <para>The following is the simple notification listener implementation used in the previous example.</para>
-         <programlisting>
-            <![CDATA[
-         private class MyListener implements NotificationListener, Serializable
-         {
-            public void handleNotification(Notification notification, Object handback)
-            {
-               String message = notification.getMessage();
-               String type = notification.getType();
-               Object userData = notification.getUserData();
-
-               System.out.println(type + ": " + message);
-
-               if (userData == null)
-               {
-                  System.out.println("notification data is null");
-               }
-               else if (userData instanceof String)
-               {
-                  System.out.println("notification data: " + (String) userData);
-               }
-               else if (userData instanceof Object[])
-               {
-                  Object[] ud = (Object[]) userData;
-                  for (Object data : ud)
-                  {
-                     System.out.println("notification data: " + data.toString());
-                  }
-               }
-               else
-               {
-                  System.out.println("notification data class: " + userData.getClass().getName());
-               }
-            }
-         }
-         ]]>
-         </programlisting>
-
-         <para>Note that the JBoss Cache management implementation only listens to cache events after a client registers
-            to receive MBean notifications. As soon as no clients are registered for notifications, the MBean will
-            remove
-            itself as a cache listener.
-         </para>
-
-      </section>
-
-      <section>
-         <title>Accessing Cache MBeans in a Standalone Environment</title>
-         <para>
-            JBoss Cache MBeans are easily accessed when running cache instances in an application server that
-            provides an MBean server interface such as JBoss JMX Console. Refer to your server documentation
-            for instructions on how to access MBeans running in a server's MBean container.
-         </para>
-         <para>
-            In addition, though, JBoss Cache MBeans are also accessible when running in a non-server environment if the
-            JVM is JDK 5.0 or later. When running a standalone cache in a JDK 5.0 environment, you can access the
-            cache's MBeans as follows.
-         </para>
-         <para>
-            <orderedlist>
-               <listitem>
-                  Set the system property
-                  <literal>-Dcom.sun.management.jmxremote</literal>
-                  when starting the JVM
-                  where the cache will run.
-               </listitem>
-               <listitem>
-                  Once the JVM is running, start the JDK 5.0
-                  <literal>jconsole</literal>
-                  utility, located in your JDK's
-                  <literal>/bin</literal>
-                  directory.
-               </listitem>
-               <listitem>When the utility loads, you will be able to select your running JVM and connect to it. The
-                  JBoss Cache
-                  MBeans will be available on the MBeans panel.
-               </listitem>
-            </orderedlist>
-         </para>
-         <para>Note that the
-            <literal>jconsole</literal>
-            utility will automatically register as a listener for cache notifications when
-            connected to a JVM running JBoss Cache instances.
-         </para>
-
-         <para>The following figure shows cache interceptor MBeans in
-            <literal>jconsole</literal>
-            . Cache statistics are displayed
-            for the
-            <literal>CacheMgmtInterceptor</literal>
-            :
-         </para>
-
-         <figure>
-            <title>CacheMgmtInterceptor MBean in jconsole</title>
-
-            <mediaobject>
-               <imageobject>
-                  <imagedata fileref="CacheMgmtInterceptor.png"/>
-               </imageobject>
-            </mediaobject>
-         </figure>
-
-      </section>
-   </section>
-</chapter>

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,537 +0,0 @@
-<chapter id="eviction_policies">
-   <title>Eviction Policies</title>
-
-   <para>
-      Eviction policies control JBoss Cache's memory management by managing how many nodes are allowed to be stored in
-      memory and their life spans. Memory constraints on servers mean cache cannot grow indefinitely, so policies
-      need to be in place to restrict the size of the cache. Eviction policies are most often used alongside
-      <link linkend="cache_loaders">cache loaders</link>
-      .
-   </para>
-
-   <section>
-      <title>Configuring Eviction Policies</title>
-      <section>
-         <title>Basic Configuration</title>
-         <para>
-            The basic eviction policy configuration element looks like:
-            <programlisting>
-               <![CDATA[
-
-   ...
-
-   <attribute name="EvictionConfig">
-      <config>
-         <attribute name="wakeUpIntervalSeconds">3</attribute>
-
-         <!-- This defaults to 200000 if not specified -->
-         <attribute name="eventQueueSize">100000</attribute>
-
-         <!-- Name of the DEFAULT eviction policy class. -->
-         <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
-
-         <!-- Cache wide default -->
-         <region name="/_default_">
-            <attribute name="maxNodes">100</attribute>
-         </region>
-
-         <!-- override policy used for this region -->
-         <region name="/org/jboss/data" policyClass="org.jboss.cache.eviction.MRUPolicy">
-            <attribute name="maxNodes">250</attribute>
-         </region>
-
-         <!-- 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>
-   </attribute>
-
-   ...
-]]>
-            </programlisting>
-
-            <itemizedlist>
-               <listitem>
-                  <literal>wakeUpIntervalSeconds</literal>
-                  - this required parameter defines how often the eviction thread runs
-               </listitem>
-               <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. This can be overridden on a
-                  per-region basis.
-               </listitem>
-               <listitem>
-                  <literal>policyClass</literal>
-                  - this is required, unless you set individual policyClass attributes on each and every region. This
-                  defines the eviction policy to use if one is not defined for a region.
-               </listitem>
-            </itemizedlist>
-
-         </para>
-      </section>
-      <section>
-         <title>Eviction Regions</title>
-         <para>
-            The concept of regions and the
-            <literal>Region</literal>
-            class were
-            <link linkend="architecture.regions">visited earlier</link>
-            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
-            <literal>Fqn</literal>
-            that defines the region are
-            <literal>java.lang.String</literal>
-            objects.
-         </para>
-         <para>
-            Looking at the eviction configuration snippet above, we see that a default region,
-            <literal>_default_</literal>
-            , holds attributes
-            which apply to nodes that do not fall into any of the other regions defined.
-         </para>
-         <para>
-            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
-            <literal>LRUPolicy</literal>
-            allows a
-            <literal>maxNodes</literal>
-            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.
-         </para>
-
-         <section>
-            <title>Overlapping Eviction Regions</title>
-
-            <para>It's possible to define regions that overlap. In other words, one region can be defined for
-               <emphasis>/a/b/c</emphasis>
-               , and another
-               defined for
-               <emphasis>/a/b/c/d</emphasis>
-               (which is just the
-               <emphasis>d</emphasis>
-               subtree of the
-               <emphasis>/a/b/c</emphasis>
-               sub-tree).
-               The algorithm, in order to handle scenarios like this consistently, will always choose the first region
-               it encounters.
-               In this way, if the algorithm needed to decide how to handle
-               <emphasis>/a/b/c/d/e</emphasis>
-               , it would start from there and work
-               its way up the tree until it hits the first defined region - in this case
-               <emphasis>/a/b/c/d</emphasis>
-               .
-            </para>
-         </section>
-
-      </section>
-      <section>
-         <title>Programmatic Configuration</title>
-         <para>
-            Configuring eviction using the
-            <literal>Configuration</literal>
-            object entails the use of the
-            <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>
-
-   <section>
-      <title>Shipped Eviction Policies</title>
-      <section>
-         <title>LRUPolicy - Least Recently Used</title>
-
-         <para>
-            <literal>org.jboss.cache.eviction.LRUPolicy</literal>
-            controls both the node lifetime and age. This policy guarantees a constant order (
-            <literal>O (1)</literal>
-            ) for
-            adds, removals and lookups (visits). It has the following configuration
-            parameters:
-         </para>
-
-         <itemizedlist>
-            <listitem>
-               <literal>maxNodes</literal>
-               - This is the maximum number of nodes allowed in this region. 0 denotes no limit.
-            </listitem>
-            <listitem>
-               <literal>timeToLiveSeconds</literal>
-               - The amount of time a node is not written to or read (in seconds) before the node is swept away. 0
-               denotes no limit.
-            </listitem>
-
-            <listitem>
-               <literal>maxAgeSeconds</literal>
-               - Lifespan of a node (in seconds) regardless of idle time before the node is swept away. 0 denotes no
-               limit.
-            </listitem>
-         </itemizedlist>
-      </section>
-
-      <section>
-         <title>FIFOPolicy - First In, First Out</title>
-
-         <para>
-            <literal>org.jboss.cache.eviction.FIFOPolicy</literal>
-            controls the eviction in a proper first in first out order. This policy
-            guarantees a constant order (
-            <literal>O (1)</literal>
-            ) for adds, removals and lookups (visits). It has the
-            following configuration parameters:
-         </para>
-
-         <itemizedlist>
-            <listitem>
-               <literal>maxNodes</literal>
-               - This is the maximum number of nodes allowed in this region. 0 denotes no limit.
-            </listitem>
-         </itemizedlist>
-      </section>
-
-
-      <section>
-         <title>MRUPolicy - Most Recently Used</title>
-
-         <para>
-            <literal>org.jboss.cache.eviction.MRUPolicy</literal>
-            controls
-            the eviction in based on most recently used algorithm. The most recently
-            used nodes will be the first to evict with this policy. This policy
-            guarantees a constant order (
-            <literal>O (1)</literal>
-            ) for adds, removals and lookups (visits). It has the
-            following configuration parameters:
-         </para>
-
-         <itemizedlist>
-            <listitem>
-               <literal>maxNodes</literal>
-               - This is the maximum number of nodes allowed in this region. 0 denotes no limit.
-            </listitem>
-         </itemizedlist>
-      </section>
-
-      <section>
-         <title>LFUPolicy - Least Frequently Used</title>
-
-         <para>
-            <literal>org.jboss.cache.eviction.LFUPolicy</literal>
-            controls
-            the eviction in based on least frequently used algorithm. The least
-            frequently used nodes will be the first to evict with this policy. Node
-            usage starts at 1 when a node is first added. Each time it is visted,
-            the node usage counter increments by 1. This number is used to determine
-            which nodes are least frequently used. LFU is also a sorted eviction
-            algorithm. The underlying EvictionQueue implementation and algorithm is
-            sorted in ascending order of the node visits counter. This class
-            guarantees a constant order (
-            <literal>O (1)</literal>
-            ) for adds, removal and searches. However, when any
-            number of nodes are added/visited to the queue for a given processing
-            pass, a single quasilinear (
-            <literal>O (n * log n)</literal>
-            ) operation is used to resort the queue in
-            proper LFU order. Similarly if any nodes are removed or evicted, a
-            single linear (
-            <literal>O (n)</literal>
-            ) pruning operation is necessary to clean up the
-            EvictionQueue. LFU has the following configuration parameters:
-         </para>
-
-         <itemizedlist>
-            <listitem>
-               <literal>maxNodes</literal>
-               - This is the maximum number of nodes allowed in this region. 0 denotes no limit.
-            </listitem>
-            <listitem>
-               <literal>minNodes</literal>
-               - This is the minimum number of nodes allowed in this region. This value determines what
-               the eviction queue should prune down to per pass. e.g. If
-               minNodes is 10 and the cache grows to 100 nodes, the cache is
-               pruned down to the 10 most frequently used nodes when the
-               eviction timer makes a pass through the eviction
-               algorithm.
-            </listitem>
-
-         </itemizedlist>
-
-      </section>
-
-      <section>
-         <title>ExpirationPolicy</title>
-
-         <para>
-            <literal>org.jboss.cache.eviction.ExpirationPolicy</literal>
-            is a policy
-            that evicts nodes based on an absolute expiration time. The
-            expiration time is indicated using the
-            <literal>org.jboss.cache.Node.put()</literal>
-            method, using a String key
-            <literal>expiration</literal>
-            and the absolute time as a
-            <literal>java.lang.Long</literal>
-            object, with a value indicated as milliseconds past midnight
-            January 1st, 1970 UTC (the same relative time as provided by
-            <literal>java.lang.System.currentTimeMillis()</literal>
-            ).
-         </para>
-
-         <para>
-            This policy guarantees a constant order (
-            <literal>O (1)</literal>
-            ) for adds and removals.
-            Internally, a sorted set (TreeSet) containing the expiration
-            time and Fqn of the nodes is stored, which essentially
-            functions as a heap.
-         </para>
-
-         <para>
-            This policy has the following configuration parameters:
-         </para>
-
-         <itemizedlist>
-            <listitem>
-               <literal>expirationKeyName</literal>
-               - This is the Node key name used
-               in the eviction algorithm. The configuration default is
-               <literal>expiration</literal>
-               .
-            </listitem>
-            <listitem>
-               <literal>maxNodes</literal>
-               - This is the maximum number of nodes allowed in this region. 0 denotes no limit.
-            </listitem>
-
-         </itemizedlist>
-
-         <para>
-            The following listing shows how the expiration date is indicated and how the
-            policy is applied:
-            <programlisting>
-               <![CDATA[
-   Cache cache = DefaultCacheFactory.createCache();
-   Fqn fqn1 = Fqn.fromString("/node/1");
-   Long future = new Long(System.currentTimeMillis() + 2000);
-
-   // sets the expiry time for a node
-   cache.getRoot().addChild(fqn1).put(ExpirationConfiguration.EXPIRATION_KEY, future);
-
-   assertTrue(cache.getRoot().hasChild(fqn1));
-   Thread.sleep(5000);
-
-   // after 5 seconds, expiration completes
-   assertFalse(cache.getRoot().hasChild(fqn1));
-]]>
-            </programlisting>
-            Note that the expiration time of nodes is only checked when the
-            region manager wakes up every
-            <literal>wakeUpIntervalSeconds</literal>
-            , so eviction
-            may happen a few seconds later than indicated.
-         </para>
-      </section>
-      <section>
-         <title>ElementSizePolicy - Eviction based on number of key/value pairs in a node</title>
-
-         <para>
-            <literal>org.jboss.cache.eviction.ElementSizePolicy</literal>
-            controls
-            the eviction in based on the number of key/value pairs in the node. Nodes The most recently
-            used nodes will be the first to evict with this policy. It has the following configuration parameters:
-         </para>
-
-         <itemizedlist>
-            <listitem>
-               <literal>maxNodes</literal>
-               - This is the maximum number of nodes allowed in this region. 0 denotes no limit.
-            </listitem>
-            <listitem>
-               <literal>maxElementsPerNode</literal>
-               - This is the trigger number of attributes per node for the node to be selected for eviction. 0 denotes
-               no limit.
-            </listitem>
-         </itemizedlist>
-      </section>
-   </section>
-
-   <section>
-      <title>Writing Your Own Eviction Policies</title>
-      <section>
-         <title>Eviction Policy Plugin Design</title>
-
-         <para>The design of the JBoss Cache eviction policy framework is based
-            on an
-            <literal>EvictionInterceptor</literal>
-            to handle cache events and relay them back to the eviction
-            policies. During the cache start up, an
-            <literal>EvictionInterceptor</literal>
-            will be added to the cache
-            interceptor stack if the eviction policy is specified.
-            Then whenever a node is added, removed, evicted, or visited, the
-            <literal>EvictionInterceptor</literal>
-            will maintain state statistics and
-            information will be relayed to each individual eviction region.
-         </para>
-
-         <para>
-            There is a single eviction thread (timer) that will run at a
-            configured interval. This thread will make calls into each of the policy
-            providers and inform it of any aggregated adds,
-            removes and visits (gets) events to the cache during the configured interval.
-            The eviction thread is responsible for kicking off the eviction policy
-            processing (a single pass) for each configured eviction cache
-            region.
-         </para>
-      </section>
-
-      <section>
-         <title>Interfaces to implement</title>
-         <para>In order to implement an eviction policy, the following interfaces
-            must be implemented:
-            <itemizedlist>
-               <listitem>
-                  <literal>org.jboss.cache.eviction.EvictionPolicy</literal>
-               </listitem>
-               <listitem>
-                  <literal>org.jboss.cache.eviction.EvictionAlgorithm</literal>
-               </listitem>
-               <listitem>
-                  <literal>org.jboss.cache.eviction.EvictionQueue</literal>
-               </listitem>
-               <listitem>
-                  <literal>org.jboss.cache.config.EvictionPolicyConfig</literal>
-               </listitem>
-            </itemizedlist>
-            When compounded
-            together, each of these interface implementations define all the
-            underlying mechanics necessary for a complete eviction policy
-            implementation.
-         </para>
-
-         <para>
-            <emphasis>Note that:</emphasis>
-         </para>
-
-         <itemizedlist>
-            <listitem>
-               <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>
-                  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>
-
-         <para>Alternatively, the implementation of a new eviction policy
-            provider can be simplified by extending
-            <literal>BaseEvictionPolicy</literal>
-            and
-            <literal>BaseEvictionAlgorithm</literal>
-            . Or for properly sorted EvictionAlgorithms (sorted
-            in eviction order - see
-            <literal>LFUAlgorithm</literal>
-            ) extending
-            <literal>BaseSortedEvictionAlgorithm</literal>
-            and implementing
-            <literal>SortedEvictionQueue</literal>
-            takes
-            care of most of the common functionality available in a set of eviction
-            policy provider classes
-         </para>
-
-
-         <para>
-            <emphasis>Note that:</emphasis>
-         </para>
-
-         <itemizedlist>
-            <listitem>
-               <para>The
-                  <literal>BaseEvictionAlgorithm</literal>
-                  class maintains a processing
-                  structure. It will process the ADD, REMOVE, and VISIT events queued
-                  by the region first. It also maintains an collection of
-                  items that were not properly evicted during the last go around
-                  because of held locks. That list is pruned. Finally, the
-                  EvictionQueue itself is pruned for entries that should be evicted
-                  based upon the configured eviction rules for the region.
-               </para>
-            </listitem>
-            <listitem>
-               <para>The
-                  <literal>BaseSortedEvictionAlgorithm</literal>
-                  class will maintain a boolean
-                  through the algorithm processing that will determine if any new
-                  nodes were added or visited. This allows the Algorithm to determine
-                  whether to resort the eviction queue items (in first to evict order)
-                  or to skip the potentially expensive sorting if there have been no
-                  changes to the cache in this region.
-               </para>
-            </listitem>
-            <listitem>
-               <para>The
-                  <literal>SortedEvictionQueue</literal>
-                  interface defines the contract used by
-                  the
-                  <literal>BaseSortedEvictionAlgorithm</literal>
-                  abstract class that is used to
-                  resort the underlying queue. Again, the queue sorting should be
-                  sorted in first to evict order. The first entry in the list should
-                  evict before the last entry in the queue. The last entry in the
-                  queue should be the last entry that will require eviction.
-               </para>
-            </listitem>
-         </itemizedlist>
-      </section>
-   </section>
-</chapter>
\ No newline at end of file

Added: pojo/trunk/src/main/docbook/userguide/en/modules/example.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/example.xml	                        (rev 0)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/example.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -0,0 +1,7 @@
+<chapter id="example">
+
+   <title>Example</title>
+
+
+
+</chapter>
\ No newline at end of file


Property changes on: pojo/trunk/src/main/docbook/userguide/en/modules/example.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: pojo/trunk/src/main/docbook/userguide/en/modules/instrumentation.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/instrumentation.xml	                        (rev 0)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/instrumentation.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -0,0 +1,320 @@
+<chapter id="instrumentation">
+
+   <title>Instrumentation</title>
+
+      <para>In this chapter, we explain how to instrument (or "aspectize") the
+         POJOs via JBoss Aop. There are two steps needed by JBoss Aop: 1) POJO
+         declaration, 2) instrumentation. But depends on the instrumentation
+      mode that you are using, you may not need to pre-process your POJO at all. That is,
+      if you use JDK5.0 (required) and load-time mode, then all you need to do is
+      annotating your POJO (or declare it in a xml file). This makes your PojoCache
+      programming nearly transparent.</para>
+
+      <para>For the first step, since we are using the dynamic Aop feature, a
+         POJO is only required to be declared "prepare". Basically, there are two
+         ways to do this: either via explicit xml or annotation.</para>
+
+      <para>As for the second step, either we can ask JBoss Aop to do load-time
+         (through a special class loader, so-called load-time mode) or compile-time
+         instrumentation (use of an aopc pre-compiler, so-called precompiled
+         mode). Reader can read the JBoss Aop introduction chapter for more details.</para>
+
+         <sect1>
+            <title>XML descriptor</title>
+
+            <para>To declare a POJO via XML configuration file, you will need a
+               <literal>META-INF/jboss-aop.xml</literal> (or in the PojoCache case, it is
+               the equivalent <literal>pojocache-service.xml</literal>
+               file located under the class
+               path or listed in the <literal>jboss.aop.path</literal> system
+               property. JBoss AOP framework will read this file during startup to make
+               necessary byte code manipulation for advice and introduction. Or you
+               can pre-compile it using a pre-compiler called
+               <literal>aopc</literal>
+               such that you won't need the XML file during load time. JBoss Aop
+               provides a so-called
+               <literal>pointcut</literal>
+               language where it
+               consists of a regular expression set to specify the interception
+               points (or
+               <literal>jointpoint</literal>
+               in aop parlance). The
+               jointpoint can be constructor, method call, or field. You will need to
+               declare any of your POJO to be "prepared" so that AOP framework knows
+               to start intercepting either method, field, or constructor invocations
+               using the dynamic Aop.
+            </para>
+
+            <para>For PojoCache, we only allow all the
+               fields (both read and write) to be intercepted. That is, we don't care
+               for the method level interception since it is the state that we are
+               interested in. So you should
+               only need to change your POJO class name. For details of the pointcut
+               language, please refer to JBoss Aop.</para>
+
+            <para>The standalone
+               <literal>JBoss Cache</literal>
+               distribution
+               package provides an example declaration for the tutorial classes,
+               namely,
+               <literal>Person</literal>
+               and
+               <literal>Address</literal>
+               .
+               Detailed class declaration for
+               <literal>Person</literal>
+               and
+               <literal>Address</literal>
+               are provided in the Appendix section. But here
+               is the snippet for
+               <literal>pojocache-aop.xml</literal>
+               :
+            </para>
+
+<programlisting>
+&lt;aop&gt;
+  &lt;prepare expr="field(* $instanceof{@org.jboss.cache.pojo.annotation.Replicable}-&gt;*)" /&gt;
+&lt;/aop&gt;
+</programlisting>
+            and then notice the annotation @Replicable used in the <literal>Person</literal> and
+            <literal>Address</literal> POJOs. Also note that @Replicable is now inheritant. For example,
+            sub-class of <literal>Person</literal> such as <literal>Student</literal> will also
+            be aspectized by JBoss Aop as well. If you want to stop this inheritance behavior,
+            you can simply remove the
+            <literal>$instanceof</literal> declaration in the prepare statement, e.g.,
+            <programlisting>
+            &lt;aop&gt;
+              &lt;prepare expr="field(* @org.jboss.cache.pojo.annotation.Replicable-&gt;*)" /&gt;
+            &lt;/aop&gt;
+            </programlisting>
+
+
+            <para>Detailed semantics of
+               <literal>pojocache-aop.xml</literal>  (or equivalently <literal>pojocache-aop.xml</literal>)
+               can again
+               be found in JBoss Aop. But above statements basically declare all field
+               read and write operations in classes
+               <code>Address</code>
+               and
+               <code>Person</code>
+               will be "prepared" (or "aspectized"). Note
+               that:
+            </para>
+
+            <itemizedlist>
+               <listitem>
+                  The wildcard at the end of the expression signifies all fields in the POJO
+               </listitem>
+
+               <listitem>
+                  You can potentially replace specific class name with wildcard that includes all the POJOs inside the
+                  same package space
+               </listitem>
+
+               <listitem>
+                  The
+
+                  <code>instanceof</code>
+
+                  operator declares any sub-type or sub-class of the specific POJO will also be "aspectized". For
+                  example, if a
+                  <code>Student</code>
+                  class is a subclass of
+                  <code>Person</code>
+                  , JBossAop will automatically instrument it as well!
+               </listitem>
+
+               <listitem>
+                  We intercept the field of all access levels (i.e.,
+                  <literal>private</literal>
+                  ,
+                  <literal>protected</literal>
+                  ,
+                  <literal>public</literal>
+                  , etc.) The main reason being that we consider all fields as stateful data. However, we can relax this
+                  requirement in the future if there is a use case for it.
+               </listitem>
+
+               <listitem>
+                  We don't intercept field modifiers of
+                  <literal>final</literal>
+                  and
+                  <literal>transient</literal>
+                  though. That is, field with these modifiers are not stored in cache and is not replicated either. If
+                  you don't want your field to be managed by the cache, you can declare them with these modifiers, e.g.,
+                  transient.
+               </listitem>
+            </itemizedlist>
+         </sect1>
+
+         <sect1>
+            <title>Annotation</title>
+            <para>Annotation is a new feature in Java 5.0 that when declared can
+               contain metadata at compile and run time. It is well suited for aop
+               declaration since there will be no need for external metadata xml
+               descriptor.</para>
+
+            <sect2>
+               <title>POJO annotation for instrumentation</title>
+            <para>To support annotation (in order to
+               simplify user's development effort), the JBoss Cache distribution ships with a
+               <literal>pojocache-aop.xml</literal>
+               under the
+               <literal>resources</literal>
+               directory. For
+               reference, here is annotation definition from
+               <literal>pojocache-aop.xml</literal> again
+               :
+<programlisting>
+&lt;aop&gt;
+  &lt;prepare expr="field(* @org.jboss.cache.pojo.annotation.Replicable-&gt;*)" /&gt;
+&lt;/aop&gt;
+</programlisting>
+               Basically, it simply states that any annotation
+               with both marker interfaces will be "aspectized" accordingly.
+            </para>
+
+
+            <para>Here is a code snippet that illustrate the declaration:</para>
+<programlisting>
+ at org.jboss.cache.pojo.annotation.Replicable
+public class Person {...}
+</programlisting>
+The above declaration will instrument the class <literal>Person</literal> and all of its sub-classes. That is, if
+<literal>Student</literal> sub-class from <literal>Personal</literal>, then it will get instrumented automatically without
+            further annotation declaration.
+            </sect2>
+
+            <sect2>
+               <title>JDK5.0 field level annotations</title>
+               <para>In Release 2.0, we have added two additional field level annotations for customized behavior.
+                  The first one is <code>@org.jboss.cache.pojo.annotation.Transient</code>. When applied to a field
+                  variable, it has the same effect as the Java language <code>transient</code> keyword. That is, PojoCache
+                  won't put this field into cache management (and therefore no replication).
+               </para>
+               <para>
+                  The second one is <code>@org.jboss.cache.pojo.annotation.Serializable</code>, when applied to a field
+                  variable, PojoCache will treat this variable as <code>Serializable</code>, even when it is
+                  <code>Replicable</code>. However, the field will need to implement the <code>Serializable</code>
+                  interface such that it can be replicated.
+               </para>
+               <para>Here is a code snippet that illustrates usage of these two annotations.
+                  Assuming that you have a Gadget class:
+<programlisting>
+public class Gadget
+{
+   // resource won't be replicated
+   @Transient Resource resource;
+   // specialAddress is treated as a Serializable object but still has object relationship
+   @Serializable SpecialAddress specialAddress;
+   // other state variables
+}
+</programlisting>
+               Then when we do:
+<programlisting>
+   Gadget gadget = new Gadget();
+   Resource resource = new Resource();
+   SepcialAddress specialAddress = new SpecialAddress();
+
+   // setters
+   gadget.setResource(resource);
+   gadget.setSpecialAddress(specialAddress);
+
+   cache1.putObject("/gadget", gadget); // put into PojoCache management
+
+   Gadget g2 = (Gadget)cache2.getObject("/gadget"); // retrieve it from another cache instance
+   g2.getResource(); // This is should be null because of @Transient tag so it is not replicated.
+
+   SepcialAddress d2 = g2.getSpecialAddress();
+   d2.setName("inet"); // This won't get replicated automatically because of @Serializable tag
+   ge.setSpecialAddress(d2); // Now this will.
+</programlisting>
+               </para>
+            </sect2>
+
+         </sect1>
+
+         <sect1>
+            <title>Weaving</title>
+
+            <para>As already mentioned, a user can use the aop precompiler
+               (<literal>aopc</literal>) to precompile the POJO classes such that,
+               during runtime, there is no additional system class loader needed. The
+               precompiler will read in
+               <literal>pojocache-aop.xml</literal>
+               and weave
+               the POJO byte code at compile time. This is a convenient feature to
+               make the aop less intrusive.
+            </para>
+            <para>
+               Below is an Ant snippet that defines the library needed for the various Ant targets that we are
+               listing here. User can refer to the <literal>build.xml</literal> in the distribution for full details.
+<programlisting>
+   &lt;path id="aop.classpath"/&gt;
+       &lt;fileset dir="${lib}"/&gt;
+          &lt;include name="**/*.jar" //&gt;
+          &lt;exclude name="**/jboss-cache.jar" //&gt;
+          &lt;exclude name="**/j*unit.jar" //&gt;
+          &lt;exclude name="**/bsh*.jar" //&gt;
+       &lt;/fileset/&gt;
+   &lt;/path/&gt;
+</programlisting>
+            </para>
+
+         <sect2>
+            <title>Ant target for running load-time instrumentation using specialized class loader</title>
+            <para>
+               In JDK5.0, you can use the <code>javaagent</code> option that does not require a
+               separate Classloader. Here are the ant snippet from <code>one-test-pojo</code>, for example.
+<programlisting>
+   &lt;target name="one.test.pojo" depends="compile" description="run one junit test case."&gt;
+     &lt;junit printsummary="yes" timeout="${junit.timeout}" fork="yes"&gt;
+        &lt;jvmarg value="-Djboss.aop.path=${output}/resources/pojocache-aop.xml"/&gt;
+        &lt;jvmarg value="-javaagent:${lib}/jboss-aop-jdk50.jar"/&gt;
+        &lt;classpath path="${output}/etc" /&gt;
+        &lt;sysproperty key="log4j.configuration" value="file:${output}/etc/log4j.xml" /&gt;
+        &lt;classpath refid="lib.classpath"/&gt;
+        &lt;classpath refid="build.classpath"/&gt;
+        &lt;formatter type="xml" usefile="true"/&gt;
+        &lt;test name="${test}" todir="${reports}"/&gt;
+     &lt;/junit&gt;
+   &lt;/target&gt;
+</programlisting>
+            </para>
+         </sect2>
+
+         <sect2>
+            <title>Ant target for aopc</title>
+            <para>Below is the code snippet for the <literal>aopc</literal> Ant target. Running this target will do
+            compile-time weaving of the POJO classes specified.</para>
+<programlisting>
+   &lt;taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="aop.classpath"/&gt;
+   &lt;target name="aopc" depends="compile" description="Precompile aop class"&gt;
+      &lt;aopc compilerclasspathref="aop.classpath" verbose="true"&gt;
+         &lt;src path="${build}"/&gt;
+         &lt;include name="org/jboss/cache/aop/test/**/*.class"/&gt;
+         &lt;aoppath path="${output}/resources/pojocache-aop.xml"/&gt;
+         &lt;classpath path="${build}"/&gt;
+         &lt;classpath refid="lib.classpath"/&gt;
+      &lt;/aopc&gt;
+   &lt;/target&gt;
+</programlisting>
+            <para>
+               Below is a snapshot of files that are generated when aopc is applied. Notice that couple extra classes have
+               been generated because of <literal>aopc</literal>.
+            </para>
+            <figure>
+               <title>Classes generated after aopc</title>
+
+               <mediaobject>
+                  <imageobject>
+                     <imagedata fileref="images/classes.png"/>
+                  </imageobject>
+               </mediaobject>
+            </figure>
+
+         </sect2>
+         </sect1>
+
+
+</chapter>


Property changes on: pojo/trunk/src/main/docbook/userguide/en/modules/instrumentation.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/introduction.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/introduction.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/introduction.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="introduction">
-   <title>Overview</title>
-
-   <section>
-      <title>What is JBoss Cache?</title>
-
-      <para>
-         JBoss Cache is a tree-structured, clustered, transactional cache. It is
-         the backbone for many fundamental JBoss Application Server clustering services, including - in certain
-         versions - clustering JNDI, HTTP and EJB sessions.
-      </para>
-      <para>
-         JBoss Cache can also be used as a standalone transactional and clustered caching library or even an object
-         oriented data store. It can even be embedded in other enterprise Java frameworks and application servers
-         such as BEA WebLogic or IBM WebSphere, Tomcat, Spring, Hibernate, and many others. It is also very commonly
-         used directly by standalone Java applications that do not run from within an application server, to maintain
-         clustered state.
-      </para>
-      <section>
-         <title>And what is Pojo Cache?</title>
-         <para>
-            Pojo Cache is an extension of the core JBoss Cache API. Pojo Cache offers additional functionality such as:
-            <itemizedlist>
-               <listitem>maintaining object references even after replication or persistence.</listitem>
-               <listitem>fine grained replication, where only modified object fields are replicated.</listitem>
-               <listitem>"API-less" clustering model where pojos are simply annotated as being clustered.</listitem>
-            </itemizedlist>
-         </para>
-         <para>
-            Pojo Cache has a complete and separate set of documentation, including a user guide, FAQ and tutorial and
-            as such, Pojo Cache is not discussed further in this book.
-         </para>
-      </section>
-
-   </section>
-
-   <section>
-      <title>Summary of Features</title>
-
-      <para>
-         JBoss Cache offers a simple and straightforward API, where data (simple Java objects) can be placed in the
-         cache and, based on configuration options selected, this data may be one or all of:
-         <itemizedlist>
-            <listitem>replicated to some or all cache instances in a cluster.</listitem>
-            <listitem>persisted to disk and/or a remote cluster ("far-cache").</listitem>
-            <listitem>garbage collected from memory when memory runs low, and passivated to disk so state isn't lost.
-            </listitem>
-         </itemizedlist>
-         In addition, JBoss Cache offers a rich set of enterprise-class features:
-         <itemizedlist>
-            <listitem>being able to participate in JTA transactions (works with Java EE compliant TransactionManagers).
-            </listitem>
-            <listitem>attach to JMX servers and provide runtime statistics on the state of the cache.</listitem>
-            <listitem>allow client code to attach listeners and receive notifications on cache events.</listitem>
-         </itemizedlist>
-      </para>
-
-      <para>A cache is organised as a tree, with a single root. Each node in the tree essentially contains a Map,
-         which acts as a store for key/value pairs. The only requirement placed on objects that are cached is that
-         they implement
-         <literal>java.io.Serializable</literal>
-         . Note that this requirement does not exist for Pojo Cache.
-      </para>
-
-      <para>JBoss Cache
-         can be either local or replicated. Local trees exist
-         only inside the JVM in which they are created, whereas replicated trees
-         propagate any changes to some or all other trees in the same cluster. A
-         cluster may span different hosts on a network or just different JVMs
-         on a single host.
-      </para>
-
-      <para>When a change is made to an object in the cache and that change is done in
-         the context of a transaction, the replication of changes is deferred until the transaction
-         commits successfully. All modifications are kept in a list associated with
-         the transaction for the caller. When the transaction commits, we replicate the
-         changes. Otherwise, (on a rollback) we simply undo the changes locally
-         resulting in zero network traffic and overhead. For example, if a caller
-         makes 100 modifications and then rolls back the transaction, we will not replicate
-         anything, resulting in no network traffic.
-      </para>
-
-      <para>If a caller has no transaction associated with it (and isolation level is not
-         NONE - more about this later), we will replicate right after each modification, e.g. in the above
-         case we would send 100 messages, plus an additional message for the
-         rollback. In this sense, running without a transaction can be thought of as analogous as running with
-         auto-commit switched on in JDBC terminology, where each operation is committed automatically.
-      </para>
-
-      <para>
-         JBoss Cache works out of the box with most popular transaction managers, and even provides an API where
-         custom transaction manager lookups can be written.
-      </para>
-
-      <para>
-         The cache is also completely thread-safe. It uses a pessimistic locking scheme for nodes in the tree by
-         default, with an optimistic locking scheme as a configurable option. With pessimistic locking, the degree
-         of concurrency can be tuned using a number of isolation levels, corresponding to database-style
-         transaction isolation levels, i.e., SERIALIZABLE, REPEATABLE_READ, READ_COMMITTED, READ_UNCOMMITTED and NONE.
-         Concurrency, locking and isolation levels will be discussed later.
-      </para>
-   </section>
-
-   <section>
-      <title>
-         Requirements
-      </title>
-      <para>
-         JBoss Cache requires Java 5.0 (or newer).
-      </para>
-      <para>
-         However, there is a way to build JBoss Cache as a Java 1.4.x compatible binary using
-         <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossRetro">JBossRetro</ulink>
-         to retroweave the Java 5.0 binaries. However, Red Hat Inc. does not offer professional support around the
-         retroweaved
-         binary at this time and the Java 1.4.x compatible binary is not in the binary distribution. See
-         <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheHabaneroJava1.4">this wiki</ulink>
-         page for
-         details on building the retroweaved binary for yourself.
-      </para>
-      <para>
-         In addition to Java 5.0, at a minimum, JBoss Cache has dependencies on
-         <ulink url="http://www.jgroups.org">JGroups</ulink>
-         , and Apache's
-         <ulink
-                 url="http://jakarta.apache.org/commons/logging/">commons-logging
-         </ulink>
-         . JBoss Cache ships with all dependent libraries necessary to run out of the box.
-      </para>
-   </section>
-
-   <section>
-      <title>License</title>
-      <para>
-         JBoss Cache is an open source product, using the business and OEM-friendly
-         <ulink url="http://www.opensource.org/">OSI-approved</ulink>
-         <ulink url="http://www.gnu.org/copyleft/lesser.html">LGPL license.</ulink>
-         Commercial development support, production support and training for JBoss Cache is available through
-         <ulink url="http://www.jboss.com">JBoss, a division of Red Hat Inc.</ulink>
-         JBoss Cache is a part of JBoss Professional Open Source
-         <ulink url="http://www.jboss.comindex">JEMS</ulink>
-         (JBoss Enterprise Middleware Suite).
-      </para>
-   </section>
-</chapter>

Added: pojo/trunk/src/main/docbook/userguide/en/modules/introduction.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/introduction.xml	                        (rev 0)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/introduction.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -0,0 +1,257 @@
+<chapter id="intro">
+
+   <title>Introduction</title>
+
+   <sect1 id="1" revision="1">
+      <title id="s1">Overview</title>
+
+      <para>
+         JBoss Cache consists of two components, Core Cache, and POJO Cache. Core Cache provides efficient
+         memory storage, transactions, replication, eviction, persistent storage, and many other
+         "core" features you would expect from a distributed cache.
+
+         The Core Cache API is tree based. Data is arranged on the tree using nodes that each offer a map
+         of attributes. This map-like API is intuitive and easy to use for caching data, but just like the 
+         Java Collection API, it operates only off of simple and serializable types.  
+         Therefore, it has the following constraints:
+         <itemizedlist>
+         <listitem>If replication or persistence is needed, the object will then need to
+         implement the <literal>Serializable</literal> interface. E.g.,
+            <programlisting>public Class Foo implements Serializable</programlisting>
+         </listitem>
+            <listitem>If the object is mutable, any field change will require a successive put operation on the cache: 
+<programlisting>value = new Foo();
+cache.put(fqn, key, value);
+value.update(); // update value
+cache.put(fqn, key, value); // Need to repeat this step again to ask cache to persist or replicate the changes</programlisting>
+            </listitem>
+            <listitem>Java serialization always writes the entire object, even if only one field was changed. Therefore, large objects
+                      can have significant overhead, especially if they are updated frequently:
+<programlisting>thousand = new ThousandFieldObject();
+cache.put(fqn, key, thousand);
+thousand.setField1("blah"); // Only one field was modified 
+cache.put(fqn, key, thousand); // Replicates 1000 fields</programlisting>
+            </listitem>
+            <listitem>The object structure can not have a graph relationship. That is, the object can not have
+               references to objects that are shared (multiple
+               referenced) or to itself (cyclic). Otherwise, the relationship will be broken upon
+               serialization (e.g., when replicate each parent object separately). For example, Figure 1
+               illustrates this problem during replication.
+               If we have two
+               <literal>Person</literal>
+               instances that share the same
+               <literal>Address</literal>
+               ,
+               upon replication, it will be split into two separate
+               <literal>Address</literal>
+               instances (instead of just one). The following is the code snippet using Cache that illustrates this
+               problem:
+<programlisting>joe = new Person("joe");
+mary = new Person("mary");
+addr = new Address("Taipei");
+joe.setAddress(addr);
+mary.setAddress(addr);
+cache.put("/joe", "person", joe);
+cache.put("/mary", "person", mary);
+</programlisting>
+            </listitem>
+         </itemizedlist>
+      </para>
+
+      <figure>
+         <title>Illustration of shared objects problem during replication</title>
+
+         <mediaobject>
+            <imageobject>
+               <imagedata fileref="images/object_split.jpg"/>
+            </imageobject>
+         </mediaobject>
+      </figure>
+
+      <para>POJO Cache attempts to address these issues by building a layer on top of Core Cache which transparently maps 
+         normal Java object model operations to individual Node operations on the cache. 
+
+         This offers the following improvements:
+         <itemizedlist>
+            <listitem>Objects do not need to implement <literal>Serializable</literal> interface. Instead they are instrumented,
+            allowing POJO Cache to intercept individual operations.</listitem>
+            <listitem>Replication is fine-grained. Only modified fields are replicated, and they can be optionally batched in a transaction. </listitem>
+            <listitem>Object identity is preserved, so graphs and cyclical references are allowed.</listitem>
+            <listitem>Once attached to the cache, all subsequent object operationis will trigger a cache operation (like replication)
+                      automatically:
+<programlisting>POJO pojo = new POJO();
+pojoCache.attach("id", pojo);
+pojo.setName("some pojo"); // This will trigger replication automatically.
+</programlisting>
+            </listitem>
+         </itemizedlist>
+      </para>
+
+      <para>
+         In POJO Cache, these are the typical development and programming steps:
+         <itemizedlist>
+            <listitem>Annotate your object with <literal>@Replicable</literal></listitem>
+            <listitem>Use <literal>attach()</literal> to put your POJO under cache management.</listitem>
+            <listitem>Operate on the object directly. The cache will then manage the replication or persistence automatically and
+               transparently.</listitem>
+         </itemizedlist>
+      </para>
+
+      <para>
+        More details on these steps will be given in later chapters.
+      </para>
+
+      <para>
+         Since POJO Cache is a layer on-top of Core Cache, all features available in Core Cache are also available in POJO Cache. Furthermore, you can obtain an instance to the underlying Core Cache by calling <literal>PojoCache.getCache()</literal>. This is useful for resusing the same cache instance to store custom data, along with the POJO model.
+      </para>
+   </sect1>
+
+   <sect1 id="2" revision="1">
+      <title id="s2">Features</title>
+
+      <para>Here are the current features and benefits of PojoCache:</para>
+
+      <itemizedlist>
+         <listitem>
+            <para>Fine-grained replication. The replication modes supported are the
+               same as that of Core Cache:
+               <literal>LOCAL</literal>, <literal>REPL_SYNC</literal>, <literal>REPL_ASYNC</literal>,
+               <literal>INVALIDATION_SYNC</literal>, and <literal>INVALIDATION_ASYNC</literal> (see the
+               main JBoss Cache reference documentation for details). The
+               replication level is fine-grained and is performed automatically once the POJO is mapped into the
+               internal cache store. When a POJO field is updated, a replication request
+               will be sent out only to the key 
+               corresponding to that modified attribute (instead of the whole
+               object). This can have a potential performance boost during the replication
+               process; e.g., updating a single key in a big HashMap will only
+               replicate the single field instead of the whole map!
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>Transactions. All attached objects participate in a user transaction context.
+               If a rollback occurs, the previous internal field state of the object will be restored:
+<programlisting>POJO p = new POJO();
+p.setName("old value");
+pojoCache.attach("id", p);
+tx.begin(); // start a user transaction
+p.setName("some pojo");
+tx.rollback(); // this will cause the rollback
+p.getName(); // is "old value"
+</programlisting></para>
+            <para>In addition, operations under a transaction is batched. That is,
+            the update is not performed until the <literal>commit</literal> phase. Further, if replication is enabled, other nodes will not see the changes until the transaction has completed successfully.  </para>
+         </listitem>
+
+         <listitem>
+            <para>Passivation. POJO Cache supports the same passivation provided by Core Cache. When a node mapped by POJO Cache has reached a configured threshold, it is evicted from memory and stored using a cache loader. When the node is accessed again, it will be retrieved from the cache loader and put into memory.
+               The configuration parameters are the same as those of the Cache
+               counterpart. To configure the passivation, you will need to configure both the eviction policy and
+               cache loader.
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>Object cache by reachability, i.e., recursive object mapping
+               into the cache store. On attach, <literal>POJO Cache</literal>
+               will attach all referenced objects as well. This feature is explained in more detail later.
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>Natural Object Relationships. Java references are preserved as they were written. That is, a user
+               does not need to declare any object relationship (e.g., one-to-one, or
+               one-to-many) to use the cache.</para>
+         </listitem>
+
+         <listitem>
+            <para>Object Identity. Object identity is preserved. Not only can a cached object be compared
+               using <literal>equals()</literal>, but the comparison operator, <literal>==</literal>, can be 
+               used as well.  For example, an object such as
+               <literal>Address</literal> may be multiple referenced by two
+               <literal>Person</literal>s (e.g., <literal>joe</literal> and <literal>mary</literal>). 
+               The objects retrieved from <literal>joe.getAddress()</literal> and <literal>mary.getAddress()</literal>
+               should be identicali, when when retrieved from a different node in the cluster then that which attached them.
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>Inheritance. POJO Cache preserves the inheritance hierarchy of any object in the cache.
+               For example, if a <literal>Student</literal> class inherits from a
+               <keycode>Person</keycode> class, once a <literal>Student</literal>
+               object is mapped to POJO Cache (e.g., <literal>attach</literal>
+               call), the fields in the base class <literal>Person</literal>
+               are mapped as well.
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>Collections. Java Collection types (e.g. List, Set, and Map) are transparently mapped using Java proxies.
+                  Details are described later.</para>
+         </listitem>
+
+         <listitem>
+            <para>Annotation based. Starting from release 2.0, JDK 5 annotations are used to indicate that an object should
+               be instrumented for use under POJO Cache (once attached). 
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>Transparent. Once a POJO is attached to the cache, subsequent object model changes are transparently handled. 
+               No further API calls are required.</para>
+         </listitem>
+      </itemizedlist>
+   </sect1>
+
+   <sect1 id="3">
+      <title>Usage</title>
+      <para>
+         To use POJO Cache, you obtain the instance from the PojoCacheFactory by supplying a config file that is used
+         by the delegating Cache implementation. Once the PojoCache instance is obtained, you can call the cache life
+         cycle method to start the cache. Below is a code snippet that creates and starts the cache:
+<programlisting>String configFile = "replSync-service.xml";
+boolean toStart = false;
+PojoCache pcache = PojoCacheFactory.createCache(configFiel, toStart);
+pcache.start(); // if toStart above is true, it will starts the cache automatically.
+pcache.attach(id, pojo);
+...
+pcache.stop(); // stop the cache. This will take PojoCache out of the clustering group, if any, e.g.
+</programlisting>
+      </para>
+   </sect1>
+   <sect1 id="4">
+      <title>Requirements</title>
+
+      <para>
+         <literal>POJO Cache</literal> is currently supported on JDK 5 (since release 2.0).
+         It requires the following libraries (in
+         addition to jboss-cache.jar and the required libraries for Core 
+         Cache) to start up:
+      </para>
+
+      <itemizedlist>
+         <listitem>
+            <para>Library:</para>
+
+            <itemizedlist>
+               <listitem>
+                  pojocache.jar. Main POJO Cache library.
+               </listitem>
+
+               <listitem>
+                  jboss-aop-jdk50.jar. Main JBoss Aop library.
+               </listitem>
+
+               <listitem>
+                  javassist.jar. Java byte code manipulation library.
+               </listitem>
+
+               <listitem>
+                  trove.jar. High performance collections for Java.
+               </listitem>
+            </itemizedlist>
+         </listitem>
+      </itemizedlist>
+   </sect1>
+
+</chapter>


Property changes on: pojo/trunk/src/main/docbook/userguide/en/modules/introduction.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/jmx_reference.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/jmx_reference.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/jmx_reference.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,308 +0,0 @@
-<chapter id="jmx_reference">
-   <title>JMX References</title>
-   <section id="jmx_reference.statistics">
-      <title>JBoss Cache Statistics</title>
-      <para>
-         The following table describes the statistics currently available and may be collected via JMX.
-      </para>
-      <table>
-         <title>JBoss Cache Management Statistics</title>
-         <tgroup cols="4">
-            <colspec colnum="1" colwidth="2*"/>
-            <colspec colnum="2" colwidth="2*"/>
-            <colspec colnum="3" colwidth="1*"/>
-            <colspec colnum="4" colwidth="3*"/>
-            <thead>
-               <row>
-                  <entry>MBean Name</entry>
-                  <entry>Attribute</entry>
-                  <entry>Type</entry>
-                  <entry>Description</entry>
-               </row>
-            </thead>
-            <tbody>
-               <row>
-                  <entry>ActivationInterceptor</entry>
-                  <entry>Activations</entry>
-                  <entry>long</entry>
-                  <entry>Number of passivated nodes that have been activated.</entry>
-               </row>
-               <row>
-                  <entry>CacheLoaderInterceptor</entry>
-                  <entry>CacheLoaderLoads</entry>
-                  <entry>long</entry>
-                  <entry>Number of nodes loaded through a cache loader.</entry>
-               </row>
-               <row>
-                  <entry>CacheLoaderInterceptor</entry>
-                  <entry>CacheLoaderMisses</entry>
-                  <entry>long</entry>
-                  <entry>Number of unsuccessful attempts to load a node through a cache loader.</entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>Hits</entry>
-                  <entry>long</entry>
-                  <entry>Number of successful attribute retrievals.</entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>Misses</entry>
-                  <entry>long</entry>
-                  <entry>Number of unsuccessful attribute retrievals.</entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>Stores</entry>
-                  <entry>long</entry>
-                  <entry>Number of attribute store operations.</entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>Evictions</entry>
-                  <entry>long</entry>
-                  <entry>Number of node evictions.</entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>NumberOfAttributes</entry>
-                  <entry>int</entry>
-                  <entry>Number of attributes currently cached.</entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>NumberOfNodes</entry>
-                  <entry>int</entry>
-                  <entry>Number of nodes currently cached.</entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>ElapsedTime</entry>
-                  <entry>long</entry>
-                  <entry>Number of seconds that the cache has been running.</entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>TimeSinceReset</entry>
-                  <entry>long</entry>
-                  <entry>Number of seconds since the cache statistics have been reset.</entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>AverageReadTime</entry>
-                  <entry>long</entry>
-                  <entry>Average time in milliseconds to retrieve a cache attribute, including unsuccessful
-                     attribute retrievals.
-                  </entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>AverageWriteTime</entry>
-                  <entry>long</entry>
-                  <entry>Average time in milliseconds to write a cache attribute.</entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>HitMissRatio</entry>
-                  <entry>double</entry>
-                  <entry>Ratio of hits to hits and misses. A hit is a get attribute operation that results in an object
-                     being
-                     returned to the client. The retrieval may be from a cache loader if the entry isn't in the local
-                     cache.
-                  </entry>
-               </row>
-               <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>ReadWriteRatio</entry>
-                  <entry>double</entry>
-                  <entry>Ratio of read operations to write operations. This is the ratio of cache hits and misses to
-                     cache stores.
-                  </entry>
-               </row>
-               <row>
-                  <entry>CacheStoreInterceptor</entry>
-                  <entry>CacheLoaderStores</entry>
-                  <entry>long</entry>
-                  <entry>Number of nodes written to the cache loader.</entry>
-               </row>
-               <row>
-                  <entry>InvalidationInterceptor</entry>
-                  <entry>Invalidations</entry>
-                  <entry>long</entry>
-                  <entry>Number of cached nodes that have been invalidated.</entry>
-               </row>
-               <row>
-                  <entry>PassivationInterceptor</entry>
-                  <entry>Passivations</entry>
-                  <entry>long</entry>
-                  <entry>Number of cached nodes that have been passivated.</entry>
-               </row>
-               <row>
-                  <entry>TxInterceptor</entry>
-                  <entry>Prepares</entry>
-                  <entry>long</entry>
-                  <entry>Number of transaction prepare operations performed by this interceptor.</entry>
-               </row>
-               <row>
-                  <entry>TxInterceptor</entry>
-                  <entry>Commits</entry>
-                  <entry>long</entry>
-                  <entry>Number of transaction commit operations performed by this interceptor.</entry>
-               </row>
-               <row>
-                  <entry>TxInterceptor</entry>
-                  <entry>Rollbacks</entry>
-                  <entry>long</entry>
-                  <entry>Number of transaction rollbacks operations performed by this interceptor.</entry>
-               </row>
-            </tbody>
-         </tgroup>
-      </table>
-   </section>
-
-   <section id="jmx_reference.notifications">
-      <title>JMX MBean Notifications</title>
-      <para>The following table depicts the JMX notifications available for JBoss Cache as well as the cache events to
-         which they correspond. These are the notifications that can be received through the
-         <literal>CacheJmxWrapper</literal>
-         MBean.
-         Each notification represents a single event published by JBoss Cache and provides user data corresponding to
-         the parameters of the event.
-      </para>
-      <table>
-         <title>JBoss Cache MBean Notifications</title>
-         <tgroup cols="3">
-            <thead>
-               <row>
-                  <entry>Notification Type</entry>
-                  <entry>Notification Data</entry>
-                  <entry>CacheListener Event</entry>
-               </row>
-            </thead>
-            <tbody>
-               <row>
-                  <entry>org.jboss.cache.CacheStarted</entry>
-                  <entry>String : cache service name</entry>
-                  <entry>cacheStarted</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.CacheStopped</entry>
-                  <entry>String : cache service name</entry>
-                  <entry>cacheStopped</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.NodeCreated</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeCreated</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.NodeEvicted</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeEvicted</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.NodeLoaded</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeLoaded</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.NodeModifed</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeModifed</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.NodeRemoved</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeRemoved</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.NodeVisited</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeVisited</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.ViewChange</entry>
-                  <entry>String : view</entry>
-                  <entry>ViewChange</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.NodeActivate</entry>
-                  <entrytbl cols="1">
-                     <tbody>
-                        <row>
-                           <entry rowsep="0">Object[0]=String: fqn</entry>
-                        </row>
-                        <row>
-                           <entry>Object[1]=Boolean: pre</entry>
-                        </row>
-                     </tbody>
-                  </entrytbl>
-                  <entry>NodeActivate</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.NodeEvict</entry>
-                  <entrytbl cols="1">
-                     <tbody>
-                        <row>
-                           <entry rowsep="0">Object[0]=String: fqn</entry>
-                        </row>
-                        <row>
-                           <entry>Object[1]=Boolean: pre</entry>
-                        </row>
-                     </tbody>
-                  </entrytbl>
-                  <entry>NodeEvict</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.NodeModify</entry>
-                  <entrytbl cols="1">
-                     <tbody>
-                        <row>
-                           <entry rowsep="0">Object[0]=String: fqn</entry>
-                        </row>
-                        <row>
-                           <entry rowsep="0">Object[1]=Boolean: pre</entry>
-                        </row>
-                        <row>
-                           <entry>Object[2]=Boolean: isLocal</entry>
-                        </row>
-                     </tbody>
-                  </entrytbl>
-                  <entry>NodeModify</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.NodePassivate</entry>
-                  <entrytbl cols="1">
-                     <tbody>
-                        <row>
-                           <entry rowsep="0">Object[0]=String: fqn</entry>
-                        </row>
-                        <row>
-                           <entry>Object[1]=Boolean: pre</entry>
-                        </row>
-                     </tbody>
-                  </entrytbl>
-                  <entry>NodePassivate</entry>
-               </row>
-               <row>
-                  <entry>org.jboss.cache.NodeRemove</entry>
-                  <entrytbl cols="1">
-                     <tbody>
-                        <row>
-                           <entry rowsep="0">Object[0]=String: fqn</entry>
-                        </row>
-                        <row>
-                           <entry rowsep="0">Object[1]=Boolean: pre</entry>
-                        </row>
-                        <row>
-                           <entry>Object[2]=Boolean: isLocal</entry>
-                        </row>
-                     </tbody>
-                  </entrytbl>
-                  <entry>NodeRemove</entry>
-               </row>
-            </tbody>
-         </tgroup>
-      </table>
-   </section>
-</chapter>
\ No newline at end of file

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/preface.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/preface.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/preface.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,48 +0,0 @@
-<preface id="preface">
-   <title>Preface</title>
-
-   <para>
-      This is the official JBoss Cache user guide. Along with its accompanying documents (an FAQ, a tutorial and a
-      whole set of documents on PojoCache), this is freely available on the JBoss Cache <ulink url="http://labs.jboss.com/jbosscache">documentation site.</ulink>
-   </para>
-   <para>
-      When used, JBoss Cache refers to JBoss Cache Core, a tree-structured, clustered, transactional cache.
-      Pojo Cache, also a part of the JBoss Cache distribution, is documented separately. (Pojo Cache is a cache that
-      deals with Plain Old Java Objects, complete with object relationships, with the ability to cluster such pojos
-      while maintaining their relationships. Please see the Pojo Cache documentation for more information about this.)
-   </para>
-
-   <para>
-      This book is targeted at both developers wishing to use JBoss Cache as a clustering and caching library in
-      their codebase, as well as people who wish to "OEM" JBoss Cache by building on and extending its features. As
-      such,
-      this book is split into two major sections - one detailing the "User" API and the other going much deeper into
-      specialist topics and the JBoss Cache architecture.
-   </para>
-
-   <para>
-      In general, a good knowledge of the Java programming language along with a strong appreciation and understanding
-      of transactions and concurrent threads is necessary. No prior knowledge of JBoss Application Server is expected
-      or required.
-   </para>
-
-   <para>
-      For further discussion, use the
-      <ulink url="http://www.jboss.com/index.html?module=bb&amp;op=viewforum&amp;f=157">user forum</ulink>
-      linked on the JBoss Cache <ulink url="http://labs.jboss.com/jbosscache">website.</ulink>  We also provide a mechanism for
-      tracking bug reports and feature requests on the JBoss Cache <ulink url="http://jira.jboss.com/jira/browse/JBCACHE">JIRA issue tracker.</ulink>
-
-      If you are interested in the development of JBoss Cache or in translating this documentation into other languages,
-      we'd love
-      to hear from you. Please post a message on the
-      <ulink url="http://www.jboss.com/index.html?module=bb&amp;op=viewforum&amp;f=157">user forum</ulink>
-      or contact us by using the JBoss Cache <ulink url="https://lists.jboss.org/mailman/listinfo/jbosscache-dev">developer mailing list.</ulink>
-   </para>
-
-   <para>
-      This book is specifically targeted at the JBoss Cache release of the same version number. It may not apply to
-      older or newer releases of JBoss Cache. It is important that you use the documentation appropriate to the version
-      of JBoss Cache you intend to use.
-   </para>
-
-</preface>
\ No newline at end of file

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/replication.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/replication.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/replication.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,730 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="clustering">
-   <title>Clustering</title>
-
-   <para>This chapter talks about aspects around clustering JBoss Cache.</para>
-
-   <section>
-      <title>Cache Replication Modes</title>
-
-      <para>JBoss Cache can be configured to be either local (standalone) or
-         clustered. If in a cluster, the cache can be configured to replicate
-         changes, or to invalidate changes. A detailed discussion on this
-         follows.
-      </para>
-
-      <section>
-         <title>Local Mode</title>
-
-         <para>Local caches don't join a cluster and don't communicate with other
-            caches in a cluster. Therefore their elements don't need to be
-            serializable - however, we recommend making them serializable, enabling
-            a user to change the cache mode at any time. The dependency on the
-            JGroups library is still there, although a JGroups channel is not
-            started.
-         </para>
-      </section>
-
-      <section>
-         <title>Replicated Caches</title>
-
-         <para>Replicated caches replicate all changes to some or all of the other cache
-            instances in the cluster. Replication can either happen after each
-            modification (no transactions), or at the end of a transaction (commit
-            time).
-         </para>
-
-         <para>Replication can be synchronous or asynchronous . Use of either one
-            of the options is application dependent. Synchronous replication blocks
-            the caller (e.g. on a
-            <literal>put()</literal>
-            ) until the modifications
-            have been replicated successfully to all nodes in a cluster.
-            Asynchronous replication performs replication in the background (the
-            <literal>put()</literal>
-            returns immediately). JBoss Cache also offers a
-            replication queue, where modifications are replicated periodically (i.e.
-            interval-based), or when the queue size exceeds a number of elements, or
-            a combination thereof.
-         </para>
-
-         <para>Asynchronous replication is faster (no caller blocking), because
-            synchronous replication requires acknowledgments from all nodes in a
-            cluster that they received and applied the modification successfully
-            (round-trip time). However, when a synchronous replication returns
-            successfully, the caller knows for sure that all modifications have been
-            applied to all cache instances, whereas this is not be the case with asynchronous
-            replication. With asynchronous replication, errors are simply written to
-            a log. Even when using transactions, a transaction may succeed but
-            replication may not succeed on all cache instances.
-         </para>
-
-         <section id="replication.tx">
-            <title>Replicated Caches and Transactions</title>
-
-            <para>When using transactions, replication only occurs at the
-               transaction boundary - i.e., when a transaction commits. This results
-               in minimising replication traffic since a single modification is
-               broadcast rather than a series of individual modifications, and can be
-               a lot more efficient than not using transactions. Another effect of
-               this is that if a transaction were to roll back, nothing is broadcast
-               across a cluster.
-            </para>
-
-            <para>Depending on whether you are running your cluster in
-               asynchronous or synchronous mode, JBoss Cache will use either a single
-               phase or
-               <ulink
-                     url="http://en.wikipedia.org/wiki/Two-phase_commit_protocol">two phase
-                  commit
-               </ulink>
-               protocol, respectively.
-            </para>
-
-            <section>
-               <title>One Phase Commits</title>
-
-               <para>Used when your cache mode is REPL_ASYNC. All modifications are
-                  replicated in a single call, which instructs remote caches to apply
-                  the changes to their local in-memory state and commit locally.
-                  Remote errors/rollbacks are never fed back to the originator of the
-                  transaction since the communication is asynchronous.
-               </para>
-            </section>
-
-            <section>
-               <title>Two Phase Commits</title>
-
-               <para>Used when your cache mode is REPL_SYNC. Upon committing your
-                  transaction, JBoss Cache broadcasts a prepare call, which carries
-                  all modifications relevant to the transaction. Remote caches then
-                  acquire local locks on their in-memory state and apply the
-                  modifications. Once all remote caches respond to the prepare call,
-                  the originator of the transaction broadcasts a commit. This
-                  instructs all remote caches to commit their data. If any of the
-                  caches fail to respond to the prepare phase, the originator
-                  broadcasts a rollback.
-               </para>
-
-               <para>Note that although the prepare phase is synchronous, the
-                  commit and rollback phases are asynchronous. This is because
-                  <ulink
-                        url="http://java.sun.com/products/jta/">Sun's JTA
-                     specification
-                  </ulink>
-                  does not specify how transactional resources
-                  should deal with failures at this stage of a transaction; and other
-                  resources participating in the transaction may have indeterminate
-                  state anyway. As such, we do away with the overhead of synchronous
-                  communication for this phase of the transaction. That said, they can
-                  be forced to be synchronous using the
-                  <literal>SyncCommitPhase</literal>
-                  and
-                  <literal>SyncRollbackPhase</literal>
-                  configuration
-                  attributes.
-               </para>
-            </section>
-         </section>
-
-         <section id="br">
-            <title>Buddy Replication</title>
-
-            <para>Buddy Replication allows you to suppress replicating your data
-               to all instances in a cluster. Instead, each instance picks one or
-               more 'buddies' in the cluster, and only replicates to these specific
-               buddies. This greatly helps scalability as there is no longer a memory
-               and network traffic impact every time another instance is added to a
-               cluster.
-            </para>
-
-            <para>One of the most common use cases of Buddy Replication is when a
-               replicated cache is used by a servlet container to store HTTP session
-               data. One of the pre-requisites to buddy replication working well and
-               being a real benefit is the use of
-               <emphasis>session
-                  affinity
-               </emphasis>
-               , more casually known as
-               <emphasis>sticky
-                  sessions
-               </emphasis>
-               in HTTP session replication speak. What this means
-               is that if certain data is frequently accessed, it is desirable that
-               this is always accessed on one instance rather than in a round-robin
-               fashion as this helps the cache cluster optimise how it chooses
-               buddies, where it stores data, and minimises replication
-               traffic.
-            </para>
-
-            <para>If this is not possible, Buddy Replication may prove to be more
-               of an overhead than a benefit.
-            </para>
-
-            <section>
-               <title>Selecting Buddies</title>
-
-               <figure>
-                  <title>BuddyLocator</title>
-
-                  <mediaobject>
-                     <imageobject>
-                        <imagedata fileref="BuddyReplication.png"/>
-                     </imageobject>
-                  </mediaobject>
-               </figure>
-
-               <para>Buddy Replication uses an instance of a
-                  <literal>BuddyLocator</literal>
-                  which contains the logic used to
-                  select buddies in a network. JBoss Cache currently ships with a
-                  single implementation,
-                  <literal>NextMemberBuddyLocator</literal>
-                  ,
-                  which is used as a default if no implementation is provided. The
-                  <literal>NextMemberBuddyLocator</literal>
-                  selects the next member in
-                  the cluster, as the name suggests, and guarantees an even spread of
-                  buddies for each instance.
-               </para>
-
-               <para>The
-                  <literal>NextMemberBuddyLocator</literal>
-                  takes in 2
-                  parameters, both optional.
-                  <itemizedlist>
-                     <listitem>
-
-
-                        <literal>numBuddies</literal>
-
-                        - specifies how many buddies each instance should pick to back its data onto. This defaults to
-                        1.
-                     </listitem>
-
-                     <listitem>
-
-
-                        <literal>ignoreColocatedBuddies</literal>
-
-                        - means that each instance will
-
-                        <emphasis>try</emphasis>
-
-                        to select a buddy on a different physical host. If not able to do so though, it will fall back
-                        to colocated instances. This defaults to
-
-                        <literal>true</literal>
-
-                        .
-                     </listitem>
-                  </itemizedlist>
-               </para>
-            </section>
-
-            <section>
-               <title>BuddyPools</title>
-
-               <para>Also known as
-                  <emphasis>replication groups</emphasis>
-                  , a buddy
-                  pool is an optional construct where each instance in a cluster may
-                  be configured with a buddy pool name. Think of this as an 'exclusive
-                  club membership' where when selecting buddies,
-                  <literal>BuddyLocator</literal>
-                  s that support buddy pools would try
-                  and select buddies sharing the same buddy pool name. This allows
-                  system administrators a degree of flexibility and control over how
-                  buddies are selected. For example, a sysadmin may put two instances
-                  on two separate physical servers that may be on two separate
-                  physical racks in the same buddy pool. So rather than picking an
-                  instance on a different host on the same rack,
-                  <literal>BuddyLocator</literal>
-                  s would rather pick the instance in
-                  the same buddy pool, on a separate rack which may add a degree of
-                  redundancy.
-               </para>
-            </section>
-
-            <section>
-               <title>Failover</title>
-
-               <para>In the unfortunate event of an instance crashing, it is
-                  assumed that the client connecting to the cache (directly or
-                  indirectly, via some other service such as HTTP session replication)
-                  is able to redirect the request to any other random cache instance
-                  in the cluster. This is where a concept of Data Gravitation comes
-                  in.
-               </para>
-
-               <para>Data Gravitation is a concept where if a request is made on a
-                  cache in the cluster and the cache does not contain this
-                  information, it asks other instances in the cluster for the
-                  data. In other words, data is lazily transferred, migrating
-                  <emphasis>only</emphasis>
-                  when other nodes ask for it. This strategy
-                  prevents a network storm effect where lots of data is pushed around
-                  healthy nodes because only one (or a few) of them die.
-               </para>
-
-               <para>If the data is not found in the primary section of some node,
-                  it would (optionally) ask other instances to check in the backup
-                  data they store for other caches.
-                  This means that even if a cache containing your session dies, other
-                  instances will still be able to access this data by asking the cluster
-                  to search through their backups for this data.
-               </para>
-
-               <para>Once located, this data is transferred to the instance
-                  which requested it and is added to this instance's data tree.
-                  The data is then (optionally) removed from all other instances
-                  (and backups) so that if session affinity is used, the affinity
-                  should now be to this new cache instance which has just
-                  <emphasis>taken
-                     ownership
-                  </emphasis>
-                  of this data.
-               </para>
-
-               <para>Data Gravitation is implemented as an interceptor. The
-                  following (all optional) configuration properties pertain to data
-                  gravitation.
-                  <itemizedlist>
-                     <listitem>
-
-
-                        <literal>dataGravitationRemoveOnFind</literal>
-
-                        - forces all remote caches that own the data or hold backups for the data to remove that data,
-                        thereby making the requesting cache the new data owner. This removal, of course, only happens
-                        after the new owner finishes replicating data to its buddy. If set to
-
-                        <literal>false</literal>
-
-                        an evict is broadcast instead of a remove, so any state persisted in cache loaders will remain.
-                        This is useful if you have a shared cache loader configured. Defaults to
-
-                        <literal>true</literal>
-
-                        .
-                     </listitem>
-
-                     <listitem>
-
-
-                        <literal>dataGravitationSearchBackupTrees</literal>
-
-                        - Asks remote instances to search through their backups as well as main data trees. Defaults to
-
-                        <literal>true</literal>
-
-                        . The resulting effect is that if this is
-
-                        <literal>true</literal>
-
-                        then backup nodes can respond to data gravitation requests in addition to data owners.
-                     </listitem>
-
-                     <listitem>
-
-
-                        <literal>autoDataGravitation</literal>
-
-                        - Whether data gravitation occurs for every cache miss. By default this is set to
-
-                        <literal>false</literal>
-
-                        to prevent unnecessary network calls. Most use cases will know when it may need to gravitate
-                        data and will pass in an
-
-                        <literal>Option</literal>
-
-                        to enable data gravitation on a per-invocation basis. If
-
-                        <literal>autoDataGravitation</literal>
-
-                        is
-
-                        <literal>true</literal>
-
-                        this
-
-                        <literal>Option</literal>
-
-                        is unnecessary.
-                     </listitem>
-                  </itemizedlist>
-               </para>
-            </section>
-
-            <section>
-               <title>Configuration</title>
-
-               <para>
-                  <programlisting>
-                     <![CDATA[
-<!-- Buddy Replication config -->
-<attribute name="BuddyReplicationConfig">
-   <config>
-
-      <!-- Enables buddy replication. This is the ONLY mandatory configuration element here. -->
-      <buddyReplicationEnabled>true</buddyReplicationEnabled>
-
-      <!-- These are the default values anyway -->
-      <buddyLocatorClass>org.jboss.cache.buddyreplication.NextMemberBuddyLocator</buddyLocatorClass>
-
-      <!--  numBuddies is the number of backup nodes each node maintains. ignoreColocatedBuddies means
-            that each node will *try* to select a buddy on a different physical host. If not able to do so though,
-            it will fall back to colocated nodes. -->
-      <buddyLocatorProperties>
-         numBuddies = 1
-         ignoreColocatedBuddies = true
-      </buddyLocatorProperties>
-
-      <!-- A way to specify a preferred replication group. If specified, we try and pick a buddy which shares
-           the same pool name (falling back to other buddies if not available). This allows the sysdmin to
-           hint at backup buddies are picked, so for example, nodes may be hinted topick buddies on a different
-           physical rack or power supply for added fault tolerance. -->
-      <buddyPoolName>myBuddyPoolReplicationGroup</buddyPoolName>
-
-      <!-- Communication timeout for inter-buddy group organisation messages (such as assigning to and
-           removing from groups, defaults to 1000. -->
-      <buddyCommunicationTimeout>2000</buddyCommunicationTimeout>
-
-      <!-- Whether data is removed from old owners when gravitated to a new owner. Defaults to true. -->
-      <dataGravitationRemoveOnFind>true</dataGravitationRemoveOnFind>
-
-      <!-- Whether backup nodes can respond to data gravitation requests, or only the data owner is
-           supposed to respond.  Defaults to true. -->
-      <dataGravitationSearchBackupTrees>true</dataGravitationSearchBackupTrees>
-
-      <!-- Whether all cache misses result in a data gravitation request. Defaults to false, requiring
-           callers to enable data gravitation on a per-invocation basis using the Options API. -->
-      <autoDataGravitation>false</autoDataGravitation>
-
-   </config>
-</attribute>
-
-]]>
-                  </programlisting>
-               </para>
-            </section>
-         </section>
-      </section>
-   </section>
-
-   <section>
-      <title>Invalidation</title>
-
-      <para>If a cache is configured for invalidation rather than replication,
-         every time data is changed in a cache other caches in the cluster receive
-         a message informing them that their data is now stale and should be
-         evicted from memory. Invalidation, when used with a shared cache loader
-         (see chapter on Cache Loaders) would cause remote caches to refer to the
-         shared cache loader to retrieve modified data. The benefit of this is
-         twofold: network traffic is minimised as invalidation messages are very
-         small compared to replicating updated data, and also that other caches in
-         the cluster look up modified data in a lazy manner, only when
-         needed.
-      </para>
-
-      <para>Invalidation messages are sent after each modification (no
-         transactions), or at the end of a transaction, upon successful commit.
-         This is usually more efficient as invalidation messages can be optimised
-         for the transaction as a whole rather than on a per-modification
-         basis.
-      </para>
-
-      <para>Invalidation too can be synchronous or asynchronous, and just as in
-         the case of replication, synchronous invalidation blocks until all caches
-         in the cluster receive invalidation messages and have evicted stale data
-         while asynchronous invalidation works in a 'fire-and-forget' mode, where
-         invalidation messages are broadcast but doesn't block and wait for
-         responses.
-      </para>
-   </section>
-
-   <section>
-      <title>State Transfer</title>
-
-      <para>
-         <emphasis>State Transfer</emphasis>
-         refers to the process by which a
-         JBoss Cache instance prepares itself to begin providing a service by
-         acquiring the current state from another cache instance and integrating
-         that state into its own state.
-      </para>
-
-      <section>
-         <title>State Transfer Types</title>
-
-         <para>There are three divisions of state transfer types depending on a
-            point of view related to state transfer. First, in the context of
-            particular state transfer implementation, the underlying plumbing, there
-            are two starkly different state transfer types: byte array and streaming
-            based state transfer. Second, state transfer can be full or partial
-            state transfer depending on a subtree being transferred. Entire cache
-            tree transfer represents full transfer while transfer of a particular
-            subtree represents partial state transfer. And finally state transfer
-            can be "in-memory" and "persistent" transfer depending on a particular
-            use of cache.
-         </para>
-      </section>
-
-      <section>
-         <title>Byte array and streaming based state transfer</title>
-
-         <para>Byte array based transfer was a default and only transfer
-            methodology for cache in all previous releases up to 2.0. Byte array
-            based transfer loads entire state transferred into a byte array and
-            sends it to a state receiving member. Major limitation of this approach
-            is that the state transfer that is very large (&gt;1GB) would likely
-            result in OutOfMemoryException. Streaming state transfer provides an
-            InputStream to a state reader and an OutputStream to a state writer.
-            OutputStream and InputStream abstractions enable state transfer in byte
-            chunks thus resulting in smaller memory requirements. For example, if
-            application state is represented as a tree whose aggregate size is 1GB,
-            rather than having to provide a 1GB byte array streaming state transfer
-            transfers the state in chunks of N bytes where N is user
-            configurable.
-         </para>
-
-         <para>Byte array and streaming based state transfer are completely API
-            transparent, interchangeable, and statically configured through a
-            standard cache configuration XML file. Refer to JGroups documentation on
-            how to change from one type of transfer to another.
-         </para>
-      </section>
-
-      <section>
-         <title>Full and partial state transfer</title>
-
-         <para>If either in-memory or persistent state transfer is enabled, a
-            full or partial state transfer will be done at various times, depending
-            on how the cache is used. "Full" state transfer refers to the transfer
-            of the state related to the entire tree -- i.e. the root node and all
-            nodes below it. A "partial" state transfer is one where just a portion
-            of the tree is transferred -- i.e. a node at a given Fqn and all nodes
-            below it.
-         </para>
-
-         <para>If either in-memory or persistent state transfer is enabled, state
-            transfer will occur at the following times:
-         </para>
-
-         <orderedlist>
-            <listitem>
-               <para>Initial state transfer. This occurs when the cache is first
-                  started (as part of the processing of the
-                  <literal>start()</literal>
-                  method). This is a full state transfer. The state is retrieved from
-                  the cache instance that has been operational the longest.
-                  <footnote>
-                     <para>The longest operating cache instance is always, in JGroups
-                        terms, the coordinator.
-                     </para>
-                  </footnote>
-                  If there is any problem receiving or integrating the state, the cache
-                  will not start.
-               </para>
-
-               <para>Initial state transfer will occur unless:</para>
-
-               <orderedlist>
-                  <listitem>
-                     <para>The cache's
-                        <literal>InactiveOnStartup</literal>
-                        property
-                        is
-                        <literal>true</literal>
-                        . This property is used in
-                        conjunction with region-based marshalling.
-                     </para>
-                  </listitem>
-
-                  <listitem>
-                     <para>Buddy replication is used. See below for more on state
-                        transfer with buddy replication.
-                     </para>
-                  </listitem>
-               </orderedlist>
-            </listitem>
-
-            <listitem>
-               <para>Partial state transfer following region activation. When
-                  region-based marshalling is used, the application needs to register
-                  a specific class loader with the cache. This class loader is used
-                  to unmarshall the state for a specific region (subtree) of the cache.
-               </para>
-
-               <para>After registration, the application calls
-                  <literal>cache.getRegion(fqn, true).activate()</literal>
-                  ,
-                  which initiates a partial state transfer of the relevant subtree's
-                  state. The request is first made to the oldest cache instance in the
-                  cluster. However, if that instance responds with no state, it is then
-                  requested from each instance in turn until one either provides state
-                  or all instances have been queried.
-               </para>
-
-               <para>Typically when region-based marshalling is used, the cache's
-                  <literal>InactiveOnStartup</literal>
-                  property is set to
-                  <literal>true</literal>
-                  . This suppresses initial state transfer,
-                  which would fail due to the inability to deserialize the transferred
-                  state.
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>Buddy replication. When buddy replication is used, initial
-                  state transfer is disabled. Instead, when a cache instance joins the
-                  cluster, it becomes the buddy of one or more other instances, and
-                  one or more other instances become its buddy. Each time an instance
-                  determines it has a new buddy providing backup for it, it pushes
-                  it's current state to the new buddy. This "pushing" of state to the
-                  new buddy is slightly different from other forms of state transfer,
-                  which are based on a "pull" approach (i.e. recipient asks for and
-                  receives state). However, the process of preparing and integrating
-                  the state is the same.
-               </para>
-
-               <para>This "push" of state upon buddy group formation only occurs if
-                  the
-                  <literal>InactiveOnStartup</literal>
-                  property is set to
-                  <literal>false</literal>
-                  . If it is
-                  <literal>true</literal>
-                  , state
-                  transfer amongst the buddies only occurs when the application
-                  activates the region on the various members of the group.
-               </para>
-
-               <para>Partial state transfer following a region activation call is
-                  slightly different in the buddy replication case as well. Instead of
-                  requesting the partial state from one cache instance, and trying all
-                  instances until one responds, with buddy replication the instance
-                  that is activating a region will request partial state from each
-                  instance for which it is serving as a backup.
-               </para>
-            </listitem>
-         </orderedlist>
-      </section>
-
-      <section>
-         <title>Transient ("in-memory") and persistent state transfer</title>
-
-         <para>The state that is acquired and integrated can consist of two basic
-            types:
-         </para>
-
-         <orderedlist>
-            <listitem>
-               <para>"Transient" or "in-memory" state. This consists of the actual
-                  in-memory state of another cache instance - the contents of the
-                  various in-memory nodes in the cache that is providing state are
-                  serialized and transferred; the recipient deserializes the data,
-                  creates corresponding nodes in its own in-memory tree, and populates
-                  them with the transferred data.
-               </para>
-
-               <para>"In-memory" state transfer is enabled by setting the cache's
-                  <literal>FetchInMemoryState</literal>
-                  configuration attribute to
-                  <literal>true</literal>
-                  .
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>"Persistent" state. Only applicable if a non-shared cache
-                  loader is used. The state stored in the state-provider cache's
-                  persistent store is deserialized and transferred; the recipient
-                  passes the data to its own cache loader, which persists it to the
-                  recipient's persistent store.
-               </para>
-
-               <para>"Persistent" state transfer is enabled by setting a cache
-                  loader's
-                  <literal>fetchPersistentState</literal>
-                  attribute to
-                  <literal>true</literal>
-                  . If multiple cache loaders are configured
-                  in a chain, only one can have this property set to true; otherwise
-                  you will get an exception at startup.
-               </para>
-
-               <para>Persistent state transfer with a shared cache loader does not
-                  make sense, as the same persistent store that provides the data will
-                  just end up receiving it. Therefore, if a shared cache loader is
-                  used, the cache will not allow a persistent state transfer even if a
-                  cache loader has
-                  <literal>fetchPersistentState</literal>
-                  set to
-                  <literal>true</literal>
-                  .
-               </para>
-            </listitem>
-         </orderedlist>
-
-         <para>Which of these types of state transfer is appropriate depends on
-            the usage of the cache.
-         </para>
-
-         <orderedlist>
-            <listitem>
-               <para>If a write-through cache loader is used, the current cache
-                  state is fully represented by the persistent state. Data may have
-                  been evicted from the in-memory state, but it will still be in the
-                  persistent store. In this case, if the cache loader is not shared,
-                  persistent state transfer is used to ensure the new cache has the
-                  correct state. In-memory state can be transferred as well if the
-                  desire is to have a "hot" cache -- one that has all relevant data in
-                  memory when the cache begins providing service. (Note that the
-                  <literal><![CDATA[<cacheloader><preload>]]></literal>
-                  element in the
-                  <literal>CacheLoaderConfig</literal>
-                  configuration parameter can be used as well to
-                  provide a "warm" or "hot" cache without requiring an in-memory state
-                  transfer. This approach somewhat reduces the burden on the cache
-                  instance providing state, but increases the load on the persistent
-                  store on the recipient side.)
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>If a cache loader is used with passivation, the full
-                  representation of the state can only be obtained by combining the
-                  in-memory (i.e. non-passivated) and persistent (i.e. passivated)
-                  states. Therefore an in-memory state transfer is necessary. A
-                  persistent state transfer is necessary if the cache loader is not
-                  shared.
-               </para>
-            </listitem>
-
-            <listitem>
-               <para>If no cache loader is used and the cache is solely a
-                  write-aside cache (i.e. one that is used to cache data that can also
-                  be found in a persistent store, e.g. a database), whether or not
-                  in-memory state should be transferred depends on whether or not a
-                  "hot" cache is desired.
-               </para>
-            </listitem>
-         </orderedlist>
-      </section>
-      <section>
-         <title>Configuring State Transfer</title>
-         <para>
-            To ensure state transfer behaves as expected, it is important that all nodes in the cluster are configured
-            with
-            the same settings for persistent and transient state. This is because byte array based transfers, when
-            requested,
-            rely only on the requester's configuration while stream based transfers rely on both the requester and
-            sender's
-            configuration, and this is expected to be identical.
-         </para>
-      </section>
-   </section>
-</chapter>

Added: pojo/trunk/src/main/docbook/userguide/en/modules/term.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/term.xml	                        (rev 0)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/term.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -0,0 +1,127 @@
+<chapter id="term">
+
+   <title>Terminology</title>
+
+   <sect1 id="overview" revision="1">
+      <title>Overview</title>
+
+      <para>
+         The section lists some basic terminology that will be used throughout this guide.
+      </para>
+
+      <para>
+
+         <variablelist spacing="compact">
+            <varlistentry>
+               <term>Aop</term>
+               <listitem>
+                  <para>
+                     Aspect-Oriented Programming (AOP) is a new paradigm that allows you to organize
+                     and layer your software applications in ways that are impossible with traditional
+                     object-oriented approaches. Aspects allow you to transparently glue functionality together
+                     so that you can have a more layered design. AOP allows you to intercept any event in a Java
+                     program and trigger functionality based on those events.
+                  </para>
+               </listitem>
+            </varlistentry>
+
+            <varlistentry>
+               <term>JBoss Aop</term>
+               <listitem>
+                  <para>
+                     JBoss Aop is an open-source Aop framework library developed by JBoss. It is 100% Java based and can be run
+                     either
+                     as a standalone or inside an application server environment. More details can be found at
+                     www.jboss.com. PojoCache uses JBoss Aop library in two ways. It uses JBoss Aop firstly for its own
+                     interceptor-based architecture and secondly to realize the fine-grained replication aspects.
+                  </para>
+               </listitem>
+            </varlistentry>
+
+            <varlistentry>
+               <term>Dynamic Aop</term>
+               <listitem>
+                  <para>
+                     Dynamic Aop is a feature of JBoss Aop that provides a hook so that a caller can insert event
+                     interception on the POJO at runtime. PojoCache currently uses this feature to perform
+                     field level interception.
+                  </para>
+               </listitem>
+            </varlistentry>
+
+            <varlistentry>
+               <term>JGroups</term>
+               <listitem>
+                  <para>
+                     JGroups is a reliable Java group messaging library that is open-source and LGPL. In addition to reliable
+                     messaging transport, it also performs group membership management. It has been a de facto
+                     replication layer used by numerous open-source projects for clustering purposes. It is also used by
+                     JBossCache for replication layer.
+                  </para>
+               </listitem>
+            </varlistentry>
+
+            <varlistentry>
+               <term>Core Cache</term>
+               <listitem>
+                  <para>
+                     Core Cache is a tree-structured, clustered, transactional cache. Simple and Serializable java types 
+                     are stored as key/value pairs on nodes within the tree using a collection-like API. It also provides
+                     a number of configurable aspects such as node locking strategies, data isolation, eviction, and so on.
+                     POJO Cache leverages Core Cache as the underlying data-store in order to provide the same capabilities.
+                  </para>
+               </listitem>
+            </varlistentry>
+
+            <varlistentry>
+               <term>POJO</term>
+               <listitem>
+                  <para>
+                     Plain old Java object.
+                  </para>
+               </listitem>
+            </varlistentry>
+
+            <varlistentry>
+               <term>Annotation</term>
+               <listitem>
+                  <para>
+                     Annotation is a new feature in JDK5.0. It introduces metadata along side the Java code that can
+                     be accessed at runtime. PojoCache currently uses JDK50 annotation to support POJO
+                     instrumentation (JDK1.4 annotation has been deprecated since release 2.0).
+                  </para>
+               </listitem>
+            </varlistentry>
+
+            <varlistentry>
+               <term>Prepare</term>
+               <listitem>
+                  <para>
+                     Prepare is a keyword in JBoss Aop pointcut language used to specify which POJO needs to be
+                     instrumented. It appears in a <literal>pojocache-aop.xml</literal> file. However, if you can
+                     use annotation to specify the POJO instrumentation, there is no
+                     need for a <literal>pojocache-aop.xml</literal> listing. Note that
+                   When a POJO is declared properly either through the xml or annotation, we consider it "aspectized".
+                  </para>
+               </listitem>
+            </varlistentry>
+
+            <varlistentry>
+               <term>Instrumentation</term>
+               <listitem>
+                  <para>
+                     Instrumentation is an Aop process that basically pre-processes (e.g., performing byte-code
+                     weaving)
+                     on the POJO. There are two modes: compile- or load-time. Compile-time weaving can be done with
+                     an Aop precompiler (<literal>aopc</literal>) while load-time is done to specify a special classloader
+                     in the run script.
+                     This step is necessary for an Aop system to intercept events that are interesting to users.
+                  </para>
+               </listitem>
+            </varlistentry>
+         </variablelist>
+      </para>
+   </sect1>
+
+</chapter>
+


Property changes on: pojo/trunk/src/main/docbook/userguide/en/modules/term.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Deleted: pojo/trunk/src/main/docbook/userguide/en/modules/transactions.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/transactions.xml	2007-08-14 16:34:22 UTC (rev 4250)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/transactions.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -1,345 +0,0 @@
-<chapter id="transactions">
-   <title>Transactions and Concurrency</title>
-   <section>
-      <title>Concurrent Access</title>
-
-      <para>JBoss Cache is a thread safe caching API, and uses its own efficient mechanisms of controlling concurrent
-         access. It uses a pessimistic locking scheme by default for this purpose. Optimistic locking may alternatively
-         be used, and is discussed later.
-      </para>
-
-      <section>
-         <title>Locks</title>
-         <para>Locking is done internally, on a node-level. For example when we
-            want to access "/a/b/c", a lock will be acquired for nodes "a", "b" and
-            "c". When the same transaction wants to access "/a/b/c/d", since we
-            already hold locks for "a", "b" and "c", we only need to acquire a lock
-            for "d".
-         </para>
-         <para>Lock owners are either transactions (call is made within the scope of an existing transaction)
-            or threads (no transaction associated with the call).
-            Regardless, a transaction or a thread is internally transformed into
-            an instance of
-            <literal>GlobalTransaction</literal>
-            , which is used as a globally unique identifier
-            for modifications across a cluster. E.g. when we run a two-phase commit
-            protocol across the cluster, the
-            <literal>GlobalTransaction</literal>
-            uniquely identifies a unit of work across a cluster.
-         </para>
-
-         <para>Locks can be read or write locks. Write locks serialize read and
-            write access, whereas read-only locks only serialize read access. When a
-            write lock is held, no other write or read locks can be acquired. When a
-            read lock is held, others can acquire read locks. However, to acquire
-            write locks, one has to wait until all read locks have been released. When
-            scheduled concurrently, write locks always have precedence over read
-            locks. Note that (if enabled) read locks can be upgraded to write
-            locks.
-         </para>
-
-         <para>Using read-write locks helps in the following scenario: consider a
-            tree with entries "/a/b/n1" and "/a/b/n2". With write-locks, when Tx1
-            accesses "/a/b/n1", Tx2 cannot access "/a/b/n2" until Tx1 has completed
-            and released its locks. However, with read-write locks this is possible,
-            because Tx1 acquires read-locks for "/a/b" and a read-write lock for
-            "/a/b/n1". Tx2 is then able to acquire read-locks for "/a/b" as well, plus
-            a read-write lock for "/a/b/n2". This allows for more concurrency in
-            accessing the cache.
-         </para>
-      </section>
-
-      <section>
-         <title>Pessimistic locking</title>
-         <para>By default, JBoss Cache uses pessimistic locking. Locking is not exposed directly to user. Instead, a
-            transaction isolation level which provides different locking behaviour is configurable.
-         </para>
-         <section>
-            <title>Isolation levels</title>
-            <para>JBoss Cache supports the following transaction isolation levels, analogous to database ACID isolation
-               levels. A user can configure an instance-wide isolation level of NONE, READ_UNCOMMITTED, READ_COMMITTED,
-               REPEATABLE_READ, or SERIALIZABLE. REPEATABLE_READ is the default isolation level used.
-            </para>
-
-            <orderedlist>
-               <listitem>
-                  <para>NONE. No transaction support is needed. There is no locking at
-                     this level, e.g., users will have to manage the data integrity.
-                     Implementations use no locks.
-                  </para>
-               </listitem>
-
-               <listitem>
-                  <para>READ_UNCOMMITTED. Data can be read anytime while write
-                     operations are exclusive. Note that this level doesn't prevent the
-                     so-called "dirty read" where data modified in Tx1 can be read in Tx2
-                     before Tx1 commits. In other words, if you have the following
-                     sequence,
-                     <programlisting>
-                        <![CDATA[
-   Tx1     Tx2
-    W
-            R
-]]>
-                     </programlisting>
-
-                     using this isolation level will not prevent Tx2 read operation.
-                     Implementations typically use an exclusive lock for writes while reads
-                     don't need to acquire a lock.
-                  </para>
-               </listitem>
-
-               <listitem>
-                  <para>READ_COMMITTED. Data can be read any time as long as there is no
-                     write. This level prevents the dirty read. But it doesn’t prevent the
-                     so-called ‘non-repeatable read’ where one thread reads the data twice
-                     can produce different results. For example, if you have the following
-                     sequence,
-                     <programlisting>
-                        <![CDATA[
-   Tx1     Tx2
-    R
-            W
-    R
-]]>
-                     </programlisting>
-                  </para>
-
-                  <para>where the second read in Tx1 thread will produce different
-                     result.
-                  </para>
-
-                  <para>Implementations usually use a read-write lock; reads succeed
-                     acquiring the lock when there are only reads, writes have to wait
-                     until there are no more readers holding the lock, and readers are
-                     blocked acquiring the lock until there are no more writers holding the
-                     lock. Reads typically release the read-lock when done, so that a
-                     subsequent read to the same data has to re-acquire a read-lock; this
-                     leads to nonrepeatable reads, where 2 reads of the same data might
-                     return different values. Note that, the write only applies regardless
-                     of transaction state (whether it has been committed or not).
-                  </para>
-               </listitem>
-
-               <listitem>
-                  <para>REPEATABLE_READ. Data can be read while there is no write and
-                     vice versa. This level prevents "non-repeatable read" but it does not
-                     completely prevent the so-called "phantom read" where new data can be
-                     inserted into the tree from another transaction. Implementations
-                     typically use a read-write lock. This is the default isolation level used.
-                  </para>
-               </listitem>
-
-               <listitem>
-                  <para>SERIALIZABLE. Data access is synchronized with exclusive locks.
-                     Only 1 writer or reader can have the lock at any given time. Locks are
-                     released at the end of the transaction. Regarded as very poor for performance and
-                     thread/transaction concurrency.
-                  </para>
-               </listitem>
-            </orderedlist>
-
-         </section>
-
-         <section>
-            <title>Insertion and Removal of Nodes</title>
-
-            <para>
-               By default, before inserting a new node into the tree or removing an existing node from the
-               tree, JBoss Cache will only attempt to acquire a read lock on the new node's parent node.
-               This approach does not treat child nodes as an integral part of a parent node's state.
-               This approach allows greater concurrency if nodes are frequently added or removed, but
-               at a cost of lesser correctness. For use cases where greater correctness is necessary, JBoss
-               Cache provides a configuration option
-               <literal>LockParentForChildInsertRemove</literal>
-               .
-               If this is set to
-               <literal>true</literal>
-               , insertions and removals of child nodes
-               require the acquisition of a
-               <emphasis>write lock</emphasis>
-               on the parent node.
-            </para>
-         </section>
-      </section>
-
-      <section>
-         <title>Optimistic Locking</title>
-         <para>The motivation for optimistic locking is to improve concurrency. When a lot of threads have a lot of
-            contention for access to the data tree, it can be inefficient to lock portions of the tree - for reading or
-            writing - for the entire duration of a transaction as we do in pessimistic locking. Optimistic locking
-            allows for greater concurrency of threads and transactions by using a technique called data versioning,
-            explained here. Note that isolation levels (if configured) are ignored if optimistic locking is enabled.
-         </para>
-         <section>
-            <title>Architecture</title>
-            <para>Optimistic locking treats all method calls as transactional
-               <footnote>
-                  <para>Because of this requirement, you must always have a transaction manager configured when using
-                     optimistic locking.
-                  </para>
-               </footnote>
-               . Even if you do not invoke a call within the scope of an ongoing transaction, JBoss Cache creates an
-               <emphasis>implicit transaction</emphasis>
-               and commits this transaction when the invocation completes. Each transaction
-               maintains a transaction workspace, which contains a copy of the data used within the transaction.
-            </para>
-            <para>For example, if a transaction calls
-               <literal>cache.getRoot().getChild( Fqn.fromString("/a/b/c") )</literal>
-               ,
-               nodes a, b and c are copied from the main data tree
-               and into the workspace. The data is versioned and all calls in the transaction work on the copy of the
-               data rather than the actual data. When the transaction commits, its workspace is merged back into the
-               underlying tree by matching versions. If there is a version mismatch - such as when the actual data tree
-               has a higher version than the workspace, perhaps if another transaction were to access the same data,
-               change it and commit before the first transaction can finish - the transaction throws a
-               <literal>RollbackException</literal>
-               when committing and the commit fails.
-            </para>
-            <para>Optimistic locking uses the same locks we speak of above, but the locks are only held for a very short
-               duration - at the start of a transaction to build a workspace, and when the transaction commits and has
-               to merge data back into the tree.
-            </para>
-            <para>
-               So while optimistic locking may occasionally fail if version validations fail or may run slightly slower
-               than pessimistic locking due to the inevitable overhead and extra processing of maintaining workspaces,
-               versioned data and validating on commit, it does buy you a near-SERIALIZABLE degree of data integrity
-               while maintaining a very high level of concurrency.
-            </para>
-         </section>
-         <section>
-            <title>Data Versioning</title>
-            <mediaobject>
-               <imageobject>
-                  <imagedata fileref="DataVersions.png" format="PNG"/>
-               </imageobject>
-            </mediaobject>
-            <para>
-               Optimistic locking makes use of the
-               <literal>DataVersion</literal>
-               interface (and an internal and default
-               <literal>DefaultDataVersion</literal>
-               implementation to keep a track of node versioning. In certain cases,
-               where cached data is an in-memory representation of data from an external source such as a database,
-               it makes sense to align the versions used in JBoss Cache with the versions used externally. As such,
-               using the
-               <link linkend="configuration.options">options API</link>
-               , it is possible to set the
-               <literal>DataVersion</literal>
-               you wish to use on a per-invocation basis, allowing you to implement the
-               <literal>DataVersion</literal>
-               interface to hold the versioning information obtained externally before putting your data into the
-               cache.
-            </para>
-         </section>
-         <section>
-            <title>Configuration</title>
-            Optimistic locking is enabled by using the NodeLockingScheme XML attribute, and setting it to "OPTIMISTIC":
-            <programlisting>
-               <![CDATA[
-   ...
-   <!--
-   Node locking scheme:
-   OPTIMISTIC
-   PESSIMISTIC (default)
-   -->
-   <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
-   ...
-   ]]>
-            </programlisting>
-         </section>
-      </section>
-   </section>
-
-
-   <section>
-      <title>Transactional Support</title>
-
-      <para>JBoss Cache can be configured to use and participate in JTA compliant transactions. Alternatively, if
-         transaction support is disabled, it is equivalent to setting AutoCommit to
-         on where modifications are potentially
-         <footnote>
-            <para>Depending on whether interval-based asynchronous replication is used</para>
-         </footnote>
-         replicated after every change (if replication is
-         enabled).
-      </para>
-
-      <para>What JBoss Cache does on every incoming call is:</para>
-      <orderedlist>
-         <listitem>
-            <para>Retrieve the current
-               <literal>javax.transaction.Transaction</literal>
-               associated with the thread
-            </para>
-         </listitem>
-         <listitem>
-            <para>If not already done, register a
-               <literal>javax.transaction.Synchronization</literal>
-               with the transaction manager to be notified when a transaction commits
-               or is rolled back.
-            </para>
-         </listitem>
-      </orderedlist>
-      <para>
-         In order to do this, the cache has to be provided with a 
-         reference to environment's 
-         <literal>javax.transaction.TransactionManager</literal>
-         .  This is usually done by configuring the cache
-         with the class name of an implementation of the
-         <literal>TransactionManagerLookup</literal>
-         interface. When the cache starts, it will create an instance of this
-         class and invoke its <literal>getTransactionManager()</literal>
-         method, which returns a reference to the
-         <literal>TransactionManager</literal>
-         .
-      </para>
-
-      <mediaobject>
-         <imageobject>
-            <imagedata fileref="TransactionLookup.png" format="PNG"/>
-         </imageobject>
-      </mediaobject>
-
-      <para>JBoss Cache ships with
-         <literal>JBossTransactionManagerLookup</literal>
-         and
-         <literal>GenericTransactionManagerLookup</literal>
-         . The
-         <literal>JBossTransactionManagerLookup</literal>
-         is able to bind to a running JBoss AS instance and retrieve a
-         <literal>TransactionManager</literal>
-         while the
-         <literal>GenericTransactionManagerLookup</literal>
-         is able to bind to most popular Java EE application servers and provide the same functionality. A dummy
-         implementation -
-         <literal>DummyTransactionManagerLookup</literal>
-         - is also provided, primarily for unit tests. Being a dummy, this is just for demo and testing purposes and is
-         not recommended for production use.
-      </para>
-      
-      <para>
-         An alternative to configuring a <literal>TransactionManagerLookup</literal>
-         is to programatically inject a reference to the <literal>TransactionManager</literal>
-         into the <literal>Configuration</literal> object's <literal>RuntimeConfig</literal> element:
-      </para>
-      
-      <programlisting>
-         TransactionManager tm = getTransactionManager(); // magic method
-         cache.getConfiguration().getRuntimeConfig().setTransactionManager(tm);         
-      </programlisting>
-      
-      <para>
-         Injecting the <literal>TransactionManager</literal> is the recommended
-         approach when the <literal>Configuration</literal> is built by some sort of
-         IOC container that already has a reference to the TM.
-      </para>
-      
-      <para>When the transaction commits, we initiate either a one- two-phase commit
-         protocol. See
-         <link linkend="replication.tx">replicated caches and transactions</link>
-         for details.
-      </para>
-
-   </section>
-</chapter>

Added: pojo/trunk/src/main/docbook/userguide/en/modules/troubleshooting.xml
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/troubleshooting.xml	                        (rev 0)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/troubleshooting.xml	2007-08-14 19:09:32 UTC (rev 4251)
@@ -0,0 +1,17 @@
+<chapter id="trouble">
+<title>TroubleShooting</title>
+
+   <para>We have maintained a
+      <ulink
+              url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PojoCacheTroubleshooting">PojoCache wiki troubleshooting page</ulink>.
+      Please refer it first. We will keep adding troubleshooting tips there.
+      </para>
+      <para>All the current outstanding issues are documented in
+         <ulink
+                 url="http://jira.jboss.com/jira/secure/BrowseProject.jspa?id=10051">JBossCache
+            Jira page</ulink>
+         . Please check it for details. If you have discovered
+         additional issues, please report it there as well.
+      </para>
+
+</chapter>
\ No newline at end of file


Property changes on: pojo/trunk/src/main/docbook/userguide/en/modules/troubleshooting.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jbosscache-commits mailing list