[jboss-cvs] JBossCache/docs/faq/en ...

Ben Wang bwang at jboss.com
Sat Sep 23 08:44:37 EDT 2006


  User: bwang   
  Date: 06/09/23 08:44:37

  Modified:    docs/faq/en  master.xml
  Log:
  1. Fixed faq format, 2. Created faq-pojo
  
  Revision  Changes    Path
  1.37      +93 -602   JBossCache/docs/faq/en/master.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: master.xml
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/docs/faq/en/master.xml,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -b -r1.36 -r1.37
  --- master.xml	10 Jul 2006 14:50:02 -0000	1.36
  +++ master.xml	23 Sep 2006 12:44:37 -0000	1.37
  @@ -5,8 +5,8 @@
   <article class="faq" lang="en">
     <articleinfo>
       <title>Frequently Asked Questions about JBoss Cache</title>
  -    <releaseinfo>Release 1.4.0 "Jalapeno"</releaseinfo>
  -    <pubdate>July 2006</pubdate>
  +    <releaseinfo>Release 2.0</releaseinfo>
  +    <pubdate>October 2006</pubdate>
   
       <author>
         <firstname>Ben</firstname>
  @@ -41,10 +41,10 @@
   
     <para>These are frequently asked questions regarding JBoss Cache.</para>
   
  -  <qandaset defaultlabel="GeneralInformation">
  +  <qandaset defaultlabel="qanda">
         <title>General Information</title>
         <qandaentry>
  -        <question id="1">
  +        <question id="a1">
             <para>What is JBoss Cache?</para>
           </question>
   
  @@ -59,17 +59,25 @@
             any replication; this is the local mode.</para>
   
             <para>Currently, JBoss Cache consists of two components: a generic cache
  -          (implemented internally as <literal>org.jboss.cache.TreeCache</literal>) and a POJO cache (implemented
  -             internally as <literal>org.jboss.cache.aop.PojoCache</literal>).
  -          <literal>TreeCache</literal> is a tree-structured cache that provides replication and
  -          transaction context, while <literal>PojoCache</literal> extends the functionality of
  -          <literal>TreeCache</literal> but behaves as a true object cache providing transparent
  +          (API as <literal>org.jboss.cache.Cache</literal>) and a POJO cache (API
  +             as <literal>org.jboss.cache.pojo.PojoCache</literal>).
  +          <literal>Cache</literal> is implemented internally as a tree-structured cache that
  +             provides replication and
  +          transaction context, while <literal>PojoCache</literal> uses <literal>Cache</literal> as a
  +             underlying delegate
  +             to provide distributed state replication to behave as a true object cache providing transparent
             and finer-grained object mapping into internal cache.</para>
  +
  +           <para>JBoss Cache is distributed in three different packaing: jboss-cache-core, jboss-cache-pojo,
  +           and jboss-cache-all. The first package only contains the core Cache library for users wish only use
  +           the traiditional generic cache, the second package consists of PojoCache functionality (also
  +           includes the Cache library as well), and the last one consists all libraries plus javadoc and
  +           source codes.</para>
           </answer>
         </qandaentry>
   
         <qandaentry>
  -        <question id="2">
  +        <question id="a2">
             <para>Who are the JBoss Cache developers?</para>
           </question>
   
  @@ -80,7 +88,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="3">
  +        <question id="a3">
             <para>What is the license for JBoss Cache?</para>
           </question>
   
  @@ -90,7 +98,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="4">
  +        <question id="a4">
             <para>Where can I download JBoss Cache?</para>
           </question>
   
  @@ -100,23 +108,20 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="5">
  +        <question id="a5">
             <para>How do I build JBoss Cache from CVS sources?</para>
           </question>
   
           <answer>
             <para>To build, do <literal>sh build.sh
  -          jar</literal>. This will produce <literal>jboss-cache.jar</literal>
  -          in the <literal>dist/lib</literal> directory. Or if you want to
  -          build the standalone package, do <literal>sh build.sh dist</literal>
  -          this will produce
  -          <literal>dist/jboss-cache-dist.zip</literal> Note that you will need to
  +          jar</literal>. This will produce <literal>jboss-cache.jar</literal> and <literal>pojocache.jar</literal>
  +          in the <literal>dist/lib</literal> directory. Note that you will need to
             use JDK 5.0 to build the distribution.  You can still use the binaries you build with J2SE 1.4.x though.</para>
           </answer>
         </qandaentry>
   
         <qandaentry>
  -        <question id="6">
  +        <question id="a6">
             <para>Which JVMs are supported by JBoss Cache?</para>
           </question>
   
  @@ -128,23 +133,7 @@
         </qandaentry>
   
          <qandaentry>
  -         <question id="7">
  -           <para>From JBoss Cache 1.3.0 onwards, there is a new directory <code>lib-50</code>,
  -              what is it?</para>
  -         </question>
  -
  -         <answer>
  -           <para>From JBoss Cache 1.3.0 onwards, we support the use of Java 5 annotations, used by PojoCache.
  -           As a result, there are <code>jboss-aop-jdk50.jar</code> and <code>jboss-cache-jdk50.jar</code> that
  -           are needed to work with the Java 5 annotations. You will need to replace <code>jboss-aop.jar</code>
  -              and <code>jboss-cache.jar</code> in the lib directory with the <code>-jdk50</code> versions if you intend
  -              to use PojoCache, Java 5 and annotations.
  -           </para>
  -         </answer>
  -       </qandaentry>
  -
  -       <qandaentry>
  -         <question id="8">
  +         <question id="a7">
              <para>How do I know the version of JBoss Cache that I am using?</para>
            </question>
   
  @@ -155,7 +144,7 @@
          </qandaentry>
   
         <qandaentry>
  -        <question id="9">
  +        <question id="a9">
             <para>Can I run JBoss Cache outside of JBoss Application
             Server?</para>
           </question>
  @@ -178,7 +167,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="10">
  +        <question id="a10">
             <para>Where can I report bugs or problems?</para>
           </question>
   
  @@ -190,11 +179,11 @@
         </qandaentry>
       </qandaset>
   
  -  <qandaset defaultlabel="TreeCache">
  -      <title>JBoss Cache in general and TreeCache</title>
  +  <qandaset defaultlabel="qanda">
  +      <title>JBoss Cache in general and Cache</title>
   
         <qandaentry>
  -        <question id="11">
  +        <question id="a11">
             <para>How do I deploy JBoss Cache as a MBean service?</para>
           </question>
   
  @@ -210,7 +199,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="12">
  +        <question id="a12">
             <para>How do I know if my JBoss Cache MBean has been deployed?</para>
           </question>
   
  @@ -223,7 +212,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="13">
  +        <question id="a13">
             <para>How do I access the JBoss Cache MBean?</para>
           </question>
   
  @@ -275,7 +264,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="14">
  +        <question id="a14">
             <para>Can I run JBoss Cache on JBoss AS 3.2.x releases?</para>
           </question>
   
  @@ -287,7 +276,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="15">
  +        <question id="a15">
             <para>Can I run multiple JBoss Cache instances on the same VM?</para>
           </question>
   
  @@ -301,7 +290,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="16">
  +        <question id="a16">
             <para>Can TreeCache run as a second level cache inside
             Hibernate?</para>
           </question>
  @@ -318,7 +307,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="17">
  +        <question id="a17">
             <para>What about using PojoCache as a Hibernate cache?</para>
           </question>
   
  @@ -331,7 +320,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="18">
  +        <question id="a18">
             <para>How can I configure JBoss Cache?</para>
           </question>
   
  @@ -343,7 +332,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="19">
  +        <question id="a19">
             <para>In the configuration xml file, there are tags such as
             <literal>class</literal>, <literal> MBean</literal>, etc. What are
             these?</para>
  @@ -359,7 +348,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="20">
  +        <question id="a20">
             <para>What is the difference between the different cache
             modes?</para>
           </question>
  @@ -381,7 +370,7 @@
         </qandaentry>
   
         <qandaentry>
  -         <question id="21">
  +         <question id="a21">
             <para>How does JBoss Cache's replication mechanism work?</para>
           </question>
   
  @@ -401,7 +390,7 @@
         </qandaentry>
   
          <qandaentry>
  -        <question id="22">
  +        <question id="a22">
             <para>I run a 2 node cluster.  If the network dies, do the caches continue to run?</para>
           </question>
   
  @@ -414,7 +403,7 @@
   
   
         <qandaentry>
  -        <question id="23">
  +        <question id="a23">
             <para>Can I plug in library X instead of JGroups to handle remote calls and group communications?</para>
           </question>
   
  @@ -426,7 +415,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="24">
  +        <question id="a24">
             <para>Does the cache need to replicate to every other instance in the cluster?  Isn't this slow if the cluster is large?</para>
           </question>
   
  @@ -441,7 +430,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="25">
  +        <question id="a25">
             <para>If I have the need for different TreeCache properties (e.g.,
             <literal>CacheMode</literal> and <literal>IsolationLevel</literal>), do I simply need to create multiple
             TreeCache instances with the appropriate configuration?</para>
  @@ -455,7 +444,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="26">
  +        <question id="a26">
             <para>Does the Tree Cache config <literal>ClusterName</literal> have
             any relation to the JBoss AS cluster
             <literal>PartitionName</literal>?</para>
  @@ -469,7 +458,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="27">
  +        <question id="a27">
             <para>When using multiple JGroups based components
             [cluster-service.xml, treecache (multiple instances)], what is the
             correct/valid way to configure those components to make sure my
  @@ -487,7 +476,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="28">
  +        <question id="a28">
             <para>Does JBoss Cache currently support cache persistence
             storage?</para>
           </question>
  @@ -499,7 +488,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="29">
  +        <question id="a29">
             <para>Does JBoss Cache currently support cache passivation/ overflow
             to a data store?</para>
           </question>
  @@ -512,7 +501,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="30">
  +        <question id="a30">
             <para>Is JBoss Cache thread safe?</para>
           </question>
   
  @@ -522,7 +511,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="31">
  +        <question id="a31">
             <para>Does JBoss Cache support XA (2PC) transactions now?</para>
           </question>
   
  @@ -534,7 +523,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="32">
  +        <question id="a32">
             <para>Which TransactionManagers are supported by
             JBoss Cache?</para>
           </question>
  @@ -553,7 +542,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="33">
  +        <question id="a33">
             <para>How do I set up the cache to be transactional?</para>
           </question>
   
  @@ -585,7 +574,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="34">
  +        <question id="a34">
             <para>How do I control the cache locking level?</para>
           </question>
   
  @@ -605,7 +594,7 @@
         </qandaentry>
   
   	  <qandaentry>
  -        <question id="35">
  +        <question id="a35">
             <para>How does JBoss Cache lock data for concurrent access?</para>
           </question>
   
  @@ -616,7 +605,7 @@
   
   
   	  <qandaentry>
  -        <question id="36">
  +        <question id="a36">
             <para>How do I enable Optimistic Locking in JBoss Cache?</para>
           </question>
   
  @@ -627,7 +616,7 @@
   
   
         <qandaentry>
  -        <question id="37">
  +        <question id="a37">
             <para>How does the write lock apply to an Fqn node, say,
             "/org/jboss/test"?</para>
           </question>
  @@ -648,7 +637,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="38">
  +        <question id="a38">
             <para>Can I use the cache locking level even without a transaction
             context?</para>
           </question>
  @@ -664,7 +653,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="39">
  +        <question id="a39">
             <para>With replication (REPL_SYNC/REPL_ASYNC) or invalidation (INVALIDATION_SYNC/INVALIDATION_ASYNC), how
             often does the cache broadcast messages over the network?</para>
           </question>
  @@ -681,7 +670,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="40">
  +        <question id="a40">
             <para>How can I do a mass removal?</para>
           </question>
   
  @@ -692,7 +681,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="41">
  +        <question id="a41">
             <para>Can I monitor and manage the JBoss Cache?</para>
           </question>
   
  @@ -702,7 +691,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="42">
  +        <question id="a42">
             <para>Can I disable JBoss Cache management attributes in JBoss Cache 1.3.0?</para>
           </question>
   
  @@ -712,7 +701,9 @@
         </qandaentry>
   
         <qandaentry>
  -          <question id="43">><para>What is jboss-serialization.jar, introduced in JBoss Cache 1.4.x and do I need this?</para></question>
  +          <question id="a43">
  +             <para>What is jboss-serialization.jar, introduced in JBoss Cache 1.4.x and do I need this?</para>
  +             </question>
             <answer><para>jboss-serialization.jar is the <ulink url="http://labs.jboss.org/portal/index.html?ctrl:id=page.default.info&amp;project=serialization">JBoss Serialization</ulink> library, which is much more efficient in terms
             of speed and CPU usage as well as the generated byte stream size than standard Java serialization.  This very
             significantly improves replication performance of custom objects placed in the cache.</para>
  @@ -723,7 +714,7 @@
         </qandaentry>
   
           <qandaentry>
  -          <question id="44">
  +          <question id="a44">
               <para>Can I disable JBoss Serialization and revert back to standard Java serialization?</para>
             </question>
   
  @@ -734,7 +725,7 @@
   
   
         <qandaentry>
  -        <question id="45">
  +        <question id="a45">
             <para>Does JBoss Cache support partitioning?</para>
           </question>
   
  @@ -747,7 +738,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="46">
  +        <question id="a46">
             <para>Does JBoss Cache handle the concept of application classloading
             inside, say, a J2EE container?</para>
           </question>
  @@ -836,7 +827,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="47">
  +        <question id="a47">
             <para>Does JBoss Cache currently support pre-event and post-event
             notification?</para>
           </question>
  @@ -851,7 +842,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="48">
  +        <question id="a48">
             <para>How do I implement a custom listener to listen to <literal>TreeCache</literal>
             events?</para>
           </question>
  @@ -885,531 +876,31 @@
         </qandaentry>
       </qandaset>
   
  -  <qandaset defaultlabel="PojoCache">
  -      <title>PojoCache</title>
  -
  -      <qandaentry>
  -        <question id="49">
  -          <para>What is PojoCache?</para>
  -        </question>
  -
  -        <answer>
  -          <para>PojoCache (currently implemented PojoCache as a sub-class of
  -          TreeCache) is a fine-grained field-level replicated and
  -          transactional POJO (plain old Java object) cache. By POJO, we mean
  -          that the cache: 1) automatically manages object mapping and
  -          relationship for a client under both local and replicated cache
  -          mode, 2) provides support for inheritance relationship between
  -          "aspectized" POJOs. By leveraging the dynamic AOP in JBossAop, it is
  -          able to map a complex object into the cache store, preserve and
  -          manage the object relationship behind the scene. During replication
  -          mode, it performs fine-granularity (i.e., on a per-field basis)
  -          update, and thus has the potential to boost cache performance and
  -          minimize network traffic.</para>
  -
  -          <para>From a user perspective, once your POJO is managed by the
  -          cache, all cache operations are transparent. Therefore, all the
  -          usual in-VM POJO method semantics are still preserved, providing
  -          ease of use. For example, if a POJO has been put in PojoCache (by
  -          calling putObject, for example), then any get/set method will be
  -          intercepted by PojoCache to provide the data from the
  -          cache.</para>
  -        </answer>
  -      </qandaentry>
  -
  -       <qandaentry>
  -         <question id="50">
  -           <para>What's the relationship between PojoCache and TreeCacheAop classes?</para>
  -         </question>
  -
  -         <answer>
  -           <para>Since release 1.4, we have created a new class called PojoCache (to better reflect the
  -              cache nature). The old implementation TreeCacheAop has been deprecated.</para>
  -         </answer>
  -       </qandaentry>
  -
  -       <qandaentry>
  -         <question id="51">
  -           <para>Does PojoCache have all the functional capabilities of
  -           TreeCache?</para>
  -         </question>
  -
  -         <answer>
  -           <para>Yes. PojoCache extends TreeCache so it has all the same
  -           features TreeCache such as cache mode, transaction isolation level,
  -           and eviction policy.</para>
  -         </answer>
  -       </qandaentry>
  -
  -       <qandaentry>
  -         <question id="52">
  -           <para>What is the difference between TreeCache and
  -           PojoCache?</para>
  -         </question>
  -
  -         <answer>
  -           <para>Think of PojoCache as a TreeCache on steroids. :-)
  -           Seriously, both are cache stores-- one is a generic cache and the other other one POJO Cache.
  -              However, while TreeCache only
  -           provides pure object reference storage (e.g., <literal>put(FQN fqn,
  -           Object key, Object value)</literal>), PojoCache goes beyond that
  -           and performs fine-grained field level replication object mapping and
  -           relationship management for a user behind the scenes. As a result,
  -           if you have complex object systems that you would like to cache, you
  -           can have PojoCache manage it for you. You simply treat your
  -           object systems as they are residing in-memory, e.g., use your
  -           regular POJO methods without worrying about cache management.
  -           Furthermore, this is true in replication mode as well.</para>
  -         </answer>
  -       </qandaentry>
  -
  -        <qandaentry>
  -          <question id="53">
  -            <para>What are the steps to use the PojoCache feature?</para>
  -          </question>
  -
  -          <answer>
  -             <para>Starting from release 1.3, depends on the JDK you use, it has slightly different steps. But in general,
  -             in order to use PojoCache, you will need to:</para>
  -
  -             <itemizedlist>
  -                <listitem><para>prepare POJO. You can do either via xml declaration or annotation. For annotation, you can
  -                use either the JDK1.4 style or JDK50 one (of which is part of JVM spec). If you use JDK14, you will also need
  -                a annotation pre-compiler (annoc) to pre-process it.</para></listitem>
  -                <listitem><para>instrumentation. You will need to instrument your POJO either at compile-time or load-time.
  -                If you do it during compile-time, you use so-called aop pre-compiler (aopc) to do bytecode manipulation.
  -                If you do it via load-time, however, you need either a special system class loader or, in JDK50, you can
  -                use the javaagent option.</para></listitem>
  -             </itemizedlist>
  -            <para>So if you use JDK50, for example, with annotation and load-time instrumentation, then you won't need
  -            any pre-processing step to use PojoCache. For a full example, please refer to the distro examples directory.
  -            There are numerous PojoCache examples that uses different options.</para>
  -          </answer>
  -        </qandaentry>
  -
  -      <qandaentry>
  -        <question id="54">
  -          <para>Can I run PojoCache in JBoss AS 3.2.x application
  -          server?</para>
  -        </question>
  -
  -        <answer>
  -          <para>Yes and no. Yes, since JBossAop can also be back-ported to
  -          3.2.x (see JBossAop wiki for details). However, it will take some
  -          effort. Therefore, the recommended JBoss version is 4.x to run
  -          PojoCache.</para>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="55">
  -          <para>Can PojoCache run as a MBean as well?</para>
  -        </question>
  -
  -        <answer>
  -          <para>Yes. It is almost the same as TreeCache MBean. The only
  -          difference is the object name and the class name. E.g., instead
  -          of
  -         <programlisting>&lt;mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache"&gt;</programlisting>
  -           you will have:
  -          <programlisting>&lt;mbean code="org.jboss.cache.aop.PojoCache" name="jboss.cache:service=PojoCache"&gt;</programlisting>
  -           in the xml configuration file.</para>
  -        </answer>
  -      </qandaentry>
  -
  -       <qandaentry>
  -         <question id="56">
  -           <para>Can I pre-compile the aop classes such that I don't need to
  -           use the system classloader and jboss-aop configuration xml?</para>
  -         </question>
  -
  -         <answer>
  -           <para>Yes. The latest versions of JBossCache have a pre-compiler
  -           option called <literal>aopc</literal>. You can use this option to
  -           pre-compile your "aspectized" POJO. Once the classes have been byte
  -           code generated, they can be treated as regular class files, i.e.,
  -           you will not need to include any <literal>jboss-aop.xml</literal>
  -           that specifies the advisable POJO and to specify the JBossAop system
  -           class loader.</para>
  -
  -           <para>For an example of how to use <literal>aopc</literal>, please
  -           see 1) <literal>tools</literal> directory for PojoCacheTasks14.xml
  -              and PojoCacheTasks50.xml. Both contain Ant tasks that you can
  -              import to your regular project for <literal>annoc</literal> and
  -              <literal>aopc</literal>. In addition, please also check out the
  -           <literal>examples</literal> directory for concrete examples.</para>
  -         </answer>
  -       </qandaentry>
  -
  -      <qandaentry>
  -        <question id="57">
  -          <para>How do I use aopc on multiple module directories?</para>
  -        </question>
  -
  -        <answer>
  -          <para>In aopc, you specify the src path for a specific directory. To
  -          pre-compile multiple ones, you will need to invoke aopc multiple
  -          times.</para>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="58">
  -          <para>What's in the <literal>jboss-aop.xml</literal>
  -          configuration?</para>
  -        </question>
  -
  -        <answer>
  -          <para><literal>jboss-aop.xml</literal> is needed for POJO
  -          instrumentation. In <literal>jboss-aop.xml</literal>, you can
  -          declare your POJO (e.g., <literal>Person</literal>) to be
  -          "prepared", a JBossAop term to denote that the object will be
  -          "aspectized" by the system. After this declaration, JBossAop will
  -          invoke any interceptor that associates with this POJO. PojoCache
  -          will dynamically add an
  -          <literal>org.jboss.cache.aop.CacheInterceptor</literal> to this POJO
  -          to perform object mapping and relationship management.</para>
  -
  -          <para>Note that to add your POJO, you should declare all the fields
  -          to be "prepared" as in the example.</para>
  -        </answer>
  -      </qandaentry>
  -
  -       <qandaentry>
  -         <question id="59">
  -           <para>Can I use annotation instead of the xml declaration?</para>
  -         </question>
  -
  -         <answer>
  -           <para>Yes, starting with JBossCache 1.3, you can use annotation to
  -           instrument your POJO for both JDK1.4 and 1.5. Check the documentation for details.</para>
  -         </answer>
  -       </qandaentry>
  -
  -       <qandaentry>
  -         <question id="60">
  -           <para>What are the pro and con of xml vs. annotation?</para>
  -         </question>
  -
  -         <answer>
  -           <para>It really depends on your organization environment, I'd say, since this can be turned into a
  -           hot debate. Having said that, I feel strongly that POJO annotation is well suited for PojoCache. This is
  -           because once you specify the annotation, you'd probably change it rarely since there is no parameters to
  -           tune, for example.</para>
  -         </answer>
  -       </qandaentry>
  -
  -       <qandaentry>
  -         <question id="61">
  -           <para>What are the <literal>@org.jboss.cache.aop.annotation.Transient</literal> and
  -              <literal>@org.jboss.cache.aop.annotation.Serializable</literal> field level annotations?</para>
  -         </question>
  -
  -         <answer>
  -           <para>Starting in 1.4, we also offer two additional field-level annotations. The first one,
  -              <literal>@Transient</literal>,
  -           when applied has the same effect as declaring a field <literal>transient</literal>. PojoCache
  -           won't put this field under management.</para>
  -            <para>The second one, <literal>@Serializable</literal> when applied, will cause PojoCache to
  -            treat the field as a Serializable object even when it is <literal>@PojoCacheable</literal>.</para>
  -         </answer>
  -       </qandaentry>
  -
  -       <qandaentry>
  -         <question id="62">
  -           <para>What about compile-time vs. load-time instrumentation then?</para>
  -         </question>
  -
  -         <answer>
  -           <para>Again it depends. But my preference is to do compile-time instrumentation via aopc. I prefer this
  -           approach because it is easier to debug (at least at the development stage). In addition, once I generate the
  -           new class, there is no more steps needed.</para>
  -         </answer>
  -       </qandaentry>
  -
  -      <qandaentry>
  -        <question id="63">
  -          <para>Is it possible to store the same object multiple times but
  -          with different Fqn paths? Like /foo/byName and /foo/byId ?</para>
  -        </question>
  -
  -        <answer>
  -          <para>Yes, you can use PojoCache to do that. It supports the
  -          notion of object reference. PojoCache manages the unique object
  -          through association of the dynamic cache interceptor.</para>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="64">
  -          <para>Do I need to declare all my objects "prepared" in
  -          <literal>jboss-aop.xml</literal>?</para>
  -        </question>
  -
  -        <answer>
  -          <para>Not necessarily. If there is an object that you don't need the
  -          cache to manage for you, you can leave it out of the declaration.
  -          The cache will treat this object as a "primitive" type. However, the
  -          object will need to implement <literal>Serializable</literal>
  -          interface for replication.</para>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="65">
  -          <para>Can the cache aop intercept update via reflection?</para>
  -        </question>
  -
  -        <answer>
  -          <para>No. The update via reflection will not be intercepted in
  -          JBossAop and therefore PojoCache will not be able to perform the
  -          necessary synchronization.</para>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="66">
  -          <para>When I declare my POJO to be "aspectized", what happens to the
  -          fields with transient, static, and final modifiers?</para>
  -        </question>
  -
  -        <answer>
  -          <para>PojoCache currently will ignore the fields with these
  -          modifiers. That is, it won't put these fields into the cache (and
  -          thus no replication either).</para>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="67">
  -          <para>What are those keys such as
  -          <literal>JBoss:internal:class</literal> and
  -          <literal>AOPInstance</literal>?</para>
  -        </question>
  -
  -        <answer>
  -          <para>They are for internal use only. Users should ignore these keys
  -          and values in the node hashmap.</para>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="68">
  -          <para>What about Collection classes? Do I need to declare them
  -          "prepared"?</para>
  -        </question>
  -
  -        <answer>
  -          <para>No. Since the Collection classes such as
  -          <literal>ArrayList</literal> are java util classes, aop by default
  -          won't instrument these classes. Instead, PojoCache will generate
  -          a dynamic class proxy for the Collection classes (upon the
  -          <literal>putObject</literal> call is invoked). The proxy will
  -          delegate the operations to a cache interceptor that implements the
  -          actual Collection classes APIs. That is, the system classes won't be
  -          invoked when used in PojoCache.</para>
  -
  -          <para>Internally, the cache interceptor implements the APIs by
  -          direct interaction with respect to the underlying cache store. Note
  -          that this can have implications in performance for certain APIs. For
  -          example, both <literal>ArrayList</literal> and
  -          <literal>LinkedList</literal> will have the same implementation.
  -          Plan is currently underway to optimize these APIs.</para>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="69">
  -          <para>How do I use <literal>List</literal>, <literal>Set</literal>,
  -          and <literal>Map</literal> dynamic proxy?</para>
  -        </question>
  -
  -        <answer>
  -          <para>PojoCache supports classes extending from
  -          <literal>List</literal>, <literal>Set</literal>, and
  -          <literal>Map</literal> without users to declare them "aspectized".
  -          It is done via a dynamic proxy. Here is a code snippet to use an
  -          <literal>ArrayList</literal> proxy class.</para>
  -
  -          <programlisting>ArrayList list = new ArrayList();
  -list.add("first");
  -
  -cache.putObject("/list/test", list); // Put the list under the aop cache
  -list.add("second"); // Won't work since AOP intercepts the dynamic proxy not the original POJO.
  -
  -ArrayList myList = (List)cache.getObject("/list/test"); // we are getting a dynamic proxy instead
  -myList.add("second");  // it works now
  -myList.add("third");
  -myList.remove("third");</programlisting>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="70">
  -          <para>What is the proper way of assigning two different keys with
  -          Collection class object?</para>
  -        </question>
  -
  -        <answer>
  -          <para>Let's say you want to assign a <literal>List</literal> object
  -          under two different names, you will need to use the class proxy to
  -          insert the second time to ensure both are managed by the cache. Here
  -          is the code snippet.</para>
  -
  -          <programlisting>ArrayList list = new ArrayList();
  -list.add("first");
  -
  -cache.putObject("/list", list); // Put the list under the aop cache
  -
  -ArrayList myList = (List)cache.getObject("/list"); // we are getting a dynamic proxy instead
  -myList.add("second");  // it works now
  -
  -cache.putObject("/list_alias", myList); // Note you will need to use the proxy here!!
  -myList.remove("second");</programlisting>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="71">
  -          <para>OK, so I know I am supposed to use proxy when manipulating the
  -          Collection classes once they are managed by the cache. But what
  -          happens to Pojos that share the Collection objects, e.g., a
  -          <literal>List</literal> instance that is shared by 2 Pojos?</para>
  -        </question>
  -
  -        <answer>
  -          <para>Pojos that share Collection instance references will be
  -          handled by the cache automatically. That is, when you ask the Cache
  -          to manage it, the Cache will dynamically swap out the regular
  -          Collection references with the dynamic proxy ones. As a result, it
  -          is transparent to the users.</para>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="72">
  -          <para>What happens when my "aspectized" POJO has field members that
  -          are of Collection class ?</para>
  -        </question>
  -
  -        <answer>
  -          <para>When a user puts a POJO into the cache through the call
  -          <literal>putObject</literal>, it will recursively map the field
  -          members into the cache store as well. When the field member is of a
  -          Collection class (e.g., List, Set, or Map), PojoCache will first
  -          map the collection into cache. Then, it will swap out dynamically
  -          the field reference with an corresponding proxy reference.</para>
  -
  -          <para>This is necessary so that an internal update on the field
  -          member will be intercepted by the cache.</para>
  -        </answer>
  -      </qandaentry>
  -
  -
  -     <qandaentry>
  -       <question id="73">
  -         <para>What are the limitation of Collection classes in PojoCache?</para>
  -       </question>
  -
  -       <answer>
  -         <para>Use of Collection class in PojoCache helps you to track fine-grained changes
  -         in your collection fields automatically. However, current implementation has the follow
  -         limitation that we plan to address soon.</para>
  -         <para>Currently, we only support a limited implementation of Collection classes. That is,
  -                we support APIs in List, Set, and Map. However, since the APIs do not stipulate
  -                of constraints like NULL key or value, it makes mapping of user instance to our proxy tricky.
  -                For example, ArrayList would allow NULL value and some other implementation would not.
  -                The Set interface maps to java.util.HashSet implementation.  The List interface maps
  -                to java.util.ArrayList implementation.  The Map interface maps to java.util.HashMap
  -                implementation.
  -             </para>
  -          <para>Another related issue is the expected performance. For example, the current implementation is ordered, so
  -              that makes insert/delete from the Collection slow.  Performance between Set, Map and List collections also vary.
  -              Adding items to a Set is slower than a List or Map, since Set does not allow duplicate entries.
  -          </para>
  -       </answer>
  -     </qandaentry>
  -
  -
  -     <qandaentry>
  -       <question id="74">
  -         <para>What are the pros and cons of PojoCache?</para>
  -       </question>
  -
  -       <answer>
  -         <para>As mentioned in the reference doc, PojoCache has the following advantages:</para>
  -          <itemizedlist>
  -             <listitem><para>Fine-grained replication and/or persistency. If you use a distributed PojoCache
  -             and once your POJO is put in the cache store, there is no need to use another API to
  -             trigger your changes. Furthermore, the replication are fine-grained field level. Note this
  -             also applies to persistency.</para></listitem>
  -             <listitem><para>Fine-grained replication can have potential performance gain if your POJO is big and
  -             the changes are fine-grained, e.g., only to some selected fields.</para></listitem>
  -             <listitem><para>POJO can posses object relationship, e.g., multiple referenced. Distributed
  -             PojoCache will handle this transparently for you.</para></listitem>
  -          </itemizedlist>
  -          <para>And here are some cases that you may not want to use PojoCache:</para>
  -          <itemizedlist>
  -             <listitem><para>You use only cache. That is you don't need replication or persistency. Then since
  -             everything is operated on the in-memory POJO reference, there is no need for PojoCache.</para></listitem>
  -             <listitem><para>You have simple and small POJOs. Your POJO is small in size and also there is no
  -             object relationship, then PojoCache possess not clear advantage to plain cache.</para></listitem>
  -             <listitem><para>Your application is bounded by memory usage. Because PojoCache need almost twice as much
  -             of memory (the original POJO in-memory space and also the additional cache store for the
  -             primitive fields), you may not want to use PojoCache.</para></listitem>
  -             <listitem><para>Your POJO lifetime is short. That is, you need to create and destroy your POJO often.
  -             Then you need to do "pubObject" and "removeObject" often, it will be slow in performance.</para></listitem>
  -          </itemizedlist>
  -       </answer>
  -     </qandaentry>
  -      </qandaset>
  -
  -  <qandaset defaultlabel="EvictionPolicies">
  +  <qandaset defaultlabel="qanda">
         <title>Eviction Policies</title>
   
         <qandaentry>
  -        <question id="75">
  +        <question id="a75">
             <para>Does JBoss Cache support eviction policies?</para>
           </question>
   
           <answer>
  -          <para>Yes. JBoss Cache currently implements a LRU eviction policy for
  -          both TreeCache
  -          (<literal>org.jboss.cache.eviction.LRUPolicy</literal>) and
  -          PojoCache
  -          (<literal>org.jboss.cache.aop.eviction.AopLRUPolicy</literal>). Users
  -          can also plug in their own eviction policy algorithms. See user
  -          manual for details. Currently there is user-contributed policy
  -          called <literal>FIFOPolicy</literal> that evicts the node based on
  -          FIFO principle only.</para>
  -        </answer>
  -      </qandaentry>
  -
  -      <qandaentry>
  -        <question id="76">
  -          <para>Why can't I use
  -          <literal>org.jboss.cache.eviction.LRUPolicy</literal> for
  -          PojoCache as well?</para>
  -        </question>
  -
  -        <answer>
  -          <para>For PojoCache, you will need to use
  -          <literal>org.jboss.cache.aop.eviction.AopLRUPolicy</literal>) because
  -          AOP has its eviction algorithm, although is LRU but has totally
  -          different notion of an "object", for example.</para>
  +          <para>Yes. JBoss Cache currently supports multiple eviction policies such as LRU, MRU, and FIFO.
  +          Users can also plug in their own eviction policy algorithms. See user
  +          manual for details. </para>
           </answer>
         </qandaentry>
   
         <qandaentry>
  -        <question id="77">
  -          <para>Does JBoss Cache's implemented LRU eviction policy operates in
  +        <question id="a77">
  +          <para>Does JBoss Cache's eviction policy operates in
             replication mode?</para>
           </question>
   
           <answer>
             <para>Yes and no. :-)</para>
   
  -          <para>The LRU policy only operates in local mode. That is, nodes are
  +          <para>The eviction policy only operates in local mode. That is, nodes are
             only evicted locally. This may cause the cache contents not to be
             synchronized temporarily. But when a user tries to obtain the cached
             contents of an evicted node and finds out that is null (e.g.,
  @@ -1432,7 +923,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="78">
  +        <question id="a78">
             <para>Does JBoss Cache support <literal>Region</literal>?</para>
           </question>
   
  @@ -1452,7 +943,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="79">
  +        <question id="a79">
             <para>What are the <literal>EvictionPolicyConfig</literal> tag
             parameters for
             <literal>org.jboss.cache.eviction.LRUPolicy</literal>?</para>
  @@ -1501,7 +992,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="80">
  +        <question id="a80">
             <para>I have turned on the eviction policy, why do I still get "out
             of memory" (OOM) exception?</para>
           </question>
  @@ -1524,11 +1015,11 @@
         </qandaentry>
       </qandaset>
   
  -  <qandaset defaultlabel="CacheLoaders">
  +  <qandaset defaultlabel="qanda">
         <title>Cache Loaders</title>
   
         <qandaentry>
  -        <question id="81">
  +        <question id="a81">
             <para>What is a CacheLoader?</para>
           </question>
   
  @@ -1584,7 +1075,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="82">
  +        <question id="a82">
             <para>Can writing to CacheLoaders be asynchronous?</para>
           </question>
   
  @@ -1597,7 +1088,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="83">
  +        <question id="a83">
             <para>Can I write my own CacheLoader ?</para>
           </question>
   
  @@ -1610,7 +1101,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="84">
  +        <question id="a84">
             <para>Does a CacheLoader have to use a persistent store ?</para>
           </question>
   
  @@ -1625,7 +1116,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="85">
  +        <question id="a85">
             <para>What can I use a CacheLoader for?</para>
           </question>
   
  @@ -1668,7 +1159,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="86">
  +        <question id="a86">
             <para>How do I configure JBossCache with a CacheLoader?</para>
           </question>
   
  @@ -1681,7 +1172,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="87">
  +        <question id="a87">
             <para>Do I have to pay to use Sleepycat's CacheLoader?</para>
           </question>
   
  @@ -1694,7 +1185,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="88">
  +        <question id="a88">
             <para>Can I use more than one cache loader?</para>
           </question>
   
  @@ -1711,7 +1202,7 @@
         </qandaentry>
   
         <qandaentry>
  -        <question id="89">
  +        <question id="a89">
             <para>Why do cache loaders go into an inconsistent state when I use transactions, pessimistic locking, and I attempt to read a node after removing it from within the same transaction scope?</para>
           </question>
   
  @@ -1727,10 +1218,10 @@
   
       </qandaset>
   
  -	<qandaset defaultlabel="Troubleshooting">
  +	<qandaset defaultlabel="qanda">
   		<title>Troubleshooting</title>      
   	<qandaentry>
  -        <question id="90">
  +        <question id="a90">
             <para>I am having problems getting JBoss Cache to work, where can I get information on troubleshooting?</para>
           </question>
           <answer>
  
  
  



More information about the jboss-cvs-commits mailing list