From jbosscache-commits at lists.jboss.org Sun Nov 1 01:20:36 2009 Content-Type: multipart/mixed; boundary="===============5107041122290339290==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8280 - enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_Tutorial/en-US. Date: Sun, 01 Nov 2009 01:20:35 -0500 Message-ID: <200911010620.nA16KZLd011316@svn01.web.mwc.hst.phx2.redhat.com> --===============5107041122290339290== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-01 01:20:35 -0500 (Sun, 01 Nov 2009) New Revision: 8280 Modified: enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_Tutorial/en-US/JBoss_Cache_Tu= torial.xml Log: Added changes for JBPAPP-2978. Modified: enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_Tutorial/en-US/JBoss_C= ache_Tutorial.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_Tutorial/en-US/JBoss_Cache_T= utorial.xml 2009-10-30 17:02:38 UTC (rev 8279) +++ enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_Tutorial/en-US/JBoss_Cache_T= utorial.xml 2009-11-01 06:20:35 UTC (rev 8280) @@ -11,8 +11,7 @@ for POJO Cache, if it is the POJO Cache API you are interested in. - For details of configuration, usage and APIs, please refer to the - u= ser manuals. + For details about configuration, usage and APIs, please refer to = the JBoss Cache User Guide for JBoss Enterprise Application Platform 5.0, a= vailable from . =
@@ -79,7 +78,7 @@ Changing to the ${JBOSSCACHE_HOME}/tutorial directory (e.g.,cd ${JBOSSCACHE_HOME}/tutorial) - And then running the ant script (e.g.,ant run) + And then running the ant script (e.g., ant run) = @@ -181,8 +180,8 @@ 7. Delete nodes = = JBoss Cache includes JMX MBeans to expose cache functionality and provid= e statistics that can be used to analyze cache operations. JBoss Cache can = also broadcast cache events as MBean notifications for handling via JMX mon= itoring tools. = --===============2128742496176906027==-- From jbosscache-commits at lists.jboss.org Mon Nov 16 01:45:02 2009 Content-Type: multipart/mixed; boundary="===============9072365883031311849==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8285 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US. Date: Mon, 16 Nov 2009 01:45:02 -0500 Message-ID: <200911160645.nAG6j2hF020078@svn01.web.mwc.hst.phx2.redhat.com> --===============9072365883031311849== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-16 01:45:01 -0500 (Mon, 16 Nov 2009) New Revision: 8285 Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Cacheloader.xml enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Eviction.xml enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/General.xml enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Pojo_Cache.xml enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Tree_Cache.xml enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Troubleshooting.xml Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_Frequen= tly_Asked_Questions_CP08.xml Log: Split book into chapters for pdf build. Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Cacheloader.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Cacheloader.xml = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Cacheloader.xml 20= 09-11-16 06:45:01 UTC (rev 8285) @@ -0,0 +1,253 @@ + + + + + Cache Loaders + + + + + + + What is a CacheLoader? + + + + A CacheLoader is the connection of JBossCache to a + (persistent) data store. The CacheLoader is called by JB= ossCache to + fetch data from a store when that data is not in the cac= he, and when + modifications are made to data in the cache the CacheLoa= der is + called to store those modifications back to the store. + + + In conjunction with eviction policies, JBossCache wit= h a + CacheLoader allows a user to maintain a bounded cache fo= r a large + backend datastore. Frequently used data is fetched from = the + datastore into the cache, and the least used data is evi= cted, in + order to provide fast access to frequently accessed data= . This is + all configured through XML, and the programmer doesn't h= ave to take + care of loading and eviction. + + + JBossCache currently ships with several CacheLoader + implementations, including: + + + + + + FileCacheLoader: this implementation uses th= e file + system to store and retrieve data. JBossCache n= odes are mapped + to directories, subnodes to subdirectories etc.= Attributes of + a node are mapped to a file + data + inside the + directory. + + + + + BdbjeCacheLoader: this implementation is bas= ed on the + Sleepycat Java Edition database, a fast and eff= icient + transactional database. It uses a single file f= or the entire + store. Note that if you use Sleepycat's CacheLo= ader with + JBoss Cache and wish to ship your product, you = will have to acquire a + commercial license from Sleepycat + + . + + + + + JDBCCacheLoader: this implementation uses th= e relational database as the persistent + storage. + + + + + ClusteredCacheLoader: this implementation qu= eries the rest of the cluster, treating other + servers' in-memory state as a data store. + + + + + And more. See the documentation for more det= ails. + + + + + + + + + Can writing to CacheLoaders be asynchronous? + + + + As of JBossCache 1.2.4, yes. Set the CacheLoaderAsync= hronous + property to true. See the JBossCache documentation for a= more + detailed discussion. By default though, all cache loader= writes are + synchronous and will block. + + + + + + + Can I write my own CacheLoader ? + + + + Yes. A CacheLoader is a class implementing + org.jboss.cache.loader.CacheLoader + . It is + configured via the XML file (see JBossCache and Tutorial + documentation). + + + + + + + Does a CacheLoader have to use a persistent store ? + + + + No, a CacheLoader could for example fetch (and possib= ly store) + its data from a webdav-capable webserver. Another exampl= e is a + caching proxy server, which fetches contents from the we= b. Note that + an implementation of CacheLoader may not implement the '= store' + functionality in this case, but just the 'load' + functionality. + + + + + + + What can I use a CacheLoader for? + + + + Some applications: + + + + + HTTP sessions can be persisted (besides bein= g replicated + by JBossCache). The CacheLoader can be configur= ed to be + shared, or unshared, meaning that every node in= a cluster has + its own local store. It is also possible to att= ach a + CacheLoader to just + one + of the + nodes. + + + + + Simple persistence for POJOs. Use of JBossCa= che aop and + a local CacheLoader persist POJOs transparently= into the store + provided by the CacheLoader. + + + + + Highly available replicated and persisted da= ta store. + The service is up as long as at least 1 node is= running, but + even if all nodes are taken offline, when the f= irst node is + started again, the data previously saved will s= till be + available (e.g. a shopping cart). + + + + + A caching web proxy (a la Squid): all data a= re contents + of URLs, users access the proxy, and if the URL= is not in the + cache, the CacheLoader fetches it from the web.= This could + actually be a replicated and transactional vers= ion of + Squid. + + + + + + + + + + How do I configure JBossCache with a CacheLoader? + + + + Through XML: both the fully-qualified classname of the + CacheLoader and its configuration string have to be give= n. + JBossCache will then instantiate a CacheLoader. See JBos= sCache + documentation for details. + + + + + + + Do I have to pay to use Sleepycat's CacheLoader? + + + + Not if you use it only for personal use. As soon as y= ou + distribute your product with BdbjeCacheLoader, you have = to purchase + a commercial license from Sleepycat. See details at + http://www.sleepycat.com/jeforjbosscache + + . + + + + + + + Can I use more than one cache loader? + + + + As of JBossCache 1.3.0, yes. With the new CacheLoader= Configuration XML + element (see user manual section on cache loaders) you c= an now + describe several cache loaders. The impact is that the c= ache will + look at all of the cache loaders in the order they've be= en + configured, until it finds a valid, non-null element of = data. When + performing writes, all cache loaders are written to (exc= ept if the + ignoreModifications element has been set to true for a s= pecific + cache loader. + + + + + + + Why do cache loaders go into an inconsistent state wh= en I use transactions, pessimistic locking, + and I + attempt to read a node after removing it from within the= same transaction scope? + + + + + This is a known bug (see + JBCACHE-477 + and + JBCACHE-352 + ), which have been fixed in JBoss Cache 1.4.0. A very si= mple workaround if you're using JBoss Cache + 1.3.x + is to use optimistic locking. + + + One of the consequences of this bug is that, for example= , if you use PojoCache with pojos that have + private references to a List and you update and remove s= omeelements of that List within a transaction + (when using pessimistic locking and a cache loader), you= may see IllegalStateExceptions thrown. + + + + + + + \ No newline at end of file Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Eviction.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Eviction.xml = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Eviction.xml 2009-= 11-16 06:45:01 UTC (rev 8285) @@ -0,0 +1,212 @@ + + + + + Eviction Policies + + + + + + + Does JBoss Cache support eviction policies? + + + + Yes. JBoss Cache currently implements a LRU eviction = policy for + both TreeCache + ( + org.jboss.cache.eviction.LRUPolicy + ) and + PojoCache + ( + org.jboss.cache.aop.eviction.AopLRUPolicy + ). Users + can also plug in their own eviction policy algorithms. S= ee user + manual for details. Currently there is user-contributed = policy + called + FIFOPolicy + that evicts the node based on + FIFO principle only. + + + + + + + Why can't I use + org.jboss.cache.eviction.LRUPolicy + for + PojoCache as well? + + + + + For PojoCache, you will need to use + org.jboss.cache.aop.eviction.AopLRUPolicy + ) because + AOP has its eviction algorithm, although is LRU but has = totally + different notion of an "object", for example. + + + + + + + Does JBoss Cache's implemented LRU eviction policy op= erates in + replication mode? + + + + + Yes and no. :-) + + The LRU 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 obtai= n the cached + contents of an evicted node and finds out that is null (= e.g., + get + returns null), it should get it from the + other data source and re-populate the data in the cache.= During this + moment, the node content will be propagated and the cach= e content + will be in sync. + + + However, you still can run eviction policies with cac= he mode + set to either + REPL_SYNC + or + REPL_ASYNC + . Depending on your use case, you can + set multiple cache instances to have their own eviction = policy + (which are applied locally) or just have selected instan= ces with + eviction policies activated. + + + Also note that, with cache loader option, a locally e= victed + node can also be persisted to the backend store and a us= er can + retrieve it from the store later on. + + + + + + + Does JBoss Cache support + Region + ? + + + + + Yes. JBoss Cache has the notion of region where a use= r can + configure the eviction policy parameters (e.g., + maxNodes + or + timeToIdleSeconds + ) + + + A region in JBoss Cache denotes a portion of tree hie= rarchy, + e.g., a fully qualified name ( + FQN + ). For example, + a user can define + /org/jboss + and + /org/foocom + as two separate regions. But note + that you can configure the region programmatically now, = i.e., + everything has to be configured through the xml file. + + + + + + + What are the + EvictionPolicyConfig + tag + parameters for + org.jboss.cache.eviction.LRUPolicy + ? + + + + + They are: + + + + Parameters + + + + + wakeUpIntervalInSeconds + + Interval where the clean up thread wakes= to process + the sitting queue and sweep away the old dat= a. + + + + + region + + A area where each eviction policy parame= ters are + specified. Note that it needs a minimum of + /_default + region. + + + + + maxNodes + + Max number of nodes allowed in the evict= ion queue. 0 + means no limit. + + + + + timeToLiveInSeconds + + Age (in seconds) for the node to be evic= ted in the + queue. 0 denotes no limit. + + + + +
+
+
+ + + + I have turned on the eviction policy, why do I still = get "out + of memory" (OOM) exception? + + + + + OOM can happen when the speed of cache access exceeds= the + speed of eviction policy handling timer. Eviction policy= handler + will wake up every + wakeUpIntervalInSeconds + seconds to process the eviction event queue. And the que= ue size is + fixed at 20000 now. So when the queue size is full, it w= ill create a + backlog and cause OOM to happen unless the eviction time= r catches + up. To address this problem, in addition to increase the= VM heap + size, you can also reduce the + wakeUpIntervaleInSeconds + so the timer thread + processes the queue more frequently. + + + We will also externalize the queue size so it will be + configurable in the next release. + + + +
+
\ No newline at end of file Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/General.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/General.xml = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/General.xml 2009-1= 1-16 06:45:01 UTC (rev 8285) @@ -0,0 +1,207 @@ + + + + + + General Information + + + + What is JBoss Cache? + + + + JBoss Cache is a replicated and transactional cache. = It is + replicated since multiple JBoss Cache instances can be d= istributed + (either within the same JVM or across several JVMs wheth= er they reside on + the same machine or on different machines on a network) = and data is + replicated across the whole group. It is transactional b= ecause a + user can configure a JTA compliant transaction manager a= nd make the cache + operation transactional. Note that the cache can also be= run without + any replication; this is the local mode. + + + Currently, JBoss Cache consists of two components: a = generic cache + (implemented internally as + org.jboss.cache.TreeCache + ) and a POJO cache (implemented + internally as + org.jboss.cache.aop.PojoCache + ). + TreeCache + is a tree-structured cache that provides replication and + transaction context, while + PojoCache + extends the functionality of + TreeCache + but behaves as a true object cache providing transparent + and finer-grained object mapping into internal cache. + + + + + + + Who are the JBoss Cache developers? + + + + JBossCache has been developed by Bela Ban, Ben Wang, = Harald + Gliebe, Manik Surtani and Brian Stansberry. Manik is the= lead on JBoss Cache and Ben is the lead on + PojoCache. + + + + + + + What is the license for JBoss Cache? + + + + JBoss Cache is licensed under + LGP= L + . + + + + + + + Where can I download JBoss Cache? + + + + The JBoss Cache + product download page + has prebuilt binaries as well as source distributions. Y= ou can also grab snapshots from the JBoss CVS + repository (see + this wiki page + ) - the module name is + JBossCache + + + + + + + How do I build JBoss Cache from CVS sources? + + + + To build, do + sh build.sh + jar + + . This will produce + jboss-cache.jar + in the + dist/lib + directory. Or if you want to + build the standalone package, do + sh build.sh dist + this will produce + dist/jboss-cache-dist.zip + 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. + + + + + + + Which JVMs are supported by JBoss Cache? + + + + JBoss Cache has been tested and supported on J2SE 1.4= .x and JDK 5.0. + On jboss-3.2 CVS tree, it also compiles on JDK1.3, but t= here is no + official support for this version and using this is not = recommended. + + + + + + + From JBoss Cache 1.3.0 onwards, there is a new direct= ory + lib-50 + , + what is it? + + + + + From JBoss Cache 1.3.0 onwards, we support the use of= Java 5 annotations, used by PojoCache. + As a result, there are + jboss-aop-jdk50.jar + and + jboss-cache-jdk50.jar + that + are needed to work with the Java 5 annotations. You will= need to replace + jboss-aop.jar + and + jboss-cache.jar + in the lib directory with the + -jdk50 + versions if you intend + to use PojoCache, Java 5 and annotations. + + + + + + + How do I know the version of JBoss Cache that I am us= ing? + + + + Since release 1.2, you can check the jar version by r= unning: + java -jar jboss-cache.jar org.jboss.cache.Version<= /code> + . + + + + + + + Can I run JBoss Cache outside of JBoss Application + Server? + + + + + Of course! JBoss Cache comes in two flavors: + + + + Integrated with JBoss Application Server as an = MBean service. + + + + Standalone, that can run in any Java EE server = such + as BEA WebLogic or IBM Websphere. Of course, it ca= n also run in + a standalone Java process (i.e., outside Java EE c= ontext). + + + + + + + + + Where can I report bugs or problems? + + + + Please report any bugs or problems to + JBoss Cache + User Forum + + . + + + + + \ No newline at end of file Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_= Frequently_Asked_Questions_CP08.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP08.xml 2009-11-16 06:36:07 UTC (rev 8284) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP08.xml 2009-11-16 06:45:01 UTC (rev 8285) @@ -1,2252 +1,12 @@ - - - - - General Information - - - - What is JBoss Cache? - - - - JBoss Cache is a replicated and transactional cache. = It is - replicated since multiple JBoss Cache instances can be d= istributed - (either within the same JVM or across several JVMs wheth= er they reside on - the same machine or on different machines on a network) = and data is - replicated across the whole group. It is transactional b= ecause a - user can configure a JTA compliant transaction manager a= nd make the cache - operation transactional. Note that the cache can also be= run without - any replication; this is the local mode. - - - Currently, JBoss Cache consists of two components: a = generic cache - (implemented internally as - org.jboss.cache.TreeCache - ) and a POJO cache (implemented - internally as - org.jboss.cache.aop.PojoCache - ). - TreeCache - is a tree-structured cache that provides replication and - transaction context, while - PojoCache - extends the functionality of - TreeCache - but behaves as a true object cache providing transparent - and finer-grained object mapping into internal cache. - - - - - - - Who are the JBoss Cache developers? - - - - JBossCache has been developed by Bela Ban, Ben Wang, = Harald - Gliebe, Manik Surtani and Brian Stansberry. Manik is the= lead on JBoss Cache and Ben is the lead on - PojoCache. - - - - - - - What is the license for JBoss Cache? - - - - JBoss Cache is licensed under - LGP= L - . - - - - - - - Where can I download JBoss Cache? - - - - The JBoss Cache - product download page - has prebuilt binaries as well as source distributions. Y= ou can also grab snapshots from the JBoss CVS - repository (see - this wiki page - ) - the module name is - JBossCache - - - - - - - How do I build JBoss Cache from CVS sources? - - - - To build, do - sh build.sh - jar - - . This will produce - jboss-cache.jar - in the - dist/lib - directory. Or if you want to - build the standalone package, do - sh build.sh dist - this will produce - dist/jboss-cache-dist.zip - 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. - - - - - - - Which JVMs are supported by JBoss Cache? - - - - JBoss Cache has been tested and supported on J2SE 1.4= .x and JDK 5.0. - On jboss-3.2 CVS tree, it also compiles on JDK1.3, but t= here is no - official support for this version and using this is not = recommended. - - - - - - - From JBoss Cache 1.3.0 onwards, there is a new direct= ory - lib-50 - , - what is it? - - - - - From JBoss Cache 1.3.0 onwards, we support the use of= Java 5 annotations, used by PojoCache. - As a result, there are - jboss-aop-jdk50.jar - and - jboss-cache-jdk50.jar - that - are needed to work with the Java 5 annotations. You will= need to replace - jboss-aop.jar - and - jboss-cache.jar - in the lib directory with the - -jdk50 - versions if you intend - to use PojoCache, Java 5 and annotations. - - - - - - - How do I know the version of JBoss Cache that I am us= ing? - - - - Since release 1.2, you can check the jar version by r= unning: - java -jar jboss-cache.jar org.jboss.cache.Version<= /code> - . - - - - - - - Can I run JBoss Cache outside of JBoss Application - Server? - - - - - Of course! JBoss Cache comes in two flavors: - - - - Integrated with JBoss Application Server as an = MBean service. - - - - Standalone, that can run in any Java EE server = such - as BEA WebLogic or IBM Websphere. Of course, it ca= n also run in - a standalone Java process (i.e., outside Java EE c= ontext). - - - - - - - - - Where can I report bugs or problems? - - - - Please report any bugs or problems to - JBoss Cache - User Forum - - . - - - - - - - JBoss Cache - Tree Cache - - - - How do I deploy JBoss Cache as a MBean service? - - - - To deploy JBoss Cache as an MBean inside JBoss, you c= an copy the - configuration xml file over to the - deploy - directory (from - all - configuration whereby the - necessary jars are present). Under the standalone package - etc/META-INF - directory , there are example - configuration files for different cache modes that can b= e used to - deploy JBoss Cache as well. - - - - - - - How do I know if my JBoss Cache MBean has been deploy= ed? - - - - To verify that your JBoss Cache MBean is deployed cor= rectly, - you can first check the log output under the command con= sole. Next - you can verify it from JBoss JMX console. Look for - jboss.cache - domain. - - - - - - - How do I access the JBoss Cache MBean? - - - - Accessing the JBoss Cache MBean is just like accessin= g any - JBoss MBean. Here is a code snippet: - - - - import org.jboss.mx.util.MBeanServerLocator; - import org.jboss.mx.util.MBeanProxyExt; - import org.jboss.cache.TreeCacheMBean; - import javax.management.MBeanServer; - ... - = - MBeanServer server; - TreeCacheMBean cache; - = - public init() throws Exception - { - try - { - server =3D MBeanServerLocator.locateJBoss(); - cache =3D (TreeCacheMBean) MBeanProxyExt.create(TreeCacheMBean.class, - "jboss.cache:service=3DTreeCache", - server); - } - catch (Exception ex) - { - // handle exception - } - } - = - public void myBusinessMethod() - { - Object value =3D cache.get("/my/node", "myKey"); - = - HashMap stuff =3D new HashMap(); - stuff.put("key1", "value1"); - stuff.put("key2", "value2"); - stuff.put("key3", "value3"); - = - cache.put("/my/new/node", stuff); - = - cache.remove("/my/node"); - = - ... - } - = - - - - - - - Can I run JBoss Cache on JBoss AS 3.2.x releases? - - - - Yes. The JBoss Cache source code is also up to date o= n the - jboss-3.2 CVS branch. However, only TreeCache is support= ed there - since JBossAop (which PojoCache relies on) is only avail= able in JBoss AS 4.x onwards. - - - - - - - Can I run multiple JBoss Cache instances on the same = VM? - - - - Yes. There are some scenarios where you may want to r= un - multiple instances of JBoss Cache. For example, you want= to run - multiple local cache instances with each instance having= its own - configuration (e.g., different cache policy). In this ca= se, you will - need multiple xml configuration files. - - - - - - - Can TreeCache run as a second level cache inside - Hibernate? - - - - - Yes. Since Hibernate 3.0 release, you can configure i= t to use - JBoss Cache (namely, TreeCache) as a second level cache.= For details, - see Hibernate documentation, and also see - - http://wiki.jboss.org/wiki/Wiki.jsp?page=3DJBossCache= Hibernate - - - - Note that since Hibernate 3.0.2 and JBossCache 1.2.2,= we have - fixed a critical bug that depending on the usage pattern= can cause - deadlock during query caching. - - - - - - - What about using PojoCache as a Hibernate cache? - - - - It is not necessary to use PojoCache for second level - cache inside Hibernate because Hibernate - manages fine-grained fields in Java objects. So using Po= joCache won't - provide any advantage. - - - - - - - How can I configure JBoss Cache? - - - - You can configure the JBoss Cache through a configura= tion xml - file. Or you can set it programmatically through its get= /set methods. - Check with the documentation for both examples. - - - - - - - In the configuration xml file, there are tags such as - class - , - MBean - , etc. What are - these? - - - - - These are tags for deploying JBoss Cache as a JBoss M= Bean - service. For consistency, we have kept them in the - standalone package as well, specifically, the - MBean - tag. If you run in standalone mode, - JBoss Cache will ignore these elements. - - - - - - - What is the difference between the different cache - modes? - - - - - JBossCache has five different cache modes, i.e., - LOCAL - , - REPL_SYNC - , - REPL_ASYNC - , - INVALIDATION_SYNC - and - INVALIDATION_ASYNC - . If you want to run JBoss Cache as a - single instance, then you should set the cache mode to - LOCAL - so that it won't attempt to replicate anything. - If you want to have synchronous replication among differ= ent - JBoss Cache instances, you set it to - REPL_SYNC - . - For asynchronous replication, use - AYSNC_REPL - . If you do not wish to replicate cached data but simply= inform other caches in a cluster that data - under - specific addresses are now stale and should be evicted f= rom memory, use - INVALIDATION_SYNC - or - INVALIDTAION_ASYNC - . Synchronous and asynchronous behavior applies to inval= idation as well as replication. - - - Note that - ASYNC_REPL - and - INVALIDATION_ASYNC - are non-blocking. This - can be useful when you want to have another JBoss Cache = serving as a - mirror or backup and you don't want to wait for confirma= tion that this mirror has received your - messages. - - - - - - - How does JBoss Cache's replication mechanism work? - - - - JBoss Cache leverages - JGroups - as a replication layer. A user - can configure the cluster of JBoss Cache instances by sh= aring the - same cluster name ( - cluster name - ). There is also - an option of whether to populate the cache data upon sta= rting a new - instance in the - ClusterConfig - attribute. - - - Note that once all instances join the same replicatio= n group, - every replication change is propagated to all participat= ing members. - There is no mechanism for sub-partitioning where some re= plication - can be done within only a subset of members. This is on = our to do - list. - - - - - - - I run a 2 node cluster. If the network dies, do the c= aches continue to run? - - - - Yes, both will continue to run, but depending on your= replication mode, all transactions or - operations may not complete. If - REPL_SYNC - is used, operations will fail while if - REPL_ASYNC - is used they will succeed. Even if they succeed though, = caches will be out of sync. - - - - - - - - Can I plug in library X instead of JGroups to handle = remote calls and group communications? - - - - At this stage (JBoss Cache 1.x) the answer is no. We = do have an abstraction layer between the - communication suite and JBoss Cache in the pipelines, an= d this may appear as a feature at some stage - in - the future. - - - - - - - Does the cache need to replicate to every other insta= nce in the cluster? Isn't this slow if the - cluster is large? - - - - - As of JBoss Cache 1.4.0, replication need not occur t= o every node in the cluster. This feature - - called Buddy Replication - - allows each node to pick one or more 'buddies' in the cl= uster and only replicate to its buddies. This - allows a cluster to scale - very easily with no extra impact on memory or network tr= affic with each node added. - - - See the User Guide for more information on Buddy Replica= tion, and how it can be used to achieve very - high - scalability. - - - - - - - If I have the need for different TreeCache properties= (e.g., - CacheMode - and - IsolationLevel - ), do I simply need to create multiple - TreeCache instances with the appropriate configuration? - - - - - Yes. All the above mentioned properties are per cache - instance. Therefore you will need a separate JBoss Cache - instance. - - - - - - - Does the Tree Cache config - ClusterName - have - any relation to the JBoss AS cluster - PartitionName - ? - - - - - Yes. They are both JGroups group names. Besides the n= otion of - a channel in JGroups, it also can partition the channel = into different - group names. - - - - - - - When using multiple JGroups based components - [cluster-service.xml, treecache (multiple instances)], w= hat is the - correct/valid way to configure those components to make = sure my - multicast addresses don't conflict? - - - - - There are two parameters to consider: multicast addre= ss (plus - port) and the group name. At minimum, you will have to r= un - components using a different group name. But whether to = run them on - the same channel depends upon whether the communication = performance - is critical for you or not. If it is, then it'd be best = to run them - on different channels. - - - - - - - Does JBoss Cache currently support cache persistence - storage? - - - - - Yes. Starting with release 1.1, JBoss Cache has a Cac= heLoader - interface that supports cache persistence. See below. - - - - - - - Does JBoss Cache currently support cache passivation/= overflow - to a data store? - - - - - Yes. Starting with release 1.2.4, JBoss Cache uses the - CacheLoader to support cache passivation/ overflow. See - documentation on how to configure and use this feature. - - - - - - - Is JBoss Cache thread safe? - - - - Yes, it is thread safe. - - - - - - Does JBoss Cache support XA (2PC) transactions now? - - - - No, although it is also on our to do list. Our intern= al - implementation does use a similar 2PC procedure to coord= inate a - transaction among different instances. - - - - - - - Which TransactionManagers are supported by - JBoss Cache? - - - - - JBoss Cache supports any TransactionManager that is J= TA - compliant such as JBossTM. A user can configure the tran= saction - manager through the configuration xml setting. JBossCach= e also has a - built in dummy transaction manager - ( - org.jboss.cache.tm.DummyTransactionManager - ) for - testing purposes only. But note that - DummyTransactionManager - is not thread safe .i.e., - it does not support concurrent transactions. Instead, on= ly one - transaction is allowed at a time. - - - - - - - How do I set up the cache to be transactional? - - - - You either use the default (JBoss) TransactionManager= to run - JBossCache inside JBoss, or you have to implement the - TransactionManagerLookup - interface, and return an - instance of your javax.transaction.TransactionManager. T= he - configuration property - TransactionManagerLookupClass - defines the class - to be used by the cache to fetch a reference to a - TransactionManager. It is trivial to implement this clas= s to support - other TransactionManagers. Once this attribute is specif= ied, the - cache will look up the transaction context from this tra= nsaction - manager. - - - For the client code, here is a snippet to start and c= ommit a - transaction: - - - tx =3D (UserTransaction)new InitialContext(prop).lookup(= "UserTransaction"); - tree =3D new TreeCache(); - config =3D new PropertyConfigurator(); - config.configure(tree, "META-INF/replSync-service.xml"); - - tx.begin() - tree.put(fqn, key, value); - tx.commit(); - - - - - - - How do I control the cache locking level? - - - - JBossCache lets you control the cache locking level t= hrough - the transaction isolation level. This is configured thro= ugh the - attribute - IsolationLevel - . Currently, JBossCache - employs pessimistic locking internally. And the transact= ion - isolation level from the pessimist locking corresponds t= o JDBC - isolation levels, namely, - NONE - , - READ_UNCOMMITTED - , - READ_COMMITTED - , - REPEATABLE_READ - , and - SERIALIZABLE - . Note that these isolation levels are ignored if optimi= stic locking is used. For details, please - refer - to the - user manual. - - - - - - - How does JBoss Cache lock data for concurrent access?= - - - - By default JBoss Cache uses pessimistic locking to lo= ck data nodes, based on the isolation level - configured. Since JBoss Cache 1.3.0, we also offer optim= istic locking to allow for greater concurrency - at - the cost of slight processing overhead and performance. = See the documentation for a more detailed - discussion on concurrency and locking in JBoss Cache. - - - - - - - - How do I enable Optimistic Locking in JBoss Cache? - - - - Use the XMl attribute - NodeLockingScheme - . Note that - IsolationLevel - is ignored if - NodeLockingScheme - is set to - OPTIMISTIC - . Also note that - NodeLockingScheme - defaults to - PESSIMISTIC - if omitted. - - - - - - - - How does the write lock apply to an Fqn node, say, - "/org/jboss/test"? - - - - - First of all, JBossCache has a notion of - root - that serves as a starting point for every navigational o= peration. - The default is "/" (since the default separator is "/" f= or the fqn). - The locking then is applied to the node under root, for = example - "/org" (no locking "/"). - - - Furthermore, let's say when JBossCache needs to apply= a write - lock on node "/org/jboss/test", it will first try to obt= ain read - lock from the parent nodes recursively (in this example,= "/org", and - "/org/jboss"). Only when it succeeds then it will try to= obtain a - write lock on "/org/jboss/test". - - - - - - - Can I use the cache locking level even without a tran= saction - context? - - - - - Yes. JBossCache controls the individual node locking = behavior - through the isolation level semantics. This means even i= f you don't - use a transaction, you can specify the lock level via is= olation - level. You can think of the node locking behavior outsid= e of a - transaction as if it is under transaction with - auto_commit - on. - - - - - - - With replication (REPL_SYNC/REPL_ASYNC) or invalidati= on (INVALIDATION_SYNC/INVALIDATION_ASYNC), how - often does the cache broadcast messages over the network? - - - - - If the updates are under transaction, then the broadc= asts - happen only when the transaction is about to commit (act= ually - during the prepare stage internally). That is, it will b= e a batch - update. However, if the operations are not under transac= tion - context, then each update will trigger replication. Note= that this - has performance implication if network transport is heav= y (it - usually is). - - - - - - - How can I do a mass removal? - - - - If you do a cache.remove("/root"), it will recursivel= y remove - all the entries under "/root". - - - - - - - Can I monitor and manage the JBoss Cache? - - - - With JBoss Cache 1.3.0, you can if you are running JB= oss Cache within JBoss AS or are using JDK - 5.0's - jconsole - utility. See the chapter titled - Management Information - in the JBoss Cache user guide for more details. - - - - - - - Can I disable JBoss Cache management attributes in JB= oss Cache 1.3.0? - - - - Yes, you can. Set the - UseInterceptorMbeans - configuration attribute to - false - (this defaults to - true - ). See the chapter titled - Management Information - in the JBoss Cache user guide for more details. - - - - - - - What is jboss-serialization.jar, introduced in JBoss = Cache 1.4.x and do I need this? - - - jboss-serialization.jar is the - - JBoss Serialization - - library, which is much more efficient in terms - of speed and CPU usage as well as the generated byte str= eam size than standard Java serialization. - This - very - significantly improves replication performance of custom= objects placed in the cache. - - - From 1.4.x, JBoss Cache relies on this library and it is= needed to run JBoss Cache. - - - - - - - Can I disable JBoss Serialization and revert back to = standard Java serialization? - - - - Yes you can, by passing in the - -Dserialization.jboss=3Dfalse - environment variable to your JVM. - - - - - - - - Does JBoss Cache support partitioning? - - - - Not right now. JBoss Cache does not support partition= ing that a - user can configure to have different set of data residin= g on - different cache instances while still participating as a= replication - group. - - - - - - - Does JBoss Cache handle the concept of application cl= assloading - inside, say, a J2EE container? - - - - - Application-specific classloading is used widely insi= de a J2EE - container. For example, a web application may require a = new - classloader to scope a specific version of the user libr= ary. - However, by default JBoss Cache is agnostic to the class= loader. In - general, this leads to two kinds of problems: - - - - - Object instance is stored in cache1 and replica= ted to - cache2. As a result, the instance in cache2 is cre= ated by the - system classloader. The replication may fail if th= e system - classloader on cache2 does not have access to the = required - class. Even if replication doesn't fail, a user th= read in cache2 - may not be able to access the object if the user t= hread is - expecting a type defined by the application classl= oader. - - - - - Object instance is created by thread 1 and will= be - accessed by thread 2 (with two different classload= ers). - JBossCache has no notion of the different classloa= ders involved. - As a result, you will have a - ClassCastException - . This is a standard - problem in passing an object from one application = space to - another; JBossCache just adds a level of indirecti= on in passing - the object. - - - - - To solve the first kind of issue, in JBoss Cache 1.2.= 4 we - introduced the concept of a - TreeCacheMarshaller - . - Basically, this allows application code to register a cl= assloader - with a portion of the cache tree for use in handling obj= ects - replicated to that portion. See the TreeCacheMarshaller = section of - the user guide for more details. - - - To solve the second kind of issue, the only solution = (that we - know of) is to cache "serialized" byte code and only de-= serialize it - during every object get (and this will be expensive!). T= hat is, - during a put operation, the object instance will be seri= alized and - therefore can be deserialized safely by a "foreign" clas= sloader. - However, the performance penalty of this approach is qui= te severe so - in general another local in-vm version will need to be u= sed as a - "near-line" cache. Note also that each time the serializ= ed bytes are - deserialized, a new instance of the object is created. - - - To help with this kind of handling, JBoss has a utili= ty class - called - MarshalledValue - that wraps around the - serialized object. Here is a code snippet that illustrat= es how you - can create a wrapper around JBossCache to handle the cla= ssloader - issue: - - - import org.jboss.invocation.MarshalledValue; - - public class CacheService { - private TreeCache cache_; - - public object get(Fqn fqn, String key) { - return getUnMarshalledValue(cache_.get(fqn, key)); - } - - public object set(Fqn fqn, String key, Object value) { - cache_.put(fqn, key, getMarshalledValue(value)); - return value; // only if successful - } - - ... - - private Object getUnMarshalledValue(object value) { - // assuming we use the calling thread context classloader - return ((MarshalledValue)value).get(); - } - - private Object getMarshalledValue(Object value) { - return new MarshalledValue(value); - } - } - - - - - - - - Does JBoss Cache currently support pre-event and post= -event - notification? - - - - - Yes. Starting with release 1.2.4, JBoss Cache has int= roduced - ExtendedTreeCacheListener which takes in consideration p= re and post - event notification. See documentation for more details. = Note that - TreeCacheListener and ExtendedTreeCacheListener will be = merged into - TreeCacheListener in release 1.3. - - - - - - - How do I implement a custom listener to listen to - TreeCache - events? - - - - - You create a class (myListener) that extends - AbstractTreeCacheListener and provide concrete implement= ation for - the node events that you are interested in. Then you add= this - listener to the TreeCache instance on startup to listen = to the - events as they occur by calling - TreeCache.addTreeCacheListener(myListener). - - - - public class MyListener extends AbstractTreeCacheListener - { - ... - - public void nodeModify(Fqn fqn, boolean pre, boolean isLocal) { - if(log.isTraceEnabled()){ - if(pre) - log.trace("Event DataNode about to be modified: " + fqn); - else - log.trace("Event DataNode modified: " + fqn); - } - } - - ... - } - - - - - - - Can I use useRegionBasedMarshalling attribute in JBoss Cache in order to get - around ClassCastExceptions happening when accessing data= in the cache that has just been redeployed? - - - - - Yes, you can. Originally, TreeCache Marshalling was designed as a - workaround for those replicated caches that upon state t= ransfer did not have access to the - classloaders defining the objects in the cache. - - - On each deployment, JBoss creates a new classloader p= er the top level deployment artifact, for - example an EAR. You also have to bear in mind that a cla= ss in an application server is defined not - only by the class name but also its classloader. So, ass= uming that the cache is not deployed as part - of your deployment, you could deploy an application and = put instances of classes belonging to this - deployment inside the cache. If you did a redeployment a= nd try to do a get operation of the data - previously put, this would result on a ClassCastExceptio= n. This is because even though the class names - are the same, the class definitions are not. The current= classloader is different to the one when - the classes were originally put. - - - By enabling marshalling, you can control the lifecycl= e of the data in the cache and if on - undeployment, you inactivate the region and unregister t= he classloader that you'd have registered on - deployment, you'd evict the data in the cache locally. T= hat means that in the next deployment, the - data won't be in the cache, therefore avoiding the probl= em. Obviously, using marshalling to get - around this problem is only recommended when you have so= me kind of persistence backing where the data - survives, for example using CacheLoaders, or when JBossC= ache is used as a second level cache in a - persistence framework. = - - - To implement this feature, please follow the instruct= ions indicated in the example located - in the TreeCacheMarshaller section of the user's guide. = It's worth noting that instead of a - ServletContextListener, you could add= this code into an MBean - that contained lifecycle methods, such as start= () and stop(). - The key would be for this MBean to depend on the target = cache, so that it can operate as long as the - cache is up and running. - - - - - - - - JBoss Cache - Pojo Cache - - - - - - What is PojoCache? - - - - PojoCache (currently implemented PojoCache as a sub-c= lass of - TreeCache) is a fine-grained field-level replicated and - transactional POJO (plain old Java object) cache. By POJ= O, we mean - that the cache: 1) automatically manages object mapping = and - relationship for a client under both local and replicate= d cache - mode, 2) provides support for inheritance relationship b= etween - "aspectized" POJOs. By leveraging the dynamic AOP in JBo= ssAop, it is - able to map a complex object into the cache store, prese= rve 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 perfor= mance and - minimize network traffic. - - - 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, p= roviding - ease of use. For example, if a POJO has been put in Pojo= Cache (by - calling putObject, for example), then any get/set method= will be - intercepted by PojoCache to provide the data from the - cache. - - - - - - - What's the relationship between PojoCache and TreeCac= heAop classes? - - - - Since release 1.4, we have created a new class called= PojoCache (to better reflect the - cache nature). The old implementation TreeCacheAop has b= een deprecated. - - - - - - - Does PojoCache have all the functional capabilities of - TreeCache? - - - - - Yes. PojoCache extends TreeCache so it has all the sa= me - features TreeCache such as cache mode, transaction isola= tion level, - and eviction policy. - - - - - - - What is the difference between TreeCache and - PojoCache? - - - - - Think of PojoCache as a TreeCache on steroids. :-) - Seriously, both are cache stores-- one is a generic cach= e and the other other one POJO Cache. - However, while TreeCache only - provides pure object reference storage (e.g., - put(FQN fqn, - Object key, Object value) - - ), 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 t= o cache, you - can have PojoCache manage it for you. You simply treat y= our - object systems as they are residing in-memory, e.g., use= your - regular POJO methods without worrying about cache manage= ment. - Furthermore, this is true in replication mode as well. - - - - - - - What are the steps to use the PojoCache feature? - - - - 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: - - - - - prepare POJO. You can do either via xml declara= tion 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 i= t. - - - - instrumentation. You will need to instrument yo= ur POJO either at compile-time or load-time. - If you do it during compile-time, you use so-calle= d aop pre-compiler (aopc) to do bytecode - manipulation. - If you do it via load-time, however, you need eith= er a special system class loader or, in JDK50, - you can - use the javaagent option. - - - - 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 exa= mple, please refer to the distro examples - directory. - There are numerous PojoCache examples that uses differen= t options. - - - - - - - Can I run PojoCache in JBoss AS 3.2.x application - server? - - - - - Yes and no. Yes, since JBossAop can also be back-port= ed 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. - - - - - - - Can PojoCache run as a MBean as well? - - - - Yes. It is almost the same as TreeCache MBean. The on= ly - difference is the object name and the class name. E.g., = instead - of - <mbean code=3D"org.jboss.cache.TreeCa= che" - name=3D"jboss.cache:service=3DTreeCache"> - you will have: - <mbean code=3D"org.jboss.cache.aop.Po= joCache" - name=3D"jboss.cache:service=3DPojoCache"> - in the xml configuration file. - - - - - - - Can I pre-compile the aop classes such that I don't n= eed to - use the system classloader and jboss-aop configuration x= ml? - - - - - Yes. The latest versions of JBossCache have a pre-com= piler - option called - aopc - . You can use this option to - pre-compile your "aspectized" POJO. Once the classes hav= e been byte - code generated, they can be treated as regular class fil= es, i.e., - you will not need to include any - jboss-aop.xml - that specifies the advisable POJO and to specify the JBo= ssAop system - class loader. - - - For an example of how to use - aopc - , please - see 1) - tools - directory for PojoCacheTasks14.xml - and PojoCacheTasks50.xml. Both contain Ant tasks that yo= u can - import to your regular project for - annoc - and - aopc - . In addition, please also check out the - examples - directory for concrete examples. - - - - - - - How do I use aopc on multiple module directories? - - - - In aopc, you specify the src path for a specific dire= ctory. To - pre-compile multiple ones, you will need to invoke aopc = multiple - times. - - - - - - - What's in the - jboss-aop.xml - configuration? - - - - - - jboss-aop.xml - is needed for POJO - instrumentation. In - jboss-aop.xml - , you can - declare your POJO (e.g., - Person - ) to be - "prepared", a JBossAop term to denote that the object wi= ll be - "aspectized" by the system. After this declaration, JBos= sAop will - invoke any interceptor that associates with this POJO. P= ojoCache - will dynamically add an - org.jboss.cache.aop.CacheInterceptor - to this POJO - to perform object mapping and relationship management. - - - Note that to add your POJO, you should declare all th= e fields - to be "prepared" as in the example. - - - - - - - Can I use annotation instead of the xml declaration?<= /para> - - - - Yes, starting with JBossCache 1.3, you can use annota= tion to - instrument your POJO for both JDK1.4 and 1.5. Check the = documentation for details. - - - - - - - What are the pro and con of xml vs. annotation? - - - - 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. - - - - - - - What are the - @org.jboss.cache.aop.annotation.Transient - and - @org.jboss.cache.aop.annotation.Serializable - field level annotations? - - - - - Starting in 1.4, we also offer two additional field-l= evel annotations. The first one, - @Transient - , - when applied has the same effect as declaring a field - transient - . PojoCache - won't put this field under management. - - The second one, - @Serializable - when applied, will cause PojoCache to - treat the field as a Serializable object even when it is - @PojoCacheable - . - - - - - - - What about compile-time vs. load-time instrumentation= then? - - - - 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. - - - - - - - Is it possible to store the same object multiple time= s but - with different Fqn paths? Like /foo/byName and /foo/byId= ? - - - - - 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. - - - - - - - Do I need to declare all my objects "prepared" in - jboss-aop.xml - ? - - - - - 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 dec= laration. - The cache will treat this object as a "primitive" type. = However, the - object will need to implement - Serializable - interface for replication. - - - - - - - Can the cache aop intercept update via reflection? - - - - No. The update via reflection will not be intercepted= in - JBossAop and therefore PojoCache will not be able to per= form the - necessary synchronization. - - - - - - - When I declare my POJO to be "aspectized", what happe= ns to the - fields with transient, static, and final modifiers? - - - - - PojoCache currently will ignore the fields with these - modifiers. That is, it won't put these fields into the c= ache (and - thus no replication either). - - - - - - - What are those keys such as - JBoss:internal:class - and - AOPInstance - ? - - - - - They are for internal use only. Users should ignore t= hese keys - and values in the node hashmap. - - - - - - - What about Collection classes? Do I need to declare t= hem - "prepared"? - - - - - No. Since the Collection classes such as - ArrayList - 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 t= he - putObject - call is invoked). The proxy will - delegate the operations to a cache interceptor that impl= ements the - actual Collection classes APIs. That is, the system clas= ses won't be - invoked when used in PojoCache. - - - 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 certa= in APIs. For - example, both - ArrayList - and - LinkedList - will have the same implementation. - Plan is currently underway to optimize these APIs. - - - - - - - How do I use - List - , - Set - , - and - Map - dynamic proxy? - - - - - PojoCache supports classes extending from - List - , - Set - , and - Map - without users to declare them "aspectized". - It is done via a dynamic proxy. Here is a code snippet t= o use an - ArrayList - proxy class. - - - ArrayList list =3D 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 POJ= O. - - ArrayList myList =3D (List)cache.getObject("/list/test"); = - // we are getting a dynamic proxy instead - myList.add("second"); = - // it works now - myList.add("third"); - myList.remove("third"); - - - - - - - What is the proper way of assigning two different key= s with - Collection class object? - - - - - Let's say you want to assign a - List - object - under two different names, you will need to use the clas= s proxy to - insert the second time to ensure both are managed by the= cache. Here - is the code snippet. - - - ArrayList list =3D new ArrayList(); - list.add("first"); - - cache.putObject("/list", list); = - // Put the list under the aop cache - - ArrayList myList =3D (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"); - - - - - - - OK, so I know I am supposed to use proxy when manipul= ating the - Collection classes once they are managed by the cache. B= ut what - happens to Pojos that share the Collection objects, e.g.= , a - List - instance that is shared by 2 Pojos? - - - - - Pojos that share Collection instance references will = be - handled by the cache automatically. That is, when you as= k the Cache - to manage it, the Cache will dynamically swap out the re= gular - Collection references with the dynamic proxy ones. As a = result, it - is transparent to the users. - - - - - - - What happens when my "aspectized" POJO has field memb= ers that - are of Collection class ? - - - - - When a user puts a POJO into the cache through the ca= ll - putObject - , it will recursively map the field - members into the cache store as well. When the field mem= ber is of a - Collection class (e.g., List, Set, or Map), PojoCache wi= ll first - map the collection into cache. Then, it will swap out dy= namically - the field reference with an corresponding proxy referenc= e. - - - This is necessary so that an internal update on the f= ield - member will be intercepted by the cache. - - - - - - - - What are the limitation of Collection classes in Pojo= Cache? - - - - Use of Collection class in PojoCache helps you to tra= ck fine-grained changes - in your collection fields automatically. However, curren= t implementation has the follow - limitation that we plan to address soon. - - Currently, we only support a limited implementation o= f Collection classes. That is, - we support APIs in List, Set, and Map. However, since th= e 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 o= ther implementation would not. - The Set interface maps to java.util.HashSet implementati= on. The List interface maps - to java.util.ArrayList implementation. The Map interface= maps to java.util.HashMap - implementation. - - Another related issue is the expected performance. Fo= r example, the current implementation is - ordered, - so - that makes insert/delete from the Collection slow. Perfo= rmance between Set, Map and List collections - also - vary. - Adding items to a Set is slower than a List or Map, sinc= e Set does not allow duplicate entries. - - - - - - - - What are the pros and cons of PojoCache? - - - - As mentioned in the reference doc, PojoCache has the = following advantages: - - - Fine-grained replication and/or persistency. If= you use a distributed PojoCache - and once your POJO is put in the cache store, ther= e 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. - - - - Fine-grained replication can have potential per= formance gain if your POJO is big and - the changes are fine-grained, e.g., only to some s= elected fields. - - - - POJO can posses object relationship, e.g., mult= iple referenced. Distributed - PojoCache will handle this transparently for you. - - - - And here are some cases that you may not want to use = PojoCache: - - - You use only cache. That is you don't need repl= ication or persistency. Then since - everything is operated on the in-memory POJO refer= ence, there is no need for PojoCache. - - - - You have simple and small POJOs. Your POJO is s= mall in size and also there is no - object relationship, then PojoCache possess not cl= ear advantage to plain cache. - - - - Your application is bounded by memory usage. Be= cause PojoCache need almost twice as much - of memory (the original POJO in-memory space and a= lso the additional cache store for the - primitive fields), you may not want to use PojoCac= he. - - - - 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. - - - - - - - - - Eviction Policies - - - - - - - Does JBoss Cache support eviction policies? - - - - Yes. JBoss Cache currently implements a LRU eviction = policy for - both TreeCache - ( - org.jboss.cache.eviction.LRUPolicy - ) and - PojoCache - ( - org.jboss.cache.aop.eviction.AopLRUPolicy - ). Users - can also plug in their own eviction policy algorithms. S= ee user - manual for details. Currently there is user-contributed = policy - called - FIFOPolicy - that evicts the node based on - FIFO principle only. - - - - - - - Why can't I use - org.jboss.cache.eviction.LRUPolicy - for - PojoCache as well? - - - - - For PojoCache, you will need to use - org.jboss.cache.aop.eviction.AopLRUPolicy - ) because - AOP has its eviction algorithm, although is LRU but has = totally - different notion of an "object", for example. - - - - - - - Does JBoss Cache's implemented LRU eviction policy op= erates in - replication mode? - - - - - Yes and no. :-) - - The LRU 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 obtai= n the cached - contents of an evicted node and finds out that is null (= e.g., - get - returns null), it should get it from the - other data source and re-populate the data in the cache.= During this - moment, the node content will be propagated and the cach= e content - will be in sync. - - - However, you still can run eviction policies with cac= he mode - set to either - REPL_SYNC - or - REPL_ASYNC - . Depending on your use case, you can - set multiple cache instances to have their own eviction = policy - (which are applied locally) or just have selected instan= ces with - eviction policies activated. - - - Also note that, with cache loader option, a locally e= victed - node can also be persisted to the backend store and a us= er can - retrieve it from the store later on. - - - - - - - Does JBoss Cache support - Region - ? - - - - - Yes. JBoss Cache has the notion of region where a use= r can - configure the eviction policy parameters (e.g., - maxNodes - or - timeToIdleSeconds - ) - - - A region in JBoss Cache denotes a portion of tree hie= rarchy, - e.g., a fully qualified name ( - FQN - ). For example, - a user can define - /org/jboss - and - /org/foocom - as two separate regions. But note - that you can configure the region programmatically now, = i.e., - everything has to be configured through the xml file. - - - - - - - What are the - EvictionPolicyConfig - tag - parameters for - org.jboss.cache.eviction.LRUPolicy - ? - - - - - They are: - - - - Parameters - - - - - wakeUpIntervalInSeconds - - Interval where the clean up thread wakes= to process - the sitting queue and sweep away the old dat= a. - - - - - region - - A area where each eviction policy parame= ters are - specified. Note that it needs a minimum of - /_default - region. - - - - - maxNodes - - Max number of nodes allowed in the evict= ion queue. 0 - means no limit. - - - - - timeToLiveInSeconds - - Age (in seconds) for the node to be evic= ted in the - queue. 0 denotes no limit. - - - - -
-
-
- - - - I have turned on the eviction policy, why do I still = get "out - of memory" (OOM) exception? - - - - - OOM can happen when the speed of cache access exceeds= the - speed of eviction policy handling timer. Eviction policy= handler - will wake up every - wakeUpIntervalInSeconds - seconds to process the eviction event queue. And the que= ue size is - fixed at 20000 now. So when the queue size is full, it w= ill create a - backlog and cause OOM to happen unless the eviction time= r catches - up. To address this problem, in addition to increase the= VM heap - size, you can also reduce the - wakeUpIntervaleInSeconds - so the timer thread - processes the queue more frequently. - - - We will also externalize the queue size so it will be - configurable in the next release. - - - -
-
- - Cache Loaders - - - - - - - What is a CacheLoader? - - - - A CacheLoader is the connection of JBossCache to a - (persistent) data store. The CacheLoader is called by JB= ossCache to - fetch data from a store when that data is not in the cac= he, and when - modifications are made to data in the cache the CacheLoa= der is - called to store those modifications back to the store. - - - In conjunction with eviction policies, JBossCache wit= h a - CacheLoader allows a user to maintain a bounded cache fo= r a large - backend datastore. Frequently used data is fetched from = the - datastore into the cache, and the least used data is evi= cted, in - order to provide fast access to frequently accessed data= . This is - all configured through XML, and the programmer doesn't h= ave to take - care of loading and eviction. - - - JBossCache currently ships with several CacheLoader - implementations, including: - - - - - - FileCacheLoader: this implementation uses th= e file - system to store and retrieve data. JBossCache n= odes are mapped - to directories, subnodes to subdirectories etc.= Attributes of - a node are mapped to a file - data - inside the - directory. - - - - - BdbjeCacheLoader: this implementation is bas= ed on the - Sleepycat Java Edition database, a fast and eff= icient - transactional database. It uses a single file f= or the entire - store. Note that if you use Sleepycat's CacheLo= ader with - JBoss Cache and wish to ship your product, you = will have to acquire a - commercial license from Sleepycat - - . - - - - - JDBCCacheLoader: this implementation uses th= e relational database as the persistent - storage. - - - - - ClusteredCacheLoader: this implementation qu= eries the rest of the cluster, treating other - servers' in-memory state as a data store. - - - - - And more. See the documentation for more det= ails. - - - - - - - - - Can writing to CacheLoaders be asynchronous? - - - - As of JBossCache 1.2.4, yes. Set the CacheLoaderAsync= hronous - property to true. See the JBossCache documentation for a= more - detailed discussion. By default though, all cache loader= writes are - synchronous and will block. - - - - - - - Can I write my own CacheLoader ? - - - - Yes. A CacheLoader is a class implementing - org.jboss.cache.loader.CacheLoader - . It is - configured via the XML file (see JBossCache and Tutorial - documentation). - - - - - - - Does a CacheLoader have to use a persistent store ? - - - - No, a CacheLoader could for example fetch (and possib= ly store) - its data from a webdav-capable webserver. Another exampl= e is a - caching proxy server, which fetches contents from the we= b. Note that - an implementation of CacheLoader may not implement the '= store' - functionality in this case, but just the 'load' - functionality. - - - - - - - What can I use a CacheLoader for? - - - - Some applications: - - - - - HTTP sessions can be persisted (besides bein= g replicated - by JBossCache). The CacheLoader can be configur= ed to be - shared, or unshared, meaning that every node in= a cluster has - its own local store. It is also possible to att= ach a - CacheLoader to just - one - of the - nodes. - - - - - Simple persistence for POJOs. Use of JBossCa= che aop and - a local CacheLoader persist POJOs transparently= into the store - provided by the CacheLoader. - - - - - Highly available replicated and persisted da= ta store. - The service is up as long as at least 1 node is= running, but - even if all nodes are taken offline, when the f= irst node is - started again, the data previously saved will s= till be - available (e.g. a shopping cart). - - - - - A caching web proxy (a la Squid): all data a= re contents - of URLs, users access the proxy, and if the URL= is not in the - cache, the CacheLoader fetches it from the web.= This could - actually be a replicated and transactional vers= ion of - Squid. - - - - - - - - - - How do I configure JBossCache with a CacheLoader? - - - - Through XML: both the fully-qualified classname of the - CacheLoader and its configuration string have to be give= n. - JBossCache will then instantiate a CacheLoader. See JBos= sCache - documentation for details. - - - - - - - Do I have to pay to use Sleepycat's CacheLoader? - - - - Not if you use it only for personal use. As soon as y= ou - distribute your product with BdbjeCacheLoader, you have = to purchase - a commercial license from Sleepycat. See details at - http://www.sleepycat.com/jeforjbosscache - - . - - - - - - - Can I use more than one cache loader? - - - - As of JBossCache 1.3.0, yes. With the new CacheLoader= Configuration XML - element (see user manual section on cache loaders) you c= an now - describe several cache loaders. The impact is that the c= ache will - look at all of the cache loaders in the order they've be= en - configured, until it finds a valid, non-null element of = data. When - performing writes, all cache loaders are written to (exc= ept if the - ignoreModifications element has been set to true for a s= pecific - cache loader. - - - - - - - Why do cache loaders go into an inconsistent state wh= en I use transactions, pessimistic locking, - and I - attempt to read a node after removing it from within the= same transaction scope? - - - - - This is a known bug (see - JBCACHE-477 - and - JBCACHE-352 - ), which have been fixed in JBoss Cache 1.4.0. A very si= mple workaround if you're using JBoss Cache - 1.3.x - is to use optimistic locking. - - - One of the consequences of this bug is that, for example= , if you use PojoCache with pojos that have - private references to a List and you update and remove s= omeelements of that List within a transaction - (when using pessimistic locking and a cache loader), you= may see IllegalStateExceptions thrown. - - - - - - - - - Troubleshooting - - - - - I am having problems getting JBoss Cache to work, whe= re can I get information on troubleshooting? - - - - Troubleshooting section can be found in the following - wiki link - . - - - - - - - -
+ + + + + + + + + Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Pojo_Cache.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Pojo_Cache.xml = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Pojo_Cache.xml 200= 9-11-16 06:45:01 UTC (rev 8285) @@ -0,0 +1,641 @@ + + + + + JBoss Cache - Pojo Cache + + + + + + What is PojoCache? + + + + PojoCache (currently implemented PojoCache as a sub-c= lass of + TreeCache) is a fine-grained field-level replicated and + transactional POJO (plain old Java object) cache. By POJ= O, we mean + that the cache: 1) automatically manages object mapping = and + relationship for a client under both local and replicate= d cache + mode, 2) provides support for inheritance relationship b= etween + "aspectized" POJOs. By leveraging the dynamic AOP in JBo= ssAop, it is + able to map a complex object into the cache store, prese= rve 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 perfor= mance and + minimize network traffic. + + + 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, p= roviding + ease of use. For example, if a POJO has been put in Pojo= Cache (by + calling putObject, for example), then any get/set method= will be + intercepted by PojoCache to provide the data from the + cache. + + + + + + + What's the relationship between PojoCache and TreeCac= heAop classes? + + + + Since release 1.4, we have created a new class called= PojoCache (to better reflect the + cache nature). The old implementation TreeCacheAop has b= een deprecated. + + + + + + + Does PojoCache have all the functional capabilities of + TreeCache? + + + + + Yes. PojoCache extends TreeCache so it has all the sa= me + features TreeCache such as cache mode, transaction isola= tion level, + and eviction policy. + + + + + + + What is the difference between TreeCache and + PojoCache? + + + + + Think of PojoCache as a TreeCache on steroids. :-) + Seriously, both are cache stores-- one is a generic cach= e and the other other one POJO Cache. + However, while TreeCache only + provides pure object reference storage (e.g., + put(FQN fqn, + Object key, Object value) + + ), 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 t= o cache, you + can have PojoCache manage it for you. You simply treat y= our + object systems as they are residing in-memory, e.g., use= your + regular POJO methods without worrying about cache manage= ment. + Furthermore, this is true in replication mode as well. + + + + + + + What are the steps to use the PojoCache feature? + + + + 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: + + + + + prepare POJO. You can do either via xml declara= tion 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 i= t. + + + + instrumentation. You will need to instrument yo= ur POJO either at compile-time or load-time. + If you do it during compile-time, you use so-calle= d aop pre-compiler (aopc) to do bytecode + manipulation. + If you do it via load-time, however, you need eith= er a special system class loader or, in JDK50, + you can + use the javaagent option. + + + + 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 exa= mple, please refer to the distro examples + directory. + There are numerous PojoCache examples that uses differen= t options. + + + + + + + Can I run PojoCache in JBoss AS 3.2.x application + server? + + + + + Yes and no. Yes, since JBossAop can also be back-port= ed 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. + + + + + + + Can PojoCache run as a MBean as well? + + + + Yes. It is almost the same as TreeCache MBean. The on= ly + difference is the object name and the class name. E.g., = instead + of + <mbean code=3D"org.jboss.cache.TreeCa= che" + name=3D"jboss.cache:service=3DTreeCache"> + you will have: + <mbean code=3D"org.jboss.cache.aop.Po= joCache" + name=3D"jboss.cache:service=3DPojoCache"> + in the xml configuration file. + + + + + + + Can I pre-compile the aop classes such that I don't n= eed to + use the system classloader and jboss-aop configuration x= ml? + + + + + Yes. The latest versions of JBossCache have a pre-com= piler + option called + aopc + . You can use this option to + pre-compile your "aspectized" POJO. Once the classes hav= e been byte + code generated, they can be treated as regular class fil= es, i.e., + you will not need to include any + jboss-aop.xml + that specifies the advisable POJO and to specify the JBo= ssAop system + class loader. + + + For an example of how to use + aopc + , please + see 1) + tools + directory for PojoCacheTasks14.xml + and PojoCacheTasks50.xml. Both contain Ant tasks that yo= u can + import to your regular project for + annoc + and + aopc + . In addition, please also check out the + examples + directory for concrete examples. + + + + + + + How do I use aopc on multiple module directories? + + + + In aopc, you specify the src path for a specific dire= ctory. To + pre-compile multiple ones, you will need to invoke aopc = multiple + times. + + + + + + + What's in the + jboss-aop.xml + configuration? + + + + + + jboss-aop.xml + is needed for POJO + instrumentation. In + jboss-aop.xml + , you can + declare your POJO (e.g., + Person + ) to be + "prepared", a JBossAop term to denote that the object wi= ll be + "aspectized" by the system. After this declaration, JBos= sAop will + invoke any interceptor that associates with this POJO. P= ojoCache + will dynamically add an + org.jboss.cache.aop.CacheInterceptor + to this POJO + to perform object mapping and relationship management. + + + Note that to add your POJO, you should declare all th= e fields + to be "prepared" as in the example. + + + + + + + Can I use annotation instead of the xml declaration?<= /para> + + + + Yes, starting with JBossCache 1.3, you can use annota= tion to + instrument your POJO for both JDK1.4 and 1.5. Check the = documentation for details. + + + + + + + What are the pro and con of xml vs. annotation? + + + + 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. + + + + + + + What are the + @org.jboss.cache.aop.annotation.Transient + and + @org.jboss.cache.aop.annotation.Serializable + field level annotations? + + + + + Starting in 1.4, we also offer two additional field-l= evel annotations. The first one, + @Transient + , + when applied has the same effect as declaring a field + transient + . PojoCache + won't put this field under management. + + The second one, + @Serializable + when applied, will cause PojoCache to + treat the field as a Serializable object even when it is + @PojoCacheable + . + + + + + + + What about compile-time vs. load-time instrumentation= then? + + + + 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. + + + + + + + Is it possible to store the same object multiple time= s but + with different Fqn paths? Like /foo/byName and /foo/byId= ? + + + + + 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. + + + + + + + Do I need to declare all my objects "prepared" in + jboss-aop.xml + ? + + + + + 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 dec= laration. + The cache will treat this object as a "primitive" type. = However, the + object will need to implement + Serializable + interface for replication. + + + + + + + Can the cache aop intercept update via reflection? + + + + No. The update via reflection will not be intercepted= in + JBossAop and therefore PojoCache will not be able to per= form the + necessary synchronization. + + + + + + + When I declare my POJO to be "aspectized", what happe= ns to the + fields with transient, static, and final modifiers? + + + + + PojoCache currently will ignore the fields with these + modifiers. That is, it won't put these fields into the c= ache (and + thus no replication either). + + + + + + + What are those keys such as + JBoss:internal:class + and + AOPInstance + ? + + + + + They are for internal use only. Users should ignore t= hese keys + and values in the node hashmap. + + + + + + + What about Collection classes? Do I need to declare t= hem + "prepared"? + + + + + No. Since the Collection classes such as + ArrayList + 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 t= he + putObject + call is invoked). The proxy will + delegate the operations to a cache interceptor that impl= ements the + actual Collection classes APIs. That is, the system clas= ses won't be + invoked when used in PojoCache. + + + 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 certa= in APIs. For + example, both + ArrayList + and + LinkedList + will have the same implementation. + Plan is currently underway to optimize these APIs. + + + + + + + How do I use + List + , + Set + , + and + Map + dynamic proxy? + + + + + PojoCache supports classes extending from + List + , + Set + , and + Map + without users to declare them "aspectized". + It is done via a dynamic proxy. Here is a code snippet t= o use an + ArrayList + proxy class. + + + ArrayList list =3D 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 =3D (List)cache.getObject("/list/test"); = + // we are getting a dynamic proxy instead + myList.add("second"); = + // it works now + myList.add("third"); + myList.remove("third"); + + + + + + + What is the proper way of assigning two different key= s with + Collection class object? + + + + + Let's say you want to assign a + List + object + under two different names, you will need to use the clas= s proxy to + insert the second time to ensure both are managed by the= cache. Here + is the code snippet. + + + ArrayList list =3D new ArrayList(); + list.add("first"); + + cache.putObject("/list", list); = + // Put the list under the aop cache + + ArrayList myList =3D (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"); + + + + + + + OK, so I know I am supposed to use proxy when manipul= ating the + Collection classes once they are managed by the cache. B= ut what + happens to Pojos that share the Collection objects, e.g.= , a + List + instance that is shared by 2 Pojos? + + + + + Pojos that share Collection instance references will = be + handled by the cache automatically. That is, when you as= k the Cache + to manage it, the Cache will dynamically swap out the re= gular + Collection references with the dynamic proxy ones. As a = result, it + is transparent to the users. + + + + + + + What happens when my "aspectized" POJO has field memb= ers that + are of Collection class ? + + + + + When a user puts a POJO into the cache through the ca= ll + putObject + , it will recursively map the field + members into the cache store as well. When the field mem= ber is of a + Collection class (e.g., List, Set, or Map), PojoCache wi= ll first + map the collection into cache. Then, it will swap out dy= namically + the field reference with an corresponding proxy referenc= e. + + + This is necessary so that an internal update on the f= ield + member will be intercepted by the cache. + + + + + + + + What are the limitation of Collection classes in Pojo= Cache? + + + + Use of Collection class in PojoCache helps you to tra= ck fine-grained changes + in your collection fields automatically. However, curren= t implementation has the follow + limitation that we plan to address soon. + + Currently, we only support a limited implementation o= f Collection classes. That is, + we support APIs in List, Set, and Map. However, since th= e 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 o= ther implementation would not. + The Set interface maps to java.util.HashSet implementati= on. The List interface maps + to java.util.ArrayList implementation. The Map interface= maps to java.util.HashMap + implementation. + + Another related issue is the expected performance. Fo= r example, the current implementation is + ordered, + so + that makes insert/delete from the Collection slow. Perfo= rmance between Set, Map and List collections + also + vary. + Adding items to a Set is slower than a List or Map, sinc= e Set does not allow duplicate entries. + + + + + + + + What are the pros and cons of PojoCache? + + + + As mentioned in the reference doc, PojoCache has the = following advantages: + + + Fine-grained replication and/or persistency. If= you use a distributed PojoCache + and once your POJO is put in the cache store, ther= e 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. + + + + Fine-grained replication can have potential per= formance gain if your POJO is big and + the changes are fine-grained, e.g., only to some s= elected fields. + + + + POJO can posses object relationship, e.g., mult= iple referenced. Distributed + PojoCache will handle this transparently for you. + + + + And here are some cases that you may not want to use = PojoCache: + + + You use only cache. That is you don't need repl= ication or persistency. Then since + everything is operated on the in-memory POJO refer= ence, there is no need for PojoCache. + + + + You have simple and small POJOs. Your POJO is s= mall in size and also there is no + object relationship, then PojoCache possess not cl= ear advantage to plain cache. + + + + Your application is bounded by memory usage. Be= cause PojoCache need almost twice as much + of memory (the original POJO in-memory space and a= lso the additional cache store for the + primitive fields), you may not want to use PojoCac= he. + + + + 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. + + + + + + + \ No newline at end of file Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Tree_Cache.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Tree_Cache.xml = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Tree_Cache.xml 200= 9-11-16 06:45:01 UTC (rev 8285) @@ -0,0 +1,927 @@ + + + + + JBoss Cache - Tree Cache + + + + How do I deploy JBoss Cache as a MBean service? + + + + To deploy JBoss Cache as an MBean inside JBoss, you c= an copy the + configuration xml file over to the + deploy + directory (from + all + configuration whereby the + necessary jars are present). Under the standalone package + etc/META-INF + directory , there are example + configuration files for different cache modes that can b= e used to + deploy JBoss Cache as well. + + + + + + + How do I know if my JBoss Cache MBean has been deploy= ed? + + + + To verify that your JBoss Cache MBean is deployed cor= rectly, + you can first check the log output under the command con= sole. Next + you can verify it from JBoss JMX console. Look for + jboss.cache + domain. + + + + + + + How do I access the JBoss Cache MBean? + + + + Accessing the JBoss Cache MBean is just like accessin= g any + JBoss MBean. Here is a code snippet: + + + + import org.jboss.mx.util.MBeanServerLocator; + import org.jboss.mx.util.MBeanProxyExt; + import org.jboss.cache.TreeCacheMBean; + import javax.management.MBeanServer; + ... + = + MBeanServer server; + TreeCacheMBean cache; + = + public init() throws Exception + { + try + { + server =3D MBeanServerLocator.locateJBoss(); + cache =3D (TreeCacheMBean) MBeanProxyExt.create(TreeCacheMBean.cla= ss, + "jboss.cache:service=3DTreeCache", + server); + } + catch (Exception ex) + { + // handle exception + } + } + = + public void myBusinessMethod() + { + Object value =3D cache.get("/my/node", "myKey"); + = + HashMap stuff =3D new HashMap(); + stuff.put("key1", "value1"); + stuff.put("key2", "value2"); + stuff.put("key3", "value3"); + = + cache.put("/my/new/node", stuff); + = + cache.remove("/my/node"); + = + ... + } + = + + + + + + + Can I run JBoss Cache on JBoss AS 3.2.x releases? + + + + Yes. The JBoss Cache source code is also up to date o= n the + jboss-3.2 CVS branch. However, only TreeCache is support= ed there + since JBossAop (which PojoCache relies on) is only avail= able in JBoss AS 4.x onwards. + + + + + + + Can I run multiple JBoss Cache instances on the same = VM? + + + + Yes. There are some scenarios where you may want to r= un + multiple instances of JBoss Cache. For example, you want= to run + multiple local cache instances with each instance having= its own + configuration (e.g., different cache policy). In this ca= se, you will + need multiple xml configuration files. + + + + + + + Can TreeCache run as a second level cache inside + Hibernate? + + + + + Yes. Since Hibernate 3.0 release, you can configure i= t to use + JBoss Cache (namely, TreeCache) as a second level cache.= For details, + see Hibernate documentation, and also see + + http://wiki.jboss.org/wiki/Wiki.jsp?page=3DJBossCache= Hibernate + + + + Note that since Hibernate 3.0.2 and JBossCache 1.2.2,= we have + fixed a critical bug that depending on the usage pattern= can cause + deadlock during query caching. + + + + + + + What about using PojoCache as a Hibernate cache? + + + + It is not necessary to use PojoCache for second level + cache inside Hibernate because Hibernate + manages fine-grained fields in Java objects. So using Po= joCache won't + provide any advantage. + + + + + + + How can I configure JBoss Cache? + + + + You can configure the JBoss Cache through a configura= tion xml + file. Or you can set it programmatically through its get= /set methods. + Check with the documentation for both examples. + + + + + + + In the configuration xml file, there are tags such as + class + , + MBean + , etc. What are + these? + + + + + These are tags for deploying JBoss Cache as a JBoss M= Bean + service. For consistency, we have kept them in the + standalone package as well, specifically, the + MBean + tag. If you run in standalone mode, + JBoss Cache will ignore these elements. + + + + + + + What is the difference between the different cache + modes? + + + + + JBossCache has five different cache modes, i.e., + LOCAL + , + REPL_SYNC + , + REPL_ASYNC + , + INVALIDATION_SYNC + and + INVALIDATION_ASYNC + . If you want to run JBoss Cache as a + single instance, then you should set the cache mode to + LOCAL + so that it won't attempt to replicate anything. + If you want to have synchronous replication among differ= ent + JBoss Cache instances, you set it to + REPL_SYNC + . + For asynchronous replication, use + AYSNC_REPL + . If you do not wish to replicate cached data but simply= inform other caches in a cluster that data + under + specific addresses are now stale and should be evicted f= rom memory, use + INVALIDATION_SYNC + or + INVALIDTAION_ASYNC + . Synchronous and asynchronous behavior applies to inval= idation as well as replication. + + + Note that + ASYNC_REPL + and + INVALIDATION_ASYNC + are non-blocking. This + can be useful when you want to have another JBoss Cache = serving as a + mirror or backup and you don't want to wait for confirma= tion that this mirror has received your + messages. + + + + + + + How does JBoss Cache's replication mechanism work? + + + + JBoss Cache leverages + JGroups + as a replication layer. A user + can configure the cluster of JBoss Cache instances by sh= aring the + same cluster name ( + cluster name + ). There is also + an option of whether to populate the cache data upon sta= rting a new + instance in the + ClusterConfig + attribute. + + + Note that once all instances join the same replicatio= n group, + every replication change is propagated to all participat= ing members. + There is no mechanism for sub-partitioning where some re= plication + can be done within only a subset of members. This is on = our to do + list. + + + + + + + I run a 2 node cluster. If the network dies, do the c= aches continue to run? + + + + Yes, both will continue to run, but depending on your= replication mode, all transactions or + operations may not complete. If + REPL_SYNC + is used, operations will fail while if + REPL_ASYNC + is used they will succeed. Even if they succeed though, = caches will be out of sync. + + + + + + + + Can I plug in library X instead of JGroups to handle = remote calls and group communications? + + + + At this stage (JBoss Cache 1.x) the answer is no. We = do have an abstraction layer between the + communication suite and JBoss Cache in the pipelines, an= d this may appear as a feature at some stage + in + the future. + + + + + + + Does the cache need to replicate to every other insta= nce in the cluster? Isn't this slow if the + cluster is large? + + + + + As of JBoss Cache 1.4.0, replication need not occur t= o every node in the cluster. This feature - + called Buddy Replication - + allows each node to pick one or more 'buddies' in the cl= uster and only replicate to its buddies. This + allows a cluster to scale + very easily with no extra impact on memory or network tr= affic with each node added. + + + See the User Guide for more information on Buddy Replica= tion, and how it can be used to achieve very + high + scalability. + + + + + + + If I have the need for different TreeCache properties= (e.g., + CacheMode + and + IsolationLevel + ), do I simply need to create multiple + TreeCache instances with the appropriate configuration? + + + + + Yes. All the above mentioned properties are per cache + instance. Therefore you will need a separate JBoss Cache + instance. + + + + + + + Does the Tree Cache config + ClusterName + have + any relation to the JBoss AS cluster + PartitionName + ? + + + + + Yes. They are both JGroups group names. Besides the n= otion of + a channel in JGroups, it also can partition the channel = into different + group names. + + + + + + + When using multiple JGroups based components + [cluster-service.xml, treecache (multiple instances)], w= hat is the + correct/valid way to configure those components to make = sure my + multicast addresses don't conflict? + + + + + There are two parameters to consider: multicast addre= ss (plus + port) and the group name. At minimum, you will have to r= un + components using a different group name. But whether to = run them on + the same channel depends upon whether the communication = performance + is critical for you or not. If it is, then it'd be best = to run them + on different channels. + + + + + + + Does JBoss Cache currently support cache persistence + storage? + + + + + Yes. Starting with release 1.1, JBoss Cache has a Cac= heLoader + interface that supports cache persistence. See below. + + + + + + + Does JBoss Cache currently support cache passivation/= overflow + to a data store? + + + + + Yes. Starting with release 1.2.4, JBoss Cache uses the + CacheLoader to support cache passivation/ overflow. See + documentation on how to configure and use this feature. + + + + + + + Is JBoss Cache thread safe? + + + + Yes, it is thread safe. + + + + + + Does JBoss Cache support XA (2PC) transactions now? + + + + No, although it is also on our to do list. Our intern= al + implementation does use a similar 2PC procedure to coord= inate a + transaction among different instances. + + + + + + + Which TransactionManagers are supported by + JBoss Cache? + + + + + JBoss Cache supports any TransactionManager that is J= TA + compliant such as JBossTM. A user can configure the tran= saction + manager through the configuration xml setting. JBossCach= e also has a + built in dummy transaction manager + ( + org.jboss.cache.tm.DummyTransactionManager + ) for + testing purposes only. But note that + DummyTransactionManager + is not thread safe .i.e., + it does not support concurrent transactions. Instead, on= ly one + transaction is allowed at a time. + + + + + + + How do I set up the cache to be transactional? + + + + You either use the default (JBoss) TransactionManager= to run + JBossCache inside JBoss, or you have to implement the + TransactionManagerLookup + interface, and return an + instance of your javax.transaction.TransactionManager. T= he + configuration property + TransactionManagerLookupClass + defines the class + to be used by the cache to fetch a reference to a + TransactionManager. It is trivial to implement this clas= s to support + other TransactionManagers. Once this attribute is specif= ied, the + cache will look up the transaction context from this tra= nsaction + manager. + + + For the client code, here is a snippet to start and c= ommit a + transaction: + + + tx =3D (UserTransaction)new InitialContext(prop).l= ookup("UserTransaction"); + tree =3D new TreeCache(); + config =3D new PropertyConfigurator(); + config.configure(tree, "META-INF/replSync-service.xml"); + + tx.begin() + tree.put(fqn, key, value); + tx.commit(); + + + + + + + How do I control the cache locking level? + + + + JBossCache lets you control the cache locking level t= hrough + the transaction isolation level. This is configured thro= ugh the + attribute + IsolationLevel + . Currently, JBossCache + employs pessimistic locking internally. And the transact= ion + isolation level from the pessimist locking corresponds t= o JDBC + isolation levels, namely, + NONE + , + READ_UNCOMMITTED + , + READ_COMMITTED + , + REPEATABLE_READ + , and + SERIALIZABLE + . Note that these isolation levels are ignored if optimi= stic locking is used. For details, please + refer + to the + user manual. + + + + + + + How does JBoss Cache lock data for concurrent access?= + + + + By default JBoss Cache uses pessimistic locking to lo= ck data nodes, based on the isolation level + configured. Since JBoss Cache 1.3.0, we also offer optim= istic locking to allow for greater concurrency + at + the cost of slight processing overhead and performance. = See the documentation for a more detailed + discussion on concurrency and locking in JBoss Cache. + + + + + + + + How do I enable Optimistic Locking in JBoss Cache? + + + + Use the XMl attribute + NodeLockingScheme + . Note that + IsolationLevel + is ignored if + NodeLockingScheme + is set to + OPTIMISTIC + . Also note that + NodeLockingScheme + defaults to + PESSIMISTIC + if omitted. + + + + + + + + How does the write lock apply to an Fqn node, say, + "/org/jboss/test"? + + + + + First of all, JBossCache has a notion of + root + that serves as a starting point for every navigational o= peration. + The default is "/" (since the default separator is "/" f= or the fqn). + The locking then is applied to the node under root, for = example + "/org" (no locking "/"). + + + Furthermore, let's say when JBossCache needs to apply= a write + lock on node "/org/jboss/test", it will first try to obt= ain read + lock from the parent nodes recursively (in this example,= "/org", and + "/org/jboss"). Only when it succeeds then it will try to= obtain a + write lock on "/org/jboss/test". + + + + + + + Can I use the cache locking level even without a tran= saction + context? + + + + + Yes. JBossCache controls the individual node locking = behavior + through the isolation level semantics. This means even i= f you don't + use a transaction, you can specify the lock level via is= olation + level. You can think of the node locking behavior outsid= e of a + transaction as if it is under transaction with + auto_commit + on. + + + + + + + With replication (REPL_SYNC/REPL_ASYNC) or invalidati= on (INVALIDATION_SYNC/INVALIDATION_ASYNC), how + often does the cache broadcast messages over the network? + + + + + If the updates are under transaction, then the broadc= asts + happen only when the transaction is about to commit (act= ually + during the prepare stage internally). That is, it will b= e a batch + update. However, if the operations are not under transac= tion + context, then each update will trigger replication. Note= that this + has performance implication if network transport is heav= y (it + usually is). + + + + + + + How can I do a mass removal? + + + + If you do a cache.remove("/root"), it will recursivel= y remove + all the entries under "/root". + + + + + + + Can I monitor and manage the JBoss Cache? + + + + With JBoss Cache 1.3.0, you can if you are running JB= oss Cache within JBoss AS or are using JDK + 5.0's + jconsole + utility. See the chapter titled + Management Information + in the JBoss Cache user guide for more details. + + + + + + + Can I disable JBoss Cache management attributes in JB= oss Cache 1.3.0? + + + + Yes, you can. Set the + UseInterceptorMbeans + configuration attribute to + false + (this defaults to + true + ). See the chapter titled + Management Information + in the JBoss Cache user guide for more details. + + + + + + + What is jboss-serialization.jar, introduced in JBoss = Cache 1.4.x and do I need this? + + + jboss-serialization.jar is the + + JBoss Serialization + + library, which is much more efficient in terms + of speed and CPU usage as well as the generated byte str= eam size than standard Java serialization. + This + very + significantly improves replication performance of custom= objects placed in the cache. + + + From 1.4.x, JBoss Cache relies on this library and it is= needed to run JBoss Cache. + + + + + + + Can I disable JBoss Serialization and revert back to = standard Java serialization? + + + + Yes you can, by passing in the + -Dserialization.jboss=3Dfalse + environment variable to your JVM. + + + + + + + + Does JBoss Cache support partitioning? + + + + Not right now. JBoss Cache does not support partition= ing that a + user can configure to have different set of data residin= g on + different cache instances while still participating as a= replication + group. + + + + + + + Does JBoss Cache handle the concept of application cl= assloading + inside, say, a J2EE container? + + + + + Application-specific classloading is used widely insi= de a J2EE + container. For example, a web application may require a = new + classloader to scope a specific version of the user libr= ary. + However, by default JBoss Cache is agnostic to the class= loader. In + general, this leads to two kinds of problems: + + + + + Object instance is stored in cache1 and replica= ted to + cache2. As a result, the instance in cache2 is cre= ated by the + system classloader. The replication may fail if th= e system + classloader on cache2 does not have access to the = required + class. Even if replication doesn't fail, a user th= read in cache2 + may not be able to access the object if the user t= hread is + expecting a type defined by the application classl= oader. + + + + + Object instance is created by thread 1 and will= be + accessed by thread 2 (with two different classload= ers). + JBossCache has no notion of the different classloa= ders involved. + As a result, you will have a + ClassCastException + . This is a standard + problem in passing an object from one application = space to + another; JBossCache just adds a level of indirecti= on in passing + the object. + + + + + To solve the first kind of issue, in JBoss Cache 1.2.= 4 we + introduced the concept of a + TreeCacheMarshaller + . + Basically, this allows application code to register a cl= assloader + with a portion of the cache tree for use in handling obj= ects + replicated to that portion. See the TreeCacheMarshaller = section of + the user guide for more details. + + + To solve the second kind of issue, the only solution = (that we + know of) is to cache "serialized" byte code and only de-= serialize it + during every object get (and this will be expensive!). T= hat is, + during a put operation, the object instance will be seri= alized and + therefore can be deserialized safely by a "foreign" clas= sloader. + However, the performance penalty of this approach is qui= te severe so + in general another local in-vm version will need to be u= sed as a + "near-line" cache. Note also that each time the serializ= ed bytes are + deserialized, a new instance of the object is created. + + + To help with this kind of handling, JBoss has a utili= ty class + called + MarshalledValue + that wraps around the + serialized object. Here is a code snippet that illustrat= es how you + can create a wrapper around JBossCache to handle the cla= ssloader + issue: + + + import org.jboss.invocation.MarshalledValue; + + public class CacheService { + private TreeCache cache_; + + public object get(Fqn fqn, String key) { + return getUnMarshalledValue(cache_.get(fqn, key)); + } + + public object set(Fqn fqn, String key, Object value) { + cache_.put(fqn, key, getMarshalledValue(value)); + return value; // only if successful + } + + ... + + private Object getUnMarshalledValue(object value) { + // assuming we use the calling thread context classloader + return ((MarshalledValue)value).get(); + } + + private Object getMarshalledValue(Object value) { + return new MarshalledValue(value); + } + } + + + + + + + + Does JBoss Cache currently support pre-event and post= -event + notification? + + + + + Yes. Starting with release 1.2.4, JBoss Cache has int= roduced + ExtendedTreeCacheListener which takes in consideration p= re and post + event notification. See documentation for more details. = Note that + TreeCacheListener and ExtendedTreeCacheListener will be = merged into + TreeCacheListener in release 1.3. + + + + + + + How do I implement a custom listener to listen to + TreeCache + events? + + + + + You create a class (myListener) that extends + AbstractTreeCacheListener and provide concrete implement= ation for + the node events that you are interested in. Then you add= this + listener to the TreeCache instance on startup to listen = to the + events as they occur by calling + TreeCache.addTreeCacheListener(myListener). + + + + public class MyListener extends AbstractTreeCacheListener + { + ... + + public void nodeModify(Fqn fqn, boolean pre, boolean isLocal) { + if(log.isTraceEnabled()){ + if(pre) + log.trace("Event DataNode about to be modified: " + fqn); + else + log.trace("Event DataNode modified: " + fqn); + } + } + + ... + } + + + + + + + Can I use useRegionBasedMarshalling attribute in JBoss Cache in order to get + around ClassCastExceptions happening when accessing data= in the cache that has just been redeployed? + + + + + Yes, you can. Originally, TreeCache Marshalling was designed as a + workaround for those replicated caches that upon state t= ransfer did not have access to the + classloaders defining the objects in the cache. + + + On each deployment, JBoss creates a new classloader p= er the top level deployment artifact, for + example an EAR. You also have to bear in mind that a cla= ss in an application server is defined not + only by the class name but also its classloader. So, ass= uming that the cache is not deployed as part + of your deployment, you could deploy an application and = put instances of classes belonging to this + deployment inside the cache. If you did a redeployment a= nd try to do a get operation of the data + previously put, this would result on a ClassCastExceptio= n. This is because even though the class names + are the same, the class definitions are not. The current= classloader is different to the one when + the classes were originally put. + + + By enabling marshalling, you can control the lifecycl= e of the data in the cache and if on + undeployment, you inactivate the region and unregister t= he classloader that you'd have registered on + deployment, you'd evict the data in the cache locally. T= hat means that in the next deployment, the + data won't be in the cache, therefore avoiding the probl= em. Obviously, using marshalling to get + around this problem is only recommended when you have so= me kind of persistence backing where the data + survives, for example using CacheLoaders, or when JBossC= ache is used as a second level cache in a + persistence framework. = + + + To implement this feature, please follow the instruct= ions indicated in the example located + in the TreeCacheMarshaller section of the user's guide. = It's worth noting that instead of a + ServletContextListener, you could add= this code into an MBean + that contained lifecycle methods, such as start= () and stop(). + The key would be for this MBean to depend on the target = cache, so that it can operate as long as the + cache is up and running. + + + + + + \ No newline at end of file Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Troubleshooting= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Troubleshooting.xm= l (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Troubleshooting.xm= l 2009-11-16 06:45:01 UTC (rev 8285) @@ -0,0 +1,21 @@ + + + + + Troubleshooting + + + + + I am having problems getting JBoss Cache to work, whe= re can I get information on troubleshooting? + + + + Troubleshooting section can be found in the following + wiki link + . + + + + + \ No newline at end of file --===============9072365883031311849==-- From jbosscache-commits at lists.jboss.org Mon Nov 16 01:52:08 2009 Content-Type: multipart/mixed; boundary="===============0435991735400505137==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8286 - in enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ: en-US and 1 other directory. Date: Mon, 16 Nov 2009 01:52:08 -0500 Message-ID: <200911160652.nAG6q8wq022031@svn01.web.mwc.hst.phx2.redhat.com> --===============0435991735400505137== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-16 01:52:07 -0500 (Mon, 16 Nov 2009) New Revision: 8286 Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/Makefile enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_Frequen= tly_Asked_Questions_CP08.xml Log: Updated for PDF build. Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/Makefile 2009-11-16 06:4= 5:01 UTC (rev 8285) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/Makefile 2009-11-16 06:5= 2:07 UTC (rev 8286) @@ -6,7 +6,8 @@ = BRAND =3D JBoss = -OTHER_LANGS =3D ja-JP #as-IN bn-IN de-DE es-ES fr-FR gu-IN hi-IN it-IT ja-= JP kn-IN ko-KR ml-IN mr-IN or-IN pa-IN pt-BR ru-RU si-LK ta-IN te-IN zh-CN = zh-TW +#OTHER_LANGS =3D ja-JP #as-IN bn-IN de-DE es-ES fr-FR gu-IN hi-IN it-IT ja= -JP kn-IN ko-KR ml-IN mr-IN or-IN pa-IN pt-BR ru-RU si-LK ta-IN = +te-IN zh-CN zh-TW = -COMMON_CONFIG =3D /usr/share/publican -include $(COMMON_CONFIG)/make/Makefile.common +#COMMON_CONFIG =3D /usr/share/publican +#include $(COMMON_CONFIG)/make/Makefile.common Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_= Frequently_Asked_Questions_CP08.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP08.xml 2009-11-16 06:45:01 UTC (rev 8285) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP08.xml 2009-11-16 06:52:07 UTC (rev 8286) @@ -9,4 +9,4 @@ - + --===============0435991735400505137==-- From jbosscache-commits at lists.jboss.org Mon Nov 16 01:53:45 2009 Content-Type: multipart/mixed; boundary="===============7380760643592669419==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8287 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US. Date: Mon, 16 Nov 2009 01:53:45 -0500 Message-ID: <200911160653.nAG6rjwf022201@svn01.web.mwc.hst.phx2.redhat.com> --===============7380760643592669419== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-16 01:53:45 -0500 (Mon, 16 Nov 2009) New Revision: 8287 Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Book_Info.xml Log: Updated for PDF build. Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Book_Info.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Book_Info.xml 2009= -11-16 06:52:07 UTC (rev 8286) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/Book_Info.xml 2009= -11-16 06:53:45 UTC (rev 8287) @@ -27,7 +27,4 @@ = - = - --===============7380760643592669419==-- From jbosscache-commits at lists.jboss.org Mon Nov 16 02:03:26 2009 Content-Type: multipart/mixed; boundary="===============8238251755927457570==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] Reminder: Order 13059 Customer Survey | Online team Date: Mon, 16 Nov 2009 02:03:23 -0500 Message-ID: <200911160703.nAG73N58028901@lists01.dmz-a.mwc.hst.phx2.redhat.com> --===============8238251755927457570== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable --===============8238251755927457570== Content-Type: text/html MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv L0VOIj4KPEhUTUw+PEhFQUQ+CjxNRVRBIGh0dHAtZXF1aXY9Q29udGVudC1UeXBlIGNvbnRlbnQ9 InRleHQvaHRtbDsgY2hhcnNldD1pc28tODg1OS0yIj4KPC9IRUFEPgo8Qk9EWSBiZ2NvbG9yPSIj QjFCMUIxIj48ZGl2IHN0eWxlPSJwYWRkaW5nOiAyMHB4IDIwcHggNDBweCAyMHB4OyBiYWNrZ3Jv dW5kLWNvbG9yOiNCMUIxQjE7Ij4KPHRhYmxlIHdpZHRoPSI0NTAiIGJvcmRlcj0iMCIgY2VsbHNw YWNpbmc9IjAiIGNlbGxwYWRkaW5nPSIwIiBhbGlnbj0iY2VudGVyIiBiZ2NvbG9yPSIjZmZmZmZm Ij4KICAgICAgICA8dHI+Cjx0ZCBzdHlsZT0icGFkZGluZzoxMHB4IDEwcHggMTBweCAxMHB4OyBm b250LWZhbWlseTonVHJlYnVjaGV0IE1TJywgQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZjsg Zm9udC1zaXplOjIwcHg7IGNvbG9yOiMwMDAwMDA7IiA+IApXZSBzaGlwIFdvcmxkd2lkZSEgVG8g YWxsIGNvdW50cmllcyEgVG8gYWxsIGRlc3RpbmF0aW9ucyE8L3RkPgogICAgICAgIDwvdHI+CiAg ICAgICAgPHRyPiAgICAgICAgICAgIDx0ZCBzdHlsZT0icGFkZGluZzoxMHB4IDBweCAzMHB4IDBw eDsiPgo8ZGl2IHN0eWxlPSJwYWRkaW5nOjEwcHggMTBweCAxMHB4IDEwcHg7Ij4KCTxkaXYgc3R5 bGU9ImJvcmRlci10b3A6NXB4IHNvbGlkICM2NjY2NjY7IHBhZGRpbmctdG9wOjEwcHg7ICBmb250 LWZhbWlseTpWZXJkYW5hLCBBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmOyBmb250LXNpemU6 MTBweDsgY29sb3I6IzY2NjY2NjsiPgo8YSBocmVmPSJodHRwOi8vYmFzZXNwcmVhZC5jb20vIj48 aW1nIHNyYz0iaHR0cDovL2Jhc2VzcHJlYWQuY29tL3NwYWNlci5naWYiIGFsdD0iQ2FudCBzZWUg YSBwaWN0dXJlPyBDbGljayBIZXJlISIgYm9yZGVyPSIwIiAKY2xhc3M9ImZlYXR1cmVJbWFnZSIg c3R5bGU9InBhZGRpbmc6MTAwcHggMTAwcHggMTAwcHggMTAwcHg7IiAvPjwvYT4KCTwvZGl2PiA8 L3RkPgogICAgICAgIDwvdHI+CgogICAgICAgIDx0cj4KICAgICAgICAgICAgICAgIDx0ZCBzdHls ZT0icGFkZGluZzoyMHB4IDEwcHggMTBweCAwcHg7IGJhY2tncm91bmQtY29sb3I6I0IxQjFCMTsi PgogICAgICAgICAgICAgICAgICAgICAgICA8cCBzdHlsZT0iZm9udC1mYW1pbHk6VmVyZGFuYSwg QXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZjsgZm9udC1zaXplOjlweDsgY29sb3I6IzY2NjY2 NjsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRvIHVuc3Vic2NyaWJlIGZyb20g dGhpcyBtYWlsaW5nIGxpc3QsIHBsZWFzZSBsb2cgaW4gdG8gd3d3LmJhc2VzcHJlYWQuY29tLCBj bGljayBvbiAiTXkgQWNjb3VudCIsIAoJCQkJCQkJCWNsaWNrICJVcGRhdGUiIHRvIGVkaXQgeW91 ciByZWdpc3RyYXRpb24gZGV0YWlscyBhbmQgdW5jaGVjayB0aGUgIlJlY2VpdmUgTmV3c2xldHRl cj8iIGNoZWNrIGJveC48YnI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT3IgdW5z dWJzY3JpYmUgYXQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YSBocmVmPSJodHRw Oi8vYmFzZXNwcmVhZC5jb20vZmFxLnBocCIgc3R5bGU9ImZvbnQtd2VpZ2h0OmJvbGQ7IGNvbG9y OiM2NjY2NjYiPmh0dHA6Ly9iYXNlc3ByZWFkLmNvbS9mYXEucGhwPC9hPgogICAgICAgICAgICAg ICAgICAgICAgICA8L3A+CgogICAgICAgICAgICAgICAgICAgICAgICA8cCBzdHlsZT0iZm9udC1m YW1pbHk6VmVyZGFuYSwgQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZjsgZm9udC1zaXplOjlw eDsgY29sb3I6IzY2NjY2NjsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxhIGhy ZWY9Imh0dHA6Ly9iYXNlc3ByZWFkLmNvbS9wcml2YWN5X3BvbGljeS5waHAiIHN0eWxlPSJmb250 LXdlaWdodDpib2xkOyBjb2xvcjojNjY2NjY2Ij5Qcml2YWN5IFN0YXRlbWVudDwvYT4gIHwKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YSBocmVmPSJodHRwOi8vYmFzZXNwcmVhZC5j b20vc2hpcHBpbmdfcG9saWN5LnBocCIgc3R5bGU9ImZvbnQtd2VpZ2h0OmJvbGQ7IGNvbG9yOiM2 NjY2NjYiPlRlcm1zICZhbXA7IENvbmRpdGlvbnM8L2E+ICB8CiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPGEgaHJlZj0iaHR0cDovL2Jhc2VzcHJlYWQuY29tL2NvbnRhY3RzLnBocCIg c3R5bGU9ImZvbnQtd2VpZ2h0OmJvbGQ7IGNvbG9yOiM2NjY2NjYiPkNvbnRhY3Q8L2E+CiAgICAg ICAgICAgICAgICAgICAgICAgIDwvcD4KCiAgICAgICAgICAgICAgICAgICAgICAgIDxwIHN0eWxl PSJmb250LWZhbWlseTpWZXJkYW5hLCBBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmOyBmb250 LXNpemU6OXB4OyBjb2xvcjojNjY2NjY2OyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgQU1BWk9OIEx0ZC48YnI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVG93ZXIg QnJpZGdlIEJ1c2luZXNzIENvbXBsZXguIFVuaXQgOCwgQjQ4OS4gOTUwIENsZW1lbnRzIFJvYWQu IExvbmRvbi4gU0U1NiA1REcKICAgICAgICAgICAgICAgICAgICAgICAgPC9wPgoKICAgICAgICAg ICAgICAgICAgICAgICAgPHAgc3R5bGU9ImZvbnQtZmFtaWx5OlZlcmRhbmEsIEFyaWFsLCBIZWx2 ZXRpY2EsIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTo5cHg7IGNvbG9yOiM2NjY2NjY7Ij4KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmY29weTsgMjAwOSBBTUFaT04sIEx0ZC4gQWxsIFJp Z2h0cyBSZXNlcnZlZAogICAgICAgICAgICAgICAgICAgICAgICA8L3A+PC90ZD4gPC90cj48L3Rh YmxlPjwvZGl2PjwvQk9EWT48L0hUTUw+Cg== --===============8238251755927457570==-- From jbosscache-commits at lists.jboss.org Tue Nov 17 02:25:08 2009 Content-Type: multipart/mixed; boundary="===============3878847046989487829==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8288 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US. Date: Tue, 17 Nov 2009 02:25:08 -0500 Message-ID: <200911170725.nAH7P8MW018512@svn01.web.mwc.hst.phx2.redhat.com> --===============3878847046989487829== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-17 02:25:07 -0500 (Tue, 17 Nov 2009) New Revision: 8288 Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/General.xml enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_Frequen= tly_Asked_Questions_CP08.xml Log: Some structural changes to build with publican. Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/General.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/General.xml 2009-1= 1-16 06:53:45 UTC (rev 8287) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/General.xml 2009-1= 1-17 07:25:07 UTC (rev 8288) @@ -2,8 +2,11 @@ = - General Information + + Please to be building now. :( + + = @@ -204,4 +207,4 @@ - \ No newline at end of file + Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_= Frequently_Asked_Questions_CP08.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP08.xml 2009-11-16 06:53:45 UTC (rev 8287) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP08.xml 2009-11-17 07:25:07 UTC (rev 8288) @@ -1,5 +1,7 @@ - + --===============3878847046989487829==-- From jbosscache-commits at lists.jboss.org Tue Nov 17 07:35:10 2009 Content-Type: multipart/mixed; boundary="===============0818523079294433539==" MIME-Version: 1.0 From: Scarlett To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] Hey jbosscache-commits Date: Tue, 17 Nov 2009 07:35:10 -0500 Message-ID: <200911171235.nAHCZ8Yo000682@lists01.dmz-a.mwc.hst.phx2.redhat.com> --===============0818523079294433539== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable We're out for a week http://mp3-news.by.ru/hot.html --===============0818523079294433539==-- From jbosscache-commits at lists.jboss.org Wed Nov 18 21:20:32 2009 Content-Type: multipart/mixed; boundary="===============7197490014559831392==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8289 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US. Date: Wed, 18 Nov 2009 21:20:32 -0500 Message-ID: <200911190220.nAJ2KWB1002737@svn01.web.mwc.hst.phx2.redhat.com> --===============7197490014559831392== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-18 21:20:32 -0500 (Wed, 18 Nov 2009) New Revision: 8289 Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss_= Cache_Tree_Cache_Guide_CP08.ent enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss_= Cache_Tree_Cache_Guide_CP08.xml Removed: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss_= Cache_Tree_Cache_Guide_CP07.ent enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss_= Cache_Tree_Cache_Guide_CP07.xml Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/Revisi= on_History.xml Log: Added changes for CP08. Deleted: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/= JBoss_Cache_Tree_Cache_Guide_CP07.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP07.ent 2009-11-17 07:25:07 UTC (rev 8288) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP07.ent 2009-11-19 02:20:32 UTC (rev 8289) @@ -1,3 +0,0 @@ - - - Deleted: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/= JBoss_Cache_Tree_Cache_Guide_CP07.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP07.xml 2009-11-17 07:25:07 UTC (rev 8288) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP07.xml 2009-11-19 02:20:32 UTC (rev 8289) @@ -1,53 +0,0 @@ - - - - - - Preface - - This and its accompanying documents describe JBoss Cache's TreeCache, a = tree-structured replicated, transactional cache. JBoss Cache's PojoCache, a= n "object-oriented" cache that is the AOP-enabled subclass of TreeCache, al= lowing for Plain Old Java Objects (POJOs) to be inserted and replicated tra= nsactionally in a cluster, is described separately in a similar user guide. = - - - The TreeCache is fully configurable. Aspects of the system such as repli= cation mechanisms, transaction isolation levels, eviction policies, and tra= nsaction managers are all configurable. The TreeCache can be used in a stan= dalone fashion - independent of JBoss Application Server or any other appli= cation server. PojoCache on the other hand requires both TreeCache and the = JBossAOP standalone subsystem. PojoCache, documented separately, is the fir= st in the market to provide a POJO cache functionality. = - - - This document is meant to be a user guide to explain the architecture, a= pi, configuration, and examples for JBoss Cache's TreeCache. Good knowledge= of the Java programming language along with a string appreciation and unde= rstanding of transactions and concurrent threads is presumed. No prior know= ledge of JBoss Application Server is expected or required. = - - - If you have questions, use the user forum linked= on the JBoss Cache website= . We also provide a mechanism for tracking bug reports and feature= requests on the JBoss JIRA issue trac= ker . If you are interested in the development of JBoss Cache or i= n translating this documentation into other languages, we'd love to hear fr= om you. Please post a message on the user forum or contact us on the developer mailing list . = - - - JBoss Cache is an open-source product based on LGPL. Commercial developm= ent support, production support and training for JBoss Cache is available t= hrough JBoss Inc. JBoss Cache i= s a product in JBoss Professional Open Source JEMS (JBoss Enterprise Middleware Suite). = - - - = - - = - - = - - = - - = - - = - - = - - = - - = - - = - - = - - = - - = - - = - - - - Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JB= oss_Cache_Tree_Cache_Guide_CP08.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP08.ent (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP08.ent 2009-11-19 02:20:32 UTC (rev 8289) @@ -0,0 +1,3 @@ + + + Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JB= oss_Cache_Tree_Cache_Guide_CP08.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP08.xml (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP08.xml 2009-11-19 02:20:32 UTC (rev 8289) @@ -0,0 +1,53 @@ + + + + + + Preface + + This and its accompanying documents describe JBoss Cache's TreeCache, a = tree-structured replicated, transactional cache. JBoss Cache's PojoCache, a= n "object-oriented" cache that is the AOP-enabled subclass of TreeCache, al= lowing for Plain Old Java Objects (POJOs) to be inserted and replicated tra= nsactionally in a cluster, is described separately in a similar user guide. = + + + The TreeCache is fully configurable. Aspects of the system such as repli= cation mechanisms, transaction isolation levels, eviction policies, and tra= nsaction managers are all configurable. The TreeCache can be used in a stan= dalone fashion - independent of JBoss Application Server or any other appli= cation server. PojoCache on the other hand requires both TreeCache and the = JBossAOP standalone subsystem. PojoCache, documented separately, is the fir= st in the market to provide a POJO cache functionality. = + + + This document is meant to be a user guide to explain the architecture, a= pi, configuration, and examples for JBoss Cache's TreeCache. Good knowledge= of the Java programming language along with a string appreciation and unde= rstanding of transactions and concurrent threads is presumed. No prior know= ledge of JBoss Application Server is expected or required. = + + + If you have questions, use the user forum linked= on the JBoss Cache website= . We also provide a mechanism for tracking bug reports and feature= requests on the JBoss JIRA issue trac= ker . If you are interested in the development of JBoss Cache or i= n translating this documentation into other languages, we'd love to hear fr= om you. Please post a message on the user forum or contact us on the developer mailing list . = + + + JBoss Cache is an open-source product based on LGPL. Commercial developm= ent support, production support and training for JBoss Cache is available t= hrough JBoss Inc. JBoss Cache i= s a product in JBoss Professional Open Source JEMS (JBoss Enterprise Middleware Suite). = + + + = + + = + + = + + = + + = + + = + + = + + = + + = + + = + + = + + = + + = + + = + + + + Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US= /Revision_History.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/Revis= ion_History.xml 2009-11-17 07:25:07 UTC (rev 8288) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/Revis= ion_History.xml 2009-11-19 02:20:32 UTC (rev 8289) @@ -8,15 +8,16 @@ 1.0 - + Tue Nov 19 2009 - - - + Laura + Bailey + lbailey(a)redhat.com - + Initial = +draft. --===============7197490014559831392==-- From jbosscache-commits at lists.jboss.org Wed Nov 18 21:21:20 2009 Content-Type: multipart/mixed; boundary="===============3211179515799034953==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8290 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US. Date: Wed, 18 Nov 2009 21:21:19 -0500 Message-ID: <200911190221.nAJ2LJbP002869@svn01.web.mwc.hst.phx2.redhat.com> --===============3211179515799034953== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-18 21:21:19 -0500 (Wed, 18 Nov 2009) New Revision: 8290 Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/Book_I= nfo.xml Log: Added changes for CP08. Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US= /Book_Info.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/Book_= Info.xml 2009-11-19 02:20:32 UTC (rev 8289) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/Book_= Info.xml 2009-11-19 02:21:19 UTC (rev 8290) @@ -2,8 +2,9 @@ = - JBoss Cache Tree Cache Guide CP07 - for Use with JBoss Enterprise Application Platform 4.2 Cumulati= ve Patch 7 + JBoss Cache Tree Cache Guide CP08 + for Use with JBoss Enterprise Application Platform 4.2 = +Cumulative Patch 8 1.0 1 JBoss Enterprise Application Platform --===============3211179515799034953==-- From jbosscache-commits at lists.jboss.org Wed Nov 18 21:24:19 2009 Content-Type: multipart/mixed; boundary="===============4872263471339361716==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8291 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US. Date: Wed, 18 Nov 2009 21:24:19 -0500 Message-ID: <200911190224.nAJ2OJ7d003157@svn01.web.mwc.hst.phx2.redhat.com> --===============4872263471339361716== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-18 21:24:19 -0500 (Wed, 18 Nov 2009) New Revision: 8291 Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss_= Cache_Pojo_Cache_Guide_CP08.ent enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss_= Cache_Pojo_Cache_Guide_CP08.xml Removed: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss_= Cache_Pojo_Cache_Guide_CP07.ent enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss_= Cache_Pojo_Cache_Guide_CP07.xml Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/Book_I= nfo.xml enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/Revisi= on_History.xml Log: Added changes for CP08. Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US= /Book_Info.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/Book_= Info.xml 2009-11-19 02:21:19 UTC (rev 8290) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/Book_= Info.xml 2009-11-19 02:24:19 UTC (rev 8291) @@ -2,8 +2,9 @@ = - JBoss Cache Pojo Cache Guide CP07 - for Use with JBoss Enterprise Application Platform 4.2 Cumulati= ve Patch 7 + JBoss Cache Pojo Cache Guide CP08 + for Use with JBoss Enterprise Application Platform 4.2 = +Cumulative Patch 8 1.0 1 JBoss Enterprise Application Platform Deleted: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/= JBoss_Cache_Pojo_Cache_Guide_CP07.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP07.ent 2009-11-19 02:21:19 UTC (rev 8290) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP07.ent 2009-11-19 02:24:19 UTC (rev 8291) @@ -1,3 +0,0 @@ - - - Deleted: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/= JBoss_Cache_Pojo_Cache_Guide_CP07.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP07.xml 2009-11-19 02:21:19 UTC (rev 8290) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP07.xml 2009-11-19 02:24:19 UTC (rev 8291) @@ -1,45 +0,0 @@ - - - - - - Preface - - PojoCache is an in-memomy, transactional, and replicated POJO (plain old= Java object) cache system that allows users to operate on a POJO transpare= ntly without active user management of either replication or persistency as= pects. PojoCache, a component of JBossCache (uses PojoCache class as an int= ernal implementation, the old implementation TreeCacheAop has been deprecat= ed.), is the first in the market to provide a POJO cache functionality. JBo= ssCache by itself is a 100% Java based library that can be run either a= s a standalone program or inside an application server. = - - - This document is meant to be a user guide to explain the architecture, a= pi, configuration, and examples for PojoCache. We assume the readers are fa= miliar with both JGroups and TreeCache usages. Since PojoCache uses JBossAo= p framework, an introduction will also be given there. = - - - If you have questions, use the user forum linked = on the JBossCache website. We also provide tracking links for tracking bug = reports and feature requests on JBoss = Jira web site . If you are interested in the development of PojoCac= he, post a message on the forum. If you are interested in translating this = documentation into your language, contact us on the developer mailing list. = - - - JBossCache is an open-source product based on LGPL. Commercial developme= nt support, production support and training for JBoss Cache is available th= rough JBoss Inc. (see JBoss web site ). JBoss Cache is a project of the JBoss Professional Open Source pro= duct suite. = - - - In some of the example listings, what is meant to be displayed on one li= ne does not fit inside the available page width. These lines have been brok= en up. A '\' at the end of a line means that a break has been introduce= d to fit in the page, with the following lines indented. So: - Let's pretend to have an extremely \ - long line that \ - does not fit - This one is short - = - - Is really: - Let's pretend to have an extremely long line that does not fit - This one is short - = - - - - - - - - - - - - - - - Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JB= oss_Cache_Pojo_Cache_Guide_CP08.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP08.ent (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP08.ent 2009-11-19 02:24:19 UTC (rev 8291) @@ -0,0 +1,3 @@ + + + Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JB= oss_Cache_Pojo_Cache_Guide_CP08.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP08.xml (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP08.xml 2009-11-19 02:24:19 UTC (rev 8291) @@ -0,0 +1,45 @@ + + + + + + Preface + + PojoCache is an in-memomy, transactional, and replicated POJO (plain old= Java object) cache system that allows users to operate on a POJO transpare= ntly without active user management of either replication or persistency as= pects. PojoCache, a component of JBossCache (uses PojoCache class as an int= ernal implementation, the old implementation TreeCacheAop has been deprecat= ed.), is the first in the market to provide a POJO cache functionality. JBo= ssCache by itself is a 100% Java based library that can be run either a= s a standalone program or inside an application server. = + + + This document is meant to be a user guide to explain the architecture, a= pi, configuration, and examples for PojoCache. We assume the readers are fa= miliar with both JGroups and TreeCache usages. Since PojoCache uses JBossAo= p framework, an introduction will also be given there. = + + + If you have questions, use the user forum linked = on the JBossCache website. We also provide tracking links for tracking bug = reports and feature requests on JBoss = Jira web site . If you are interested in the development of PojoCac= he, post a message on the forum. If you are interested in translating this = documentation into your language, contact us on the developer mailing list. = + + + JBossCache is an open-source product based on LGPL. Commercial developme= nt support, production support and training for JBoss Cache is available th= rough JBoss Inc. (see JBoss web site ). JBoss Cache is a project of the JBoss Professional Open Source pro= duct suite. = + + + In some of the example listings, what is meant to be displayed on one li= ne does not fit inside the available page width. These lines have been brok= en up. A '\' at the end of a line means that a break has been introduce= d to fit in the page, with the following lines indented. So: + Let's pretend to have an extremely \ + long line that \ + does not fit + This one is short + = + + Is really: + Let's pretend to have an extremely long line that does not fit + This one is short + = + + + + + + + + + + + + + + + Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US= /Revision_History.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/Revis= ion_History.xml 2009-11-19 02:21:19 UTC (rev 8290) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/en-US/Revis= ion_History.xml 2009-11-19 02:24:19 UTC (rev 8291) @@ -8,15 +8,16 @@ 1.0 - + Thu Nov 19 2009 - - - + Laura + Bailey + lbailey(a)redhat.com - + Initial = +draft. --===============4872263471339361716==-- From jbosscache-commits at lists.jboss.org Wed Nov 18 21:26:31 2009 Content-Type: multipart/mixed; boundary="===============7964894625799929383==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8292 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US. Date: Wed, 18 Nov 2009 21:26:31 -0500 Message-ID: <200911190226.nAJ2QVTa003740@svn01.web.mwc.hst.phx2.redhat.com> --===============7964894625799929383== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-18 21:26:31 -0500 (Wed, 18 Nov 2009) New Revision: 8292 Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_Tu= torial_CP08.ent enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_Tu= torial_CP08.xml Removed: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_Tu= torial_CP07.ent enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_Tu= torial_CP07.xml Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/Book_Info.xml enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/Revision_Histo= ry.xml Log: Adding changes for CP08 build. Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/Book_In= fo.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/Book_Info.xml= 2009-11-19 02:24:19 UTC (rev 8291) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/Book_Info.xml= 2009-11-19 02:26:31 UTC (rev 8292) @@ -2,8 +2,8 @@ = - JBoss Cache Tutorial CP07 - for Use with JBoss Enterprise Application Platform 4.2 Cumulati= ve Patch 7 + JBoss Cache Tutorial CP08 + for Use with JBoss Enterprise Application Platform 4.2 Cumulati= ve Patch 8 1.0 1 JBoss Enterprise Application Platform Deleted: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Ca= che_Tutorial_CP07.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP07.ent 2009-11-19 02:24:19 UTC (rev 8291) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP07.ent 2009-11-19 02:26:31 UTC (rev 8292) @@ -1,3 +0,0 @@ - - - Deleted: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Ca= che_Tutorial_CP07.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP07.xml 2009-11-19 02:24:19 UTC (rev 8291) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP07.xml 2009-11-19 02:26:31 UTC (rev 8292) @@ -1,503 +0,0 @@ - - - - - JBossCache Tutorial - - - Introduction - - JBossCache is an in-memory replicated (synchronous or asynchronous), tr= ansactional, and fine-grained cache. It consists of two subsystems: TreeCac= he (plain cache) and PojoCache (object-oriented POJO cache). In this tutori= al, we will demonstrate the usage of both cache features. For details of th= e usage and APIs, please refer to the user manuals for TreeCache and PojoCa= che. = - -
- Scope - - - - Cache creation and modification - - - - - Replication - - - - - PojoCache - - - - - Transaction - - - -
- = -
- - Configuration - - First download the standalone TreeCache code from here. Unzip i= t, and you will get a root directory (jboss-cache in our example). = - - - The configuration files are located under the etc directory. You can mo= dify the behavior of TreeCache through editing the various configuration fi= les. = - - - - - log4j.xml. Logging output. You can turn on logging= level or change log file directory (default is /tmp/jbosscache.lo= g). = - - - - - replSync-service.xml. Tree cache configuration fil= e (file name is not fixed. You specify the file to be read in Prop= ertyConfigurator). The settings are for a replicated, synchronous= , and transactional cache. The default DummyTransactionManager is used with= a transaction isolation level of REPEATABLE_READ. For details of the confi= guration parameters, please refer to the Treecache. Note that this file is used i= n the BSH ( BeanShell, a l= ightweight Java compatible scripting language) script to configure the cach= e. = - - - - - jboss-aop.xml. AOP pointcut and advice definition = for the example POJO classes, Person and Address, respectively. For details= of how to put your own class under AOP, please refer to the PojoCache. This file= is read in when the process is started. = - - - - - - Script - - The script files that are needed (located under install directory) in t= his tutorial are: = - - - - - build.sh (or build.bat for DOS/= Windows). Simple build script that wraps around ant. Users can simply type = sh build.sh for help. Note from now on, we will only ref= er to the Unix version with the understanding that there is a corresponding= DOS counterpart. The same goes for runDemoShell explained next. = - - - - - runDemoShell.sh. Simple run script that wraps arou= nd BeanShell. This is used to operate the replicated cache through interact= ive command line. = - - - - - plain.bsh. Java code that instantiate and configur= e the cache. It also creates an example cache entry. = - - - - - aop.bsh. Java codes that instantiate and configure= the aop cache. In addition, it also sets up the example POJO (plain old Ja= va object) classes (e.g., Person and Address). = - - - - - aopWithTx.bsh. Same with aop.bsh except it also in= stantiates a transaction context. = - - - - - - Example POJO - - The example POJO classes used for PojoCache demo are: Person and Address. They are located under te= sts/org/jboss/cache/aop directory. Person has = attributes of String age, Address addr, List languages = , etc. We will demonstrate that once you put the POJO instance in the cache= , plain get/set POJO methods will be intercepted by the cache. = - - - Here is the snippet of the class definition for Person and Address . = - -public class Person { - String name=3Dnull; - int age=3D0; - Map hobbies=3Dnull; - Address address=3Dnull; - Set skills; - List languages; - - public String getName() { return name; } - public void setName(String name) { this.name=3Dname; } - ... - } - = - -public class Address { - String street=3Dnull; - String city=3Dnull; - int zip=3D0; - - public String getStreet() { return street; } - public void setStreet(String street) { this.street=3Dstreet; } - ... - } - = - - - - Demo - - To run the demo, you will need at least two windows: one to peruse the = cache contents (plus non-aop operations) and the other to operate the cache= directly. Of course, you can also open more than one GUI window to see the= cache replication at work to multiple members. You will also need to run t= he scripts under jboss-cache installation directory after you unzip the rel= ease package (jboss-cache-dist.zip). Due to the limitation of the GUI, plea= se note that: = - - - - - For each demo example, it'd be best if you re-start the whole set= up. - - - - - While you can modify the cache content on the GUI window and it will = show up on the BSH cache content (e.g., through cache.printDetails= () ), this won't work on PojoCache demo. That is, you can onl= y modify the cache content on the BSH window. - - - - - The two demo programs to run are: - - - - - On the first window for the GUI, type sh build.sh = to see the available commands. To run the GUI, type sh build.sh r= un.demo . It will startup a PojoCache GUI. Later on, you can clic= k on a node to view the the contents. Note that you can also add/modify the= node contents for non-AOP cache entries. Since the GUI entry only accepts = String for now, operation on aop cache from the GUI will not always work (u= nless it is a String type). = - - - - - On the second window for the interactive Java commands, type sh runSh= ellDemo.sh to fire off the BeanShell interactive command shell (you can use= either ^D or ^Z in Windows and Unix to exit afterward). You can then read = in the Java code scripts to showcase the cache capabilities (e.g., plain.bs= h, aop.bsh, and aopWithTx.bsh). See the following for details. = - - - - - - Plain cache - - Once you are in the shell, you can either execute the script to populat= e the cache, or type it in manually by command line. To run the script, typ= e sourceRelative("plain.bsh"); under the interactive BSH= shell. For this to work, you'll need to have your working directory se= t to the directory in which plain.bsh resides (otherwise give the full path= name of plain.bsh). Basically, the script will create cache entries that wi= ll be replicated onto the GUI. (You may have to type show() into the result= ing beanshell window yourself) Here are the snippets for the script: = - -import org.jboss.cache.*; - show(); // verbose mode for bean shell - TreeCache tree =3D new TreeCache(); - PropertyConfigurator config =3D new PropertyConfigurator(); = - // configure tree cache. Needs to be in the classpath - config.configure(tree, "META-INF/replSync-service.xml"); - tree.startService(); = - // kick start tree cache - tree.put("/a/b/c", "ben", "me"); = - // create a cache entry. - // Node "/a/b/c" will be created if it does not yet exist. - = - - - You should see in the GUI that a new entry of /a/b/c= has been created. Click on the node c to see the content. You can modify t= he contents from the GUI as well. To create another node, for example, you = can type in the shell: = - -tree.put("/a/b/c/d", "JBoss", "Open Source"); - tree.get("/a/b/c/d", "JBoss"); - = - - - - PojoCache - - Once you are in the shell, type sourceRelative("aop.bsh"); to execute the shell script. Basically, aop.bsh illustrates the step= s to instantiate a cache, configure it, and then create entries under it. H= ere are the snippets: = - -import org.jboss.cache.PropertyConfigurator; - import org.jboss.cache.aop.PojoCache; - import org.jboss.cache.aop.test.Person; - import org.jboss.cache.aop.test.Address; - show(); // verbose mode for bean shell - PojoCache tree =3D new PojoCache(); - PropertyConfigurator config =3D new PropertyConfigurator(); // co= nfigure tree cache. - config.configure(tree, "META-INF/replSync-service.xml"); - Person joe =3D new Person(); // instantiate a Person object named= joe - joe.setName("Joe Black"); - joe.setAge(31); - Address addr =3D new Address(); // instantiate a Address object n= amed addr - addr.setCity("Sunnyvale"); - addr.setStreet("123 Albert Ave"); - addr.setZip(94086); joe.setAddress(addr); // set the address refe= rence - tree.startService(); // kick start tree cache - tree.putObject("/aop/joe", joe); = - // add aop sanctioned object (and sub-objects) into cache. - // since it is aop-sanctioned, use of plain get/set methods will = take care - // of cache contents automatically. - joe.setAge(41); - = - - - Note the API needed to put the object (and its dependent ones) into cac= he is putObject. Once the second window finishes execution, you should see = the first GUI window has been populated with entries of /aop/joe/address. C= lick on each tree node will display different values associated with that n= ode. = - - - Next step to see AOP in action, you can do plain get/set methods withou= t ever worrying about put it in the cache. For example, you can do in the s= hell window joe.setAge(20); and see that GUI gets updated with the age fiel= d automatically (if not, click away and back will refresh the GUI content).= Also to demonstrate the object graph replication, you can modify Joe's= address and see the cache will update it automatically. For example, type = addr.setCity("San Jose"); in the interactive shell, you should see in the G= UI that the address got modified. = - - - Finally, PojoCache also supports get/set with parameter type of Collect= ion classes (i.e., List, Map, and Set). For example, type the following in = the shell command line: = - -ArrayList lang =3D new ArrayList(); - lang.add("Ensligh"); - lang.add("Mandarin"); - joe.setLanguages(lang); - = - - - - PojoCache with Transaction - - To see TreeCache transaction at work, you start with the same setup wit= h last section except you load the bsh of aopWithTx.bsh instead of aop.bsh.= The additional snippets are: = - -import org.jboss.cache.PropertyConfigurator; - import org.jboss.cache.aop.PojoCache; - import org.jboss.cache.aop.test.Person; - import org.jboss.cache.aop.test.Address;// Tx imports - import javax.transaction.UserTransaction; import javax.naming.*; - import org.jboss.cache.transaction.DummyTransactionManager; - show(); // verbose mode for bean shell - // Set up transaction manager - DummyTransactionManager.getInstance(); - Properties prop =3D new Properties(); - prop.put(Context.INITIAL_CONTEXT_FACTORY, - "org.jboss.cache.transaction.DummyContextFactory"); - UserTransaction tx =3D (UserTransaction)new - InitialContext(prop).lookup("UserTransaction"); - PojoCache tree =3D new PojoCache(); - PropertyConfigurator config =3D new PropertyConfigurator(); = - // configure tree cache. - config.configure(tree, "META-INF/replSync-service.xml"); - joe =3D new Person(); - joe.setName("Joe Black"); - joe.setAge(31); - - Address addr =3D new Address(); - addr.setCity("Sunnyvale"); - addr.setStreet("123 Albert Ave"); - addr.setZip(94086); - joe.setAddress(addr); - - tree.startService(); // kick start tree cache - tree.putObject("/aop/joe", joe); // add aop sanctioned object - // since it is aop-sanctioned, use of plain get/set methods will = take care - of cache contents automatically. - // Also it is transacted - tx.begin(); - joe.setAge(41); - joe.getAddress().setZip(95124); - tx.commit(); - = - - - In this example, a default dummy transaction manager is used. - -tx.begin(); - addr.setZip(95131); - tx.rollback(); - = - - - - CacheLoader examples - - All the examples below are based on the JBossCache standalone distribut= ion. We assume the ZIP file has been unzipped into a directory jbo= ss-cache . = - -
- Local cache with CacheLoader - - This demo shows a local PojoCache with a CacheLoader. We will insert a= POJO into the cache, and see that the POJO is transparently saved using th= e CacheLoader. = - - - To run this, you have to modify jboss-cache/output/etc/META-I= NF/oodb-service.xml : change CacheLoaderConfig= to point to a valid directory (create it if it doesn't yet exist): = - -<attribute name=3D"CacheLoaderConfig"> - location=3Dc:\\tmp\\oodb - </attribute> - = - - - Then start the beanshell and source oodb.bsh into i= t. Note that oodb.bsh already contains code to create an= d retrieve POJO from the cache. So remember to comment them out if you deci= de to create the Person instance yourself. = - -bela(a)laptop /cygdrive/c/jboss-cache - $ ./runShellDemo.sh - BeanShell 1.3.0 - by Pat Niemeyer (pat(a)pat.net) - bsh % sourceRelative("oodb.bsh"); - interceptor chain is: - class org.jboss.cache.interceptors.CallInterceptor - class org.jboss.cache.interceptors.CacheLoaderInterceptor - class org.jboss.cache.interceptors.TransactionInterceptor - <null> - bsh % - = - - - Next, create an instance of Person, and set its address and other fiel= ds: = - -bsh % p=3Dnew Person(); - <name=3Dnull, age=3D0, hobbies=3D, address=3Dnull, skills= =3Dnull, languages=3Dnull> - bsh % p.age=3D3; - <3> - bsh % p.name=3D"Michelle"; - <Michelle> - bsh % addr=3Dnew Address(); - <street=3Dnull, city=3Dnull, zip=3D0> - bsh % addr.city=3D"San Jose"; - <San Jose> - bsh % addr.zip=3D95124; - <95124> - bsh % addr.street=3D"1704 Almond Blossom Lane"; - <1704 Almond Blossom Lane> - bsh % p.setAddress(addr); - bsh % tree.putObject("/person/me", p); - bsh % p; - <name=3DMichelle, age=3D3, hobbies=3D, address=3Dstreet=3D1= 704 Almond Blossom Lane, = - city=3DSan Jose, zip=3D95124, skills=3Dnull, languages=3Dnull> - bsh % - = - - - The Person object with all of its fields and subobj= ects is now saved. Let's kill beanshell and restart it. At this point, = because the instance of Person we created was given the = name "p", we can retrieve it again: = - -bela(a)laptop /cygdrive/c/jboss-cache - $ ./runShellDemo.sh - BeanShell 1.3.0 - by Pat Niemeyer (pat(a)pat.net) - bsh % sourceRelative("oodb.bsh"); - interceptor chain is: - class org.jboss.cache.interceptors.CallInterceptor - class org.jboss.cache.interceptors.CacheLoaderInterceptor - class org.jboss.cache.interceptors.TransactionInterceptor - <null> - bsh % tree; - </> - bsh % p=3Dtree.getObject("/person/me"); - <name=3DMichelle, age=3D3, hobbies=3D, address=3Dstreet=3D1= 704 Almond Blossom Lane, = - city=3DSan Jose, zip=3D95124, skills=3Dnull, languages=3Dnull> - bsh % tree; - </p - /address - > - bsh % - = - - - The interesting thing here is that the cache was initially empty ("/")= . Only when we loaded "p", did it get populated (lazy loading). You can see= that the values of "p" are loaded from the datastore where they were previ= ously saved. = - -
- = -
- - Replicated cache with shared datastore - - The scenario that we'll run in this example is described in the doc= umentation for JBossCache. It consists of 2 separate nodes that replicate t= heir contents between each other. In addition, they both point to the same datastore. The configuration is in file jboss= -cache/output/etc/META-INF/replAsyncSharedCacheLoader-service.xml= : = - -<!-- Whether or not to fetch state on joining a cluster= --> - <attribute name=3D"FetchStateOnStartup">false</attrib= ute> - <attribute name=3D"CacheLoaderClass">org.jboss.cache.loa= der.FileCacheLoader</attribute> - <attribute name=3D"CacheLoaderConfig"> - location=3Dc:\\tmp - </attribute> - <attribute name=3D"CacheLoaderShared">true</attribute= > - <attribute name=3D"CacheLoaderPreload">/</attribute&g= t; - <attribute name=3D"CacheLoaderFetchTransientState">false= </attribute> - <attribute name=3D"CacheLoaderFetchPersistentState">true= </attribute> - - - The FetchStateOnStartup attribute set to fa= lse means that a newly started cache will not attempt to fetch the state (neither transient nor persistent). Therefore,= attributes CacheLoaderFetchTransientState and = CacheLoaderFetchPersistentState will be ignored. CacheLo= aderShared set to true means that both nodes w= ill share the same datastore, which resides in c:\tmp in= the example (this assumes that both nodes have access to the same file sys= tem). Please make sure that c:\tmp exists, or point the = config string to a different existing directory. = - - - This configuration would essentially provide for two cold nodes, in the sense that all contents of a new cache is in the datast= ore, and is lazy-loaded via the CacheLoader when accessed. However, this is= not true, as CacheLoaderPreload points to "/", which is= the root of the entire tree. Therefore, all of the contents of the cache a= re recursively pre-loaded. This is probably a bad configuration when you ha= ve a lot of data in the cache, because all of your dat= a will be loaded into the cache. = - - - Note that with a shared datastore, the node that makes a modification i= s the one who writes it to the store using the CacheLoader. This prevents b= oth nodes from writing the same data twice. = - - - We can now start 2 instances by opening two shells and executing the fo= llowing ANT target: = - -bela(a)laptop /cygdrive/c/jboss-cache - $ ./build.sh run.demo.async.shared.cacheloader - Buildfile: build.xml - - init: - - compile: - - run.demo.async.shared.cacheloader: - [java] ** node loaded: /a - [java] ** node loaded: /a/b - [java] ** node loaded: /a/b/c - [java] ** node loaded: /uno - [java] ** node loaded: /uno/due - - [java] ------------------------------------------------------- - [java] GMS: address is 192.168.1.184:1357 - [java] ------------------------------------------------------- - [java] interceptor chain is: - [java] class org.jboss.cache.interceptors.CallInterceptor - [java] class org.jboss.cache.interceptors.ReplicationIntercept= or - [java] class org.jboss.cache.interceptors.CacheLoaderIntercept= or - [java] class org.jboss.cache.interceptors.TransactionIntercept= or - [java] ** view change: [192.168.1.184:1355|1] [192.168.1.184:1= 355, - 192.168.1.184:1357] - [java] ** node modified: / - = - - - 2 GUI instances will appear, showing the tree structure of the cache gr= aphically. Nodes can be added, modified or removed by right-clicking or usi= ng the menu. Any modification is replicated between the two nodes. If both = nodes are killed, and subsequently one or both nodes are restarted, the sta= te is the same as before shutdown as it was persisted to the shared store v= ia the CacheLoader. = - - - Note that the example above shows the 2 nodes running on the same machi= ne (192.168.1.184) on ports 1355 and 1357. = - - - - Replicated cache with unshared (local) datastore - - In this example, we'll run 2 nodes again, but this time, instead of= sharing the same datastore, each node has its own datastore. The configura= tion is in file jboss-cache/output/etc/META-INF/node{1,2}.xml . We'll look at node1.xml: = - -<attribute name=3D"CacheLoaderClass">org.jboss.cache= .loader.bdbje.BdbjeCacheLoader</attribute> - <attribute name=3D"CacheLoaderConfig"> - location=3Dc:\\tmp\\node1 - </attribute> - <attribute name=3D"CacheLoaderShared">false</attribut= e> - <attribute name=3D"CacheLoaderPreload">/</attribute&g= t; - <attribute name=3D"CacheLoaderFetchTransientState">false= </attribute> - <attribute name=3D"CacheLoaderFetchPersistentState">true= </attribute> - = - - - Again, we use the Sleepycat CacheLoader implementation in Cach= eLoaderClass . The CacheLoaderConfig points to= c:\tmp\node1 . This is the directory in which the Sleep= ycat DB for node1 will reside. File node2.xml has a configuration that poin= ts to c:\tmp\node2 , so we have 2 different unshared dat= astores. Note that, of course, we still have the same filesystem in our cas= e, because we run the 2 nodes on the same machine. In practice those two di= rectories would reside on two different machines, and each machine would ru= n one JBossCache process. Note that the 2 directories have to exis = - - - To create an unshared datastore, we set the CacheLoaderShared<= /literal> attribute to false . = - - - The example can be run by again opening 2 shells, and running 2 ANT tar= gets (here we show the target for node1): = - -bela(a)laptop /cygdrive/c/jboss-cache - $ ./build.sh run.demo.unshared.node2 - Buildfile: build.xml - - init: - - compile: - - run.demo.unshared.node2: - [java] ** node loaded: /a - [java] ** node loaded: /a/a2 - ... - = - - - The run.demo.unshared.node2 target runs node2, which= will have its own store located at c:\tmp\node2 (shown = above). Whenever a change is made on either of the 2 nodes, it is replicate= d to the other node, and persisted in both local datastores. You can kill a= nd restart a node, or even both nodes, and the data will still be available= due to the persistent backend store(s). = - - - - Troubleshooting - - Here are some tips for troubleshooting, if you encounter problems durin= g this demo. = - - - - - Most of the time, the problem will come from cache replication layer,= i.e., JGroups package. On the output window, you can see the JGroups membe= rship view. See if it is updated when you run the BSH commands. It should s= how a view with at least two members. For example, on my window, I see = - -[java] ** view change: [BWANG-HOME:4381|1] [BWANG-HOME:438= 1, BWANG-HOME:4383] - = - - - with 2 members: 4381 and 4383. On the other hand, if you don't cl= ose the previous running cache instance, the membership view will also incl= ude the previous existing ones. This can corrupt the states. So you will ha= ve to make sure there is no running TreeCache processes before each demo. I= f you have problem with this, please consult the JGroups website - - - - - - -
- Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cach= e_Tutorial_CP08.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP08.ent (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP08.ent 2009-11-19 02:26:31 UTC (rev 8292) @@ -0,0 +1,3 @@ + + + Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cach= e_Tutorial_CP08.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP08.xml (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP08.xml 2009-11-19 02:26:31 UTC (rev 8292) @@ -0,0 +1,503 @@ + + + + + JBossCache Tutorial + + + Introduction + + JBossCache is an in-memory replicated (synchronous or asynchronous), tr= ansactional, and fine-grained cache. It consists of two subsystems: TreeCac= he (plain cache) and PojoCache (object-oriented POJO cache). In this tutori= al, we will demonstrate the usage of both cache features. For details of th= e usage and APIs, please refer to the user manuals for TreeCache and PojoCa= che. = + +
+ Scope + + + + Cache creation and modification + + + + + Replication + + + + + PojoCache + + + + + Transaction + + + +
+ = +
+ + Configuration + + First download the standalone TreeCache code from here. Unzip i= t, and you will get a root directory (jboss-cache in our example). = + + + The configuration files are located under the etc directory. You can mo= dify the behavior of TreeCache through editing the various configuration fi= les. = + + + + + log4j.xml. Logging output. You can turn on logging= level or change log file directory (default is /tmp/jbosscache.lo= g). = + + + + + replSync-service.xml. Tree cache configuration fil= e (file name is not fixed. You specify the file to be read in Prop= ertyConfigurator). The settings are for a replicated, synchronous= , and transactional cache. The default DummyTransactionManager is used with= a transaction isolation level of REPEATABLE_READ. For details of the confi= guration parameters, please refer to the Treecache. Note that this file is used i= n the BSH ( BeanShell, a l= ightweight Java compatible scripting language) script to configure the cach= e. = + + + + + jboss-aop.xml. AOP pointcut and advice definition = for the example POJO classes, Person and Address, respectively. For details= of how to put your own class under AOP, please refer to the PojoCache. This file= is read in when the process is started. = + + + + + + Script + + The script files that are needed (located under install directory) in t= his tutorial are: = + + + + + build.sh (or build.bat for DOS/= Windows). Simple build script that wraps around ant. Users can simply type = sh build.sh for help. Note from now on, we will only ref= er to the Unix version with the understanding that there is a corresponding= DOS counterpart. The same goes for runDemoShell explained next. = + + + + + runDemoShell.sh. Simple run script that wraps arou= nd BeanShell. This is used to operate the replicated cache through interact= ive command line. = + + + + + plain.bsh. Java code that instantiate and configur= e the cache. It also creates an example cache entry. = + + + + + aop.bsh. Java codes that instantiate and configure= the aop cache. In addition, it also sets up the example POJO (plain old Ja= va object) classes (e.g., Person and Address). = + + + + + aopWithTx.bsh. Same with aop.bsh except it also in= stantiates a transaction context. = + + + + + + Example POJO + + The example POJO classes used for PojoCache demo are: Person and Address. They are located under te= sts/org/jboss/cache/aop directory. Person has = attributes of String age, Address addr, List languages = , etc. We will demonstrate that once you put the POJO instance in the cache= , plain get/set POJO methods will be intercepted by the cache. = + + + Here is the snippet of the class definition for Person and Address . = + +public class Person { + String name=3Dnull; + int age=3D0; + Map hobbies=3Dnull; + Address address=3Dnull; + Set skills; + List languages; + + public String getName() { return name; } + public void setName(String name) { this.name=3Dname; } + ... + } + = + +public class Address { + String street=3Dnull; + String city=3Dnull; + int zip=3D0; + + public String getStreet() { return street; } + public void setStreet(String street) { this.street=3Dstreet; } + ... + } + = + + + + Demo + + To run the demo, you will need at least two windows: one to peruse the = cache contents (plus non-aop operations) and the other to operate the cache= directly. Of course, you can also open more than one GUI window to see the= cache replication at work to multiple members. You will also need to run t= he scripts under jboss-cache installation directory after you unzip the rel= ease package (jboss-cache-dist.zip). Due to the limitation of the GUI, plea= se note that: = + + + + + For each demo example, it'd be best if you re-start the whole set= up. + + + + + While you can modify the cache content on the GUI window and it will = show up on the BSH cache content (e.g., through cache.printDetails= () ), this won't work on PojoCache demo. That is, you can onl= y modify the cache content on the BSH window. + + + + + The two demo programs to run are: + + + + + On the first window for the GUI, type sh build.sh = to see the available commands. To run the GUI, type sh build.sh r= un.demo . It will startup a PojoCache GUI. Later on, you can clic= k on a node to view the the contents. Note that you can also add/modify the= node contents for non-AOP cache entries. Since the GUI entry only accepts = String for now, operation on aop cache from the GUI will not always work (u= nless it is a String type). = + + + + + On the second window for the interactive Java commands, type sh runSh= ellDemo.sh to fire off the BeanShell interactive command shell (you can use= either ^D or ^Z in Windows and Unix to exit afterward). You can then read = in the Java code scripts to showcase the cache capabilities (e.g., plain.bs= h, aop.bsh, and aopWithTx.bsh). See the following for details. = + + + + + + Plain cache + + Once you are in the shell, you can either execute the script to populat= e the cache, or type it in manually by command line. To run the script, typ= e sourceRelative("plain.bsh"); under the interactive BSH= shell. For this to work, you'll need to have your working directory se= t to the directory in which plain.bsh resides (otherwise give the full path= name of plain.bsh). Basically, the script will create cache entries that wi= ll be replicated onto the GUI. (You may have to type show() into the result= ing beanshell window yourself) Here are the snippets for the script: = + +import org.jboss.cache.*; + show(); // verbose mode for bean shell + TreeCache tree =3D new TreeCache(); + PropertyConfigurator config =3D new PropertyConfigurator(); = + // configure tree cache. Needs to be in the classpath + config.configure(tree, "META-INF/replSync-service.xml"); + tree.startService(); = + // kick start tree cache + tree.put("/a/b/c", "ben", "me"); = + // create a cache entry. + // Node "/a/b/c" will be created if it does not yet exist. + = + + + You should see in the GUI that a new entry of /a/b/c= has been created. Click on the node c to see the content. You can modify t= he contents from the GUI as well. To create another node, for example, you = can type in the shell: = + +tree.put("/a/b/c/d", "JBoss", "Open Source"); + tree.get("/a/b/c/d", "JBoss"); + = + + + + PojoCache + + Once you are in the shell, type sourceRelative("aop.bsh"); to execute the shell script. Basically, aop.bsh illustrates the step= s to instantiate a cache, configure it, and then create entries under it. H= ere are the snippets: = + +import org.jboss.cache.PropertyConfigurator; + import org.jboss.cache.aop.PojoCache; + import org.jboss.cache.aop.test.Person; + import org.jboss.cache.aop.test.Address; + show(); // verbose mode for bean shell + PojoCache tree =3D new PojoCache(); + PropertyConfigurator config =3D new PropertyConfigurator(); // co= nfigure tree cache. + config.configure(tree, "META-INF/replSync-service.xml"); + Person joe =3D new Person(); // instantiate a Person object named= joe + joe.setName("Joe Black"); + joe.setAge(31); + Address addr =3D new Address(); // instantiate a Address object n= amed addr + addr.setCity("Sunnyvale"); + addr.setStreet("123 Albert Ave"); + addr.setZip(94086); joe.setAddress(addr); // set the address refe= rence + tree.startService(); // kick start tree cache + tree.putObject("/aop/joe", joe); = + // add aop sanctioned object (and sub-objects) into cache. + // since it is aop-sanctioned, use of plain get/set methods will = take care + // of cache contents automatically. + joe.setAge(41); + = + + + Note the API needed to put the object (and its dependent ones) into cac= he is putObject. Once the second window finishes execution, you should see = the first GUI window has been populated with entries of /aop/joe/address. C= lick on each tree node will display different values associated with that n= ode. = + + + Next step to see AOP in action, you can do plain get/set methods withou= t ever worrying about put it in the cache. For example, you can do in the s= hell window joe.setAge(20); and see that GUI gets updated with the age fiel= d automatically (if not, click away and back will refresh the GUI content).= Also to demonstrate the object graph replication, you can modify Joe's= address and see the cache will update it automatically. For example, type = addr.setCity("San Jose"); in the interactive shell, you should see in the G= UI that the address got modified. = + + + Finally, PojoCache also supports get/set with parameter type of Collect= ion classes (i.e., List, Map, and Set). For example, type the following in = the shell command line: = + +ArrayList lang =3D new ArrayList(); + lang.add("Ensligh"); + lang.add("Mandarin"); + joe.setLanguages(lang); + = + + + + PojoCache with Transaction + + To see TreeCache transaction at work, you start with the same setup wit= h last section except you load the bsh of aopWithTx.bsh instead of aop.bsh.= The additional snippets are: = + +import org.jboss.cache.PropertyConfigurator; + import org.jboss.cache.aop.PojoCache; + import org.jboss.cache.aop.test.Person; + import org.jboss.cache.aop.test.Address;// Tx imports + import javax.transaction.UserTransaction; import javax.naming.*; + import org.jboss.cache.transaction.DummyTransactionManager; + show(); // verbose mode for bean shell + // Set up transaction manager + DummyTransactionManager.getInstance(); + Properties prop =3D new Properties(); + prop.put(Context.INITIAL_CONTEXT_FACTORY, + "org.jboss.cache.transaction.DummyContextFactory"); + UserTransaction tx =3D (UserTransaction)new + InitialContext(prop).lookup("UserTransaction"); + PojoCache tree =3D new PojoCache(); + PropertyConfigurator config =3D new PropertyConfigurator(); = + // configure tree cache. + config.configure(tree, "META-INF/replSync-service.xml"); + joe =3D new Person(); + joe.setName("Joe Black"); + joe.setAge(31); + + Address addr =3D new Address(); + addr.setCity("Sunnyvale"); + addr.setStreet("123 Albert Ave"); + addr.setZip(94086); + joe.setAddress(addr); + + tree.startService(); // kick start tree cache + tree.putObject("/aop/joe", joe); // add aop sanctioned object + // since it is aop-sanctioned, use of plain get/set methods will = take care + of cache contents automatically. + // Also it is transacted + tx.begin(); + joe.setAge(41); + joe.getAddress().setZip(95124); + tx.commit(); + = + + + In this example, a default dummy transaction manager is used. + +tx.begin(); + addr.setZip(95131); + tx.rollback(); + = + + + + CacheLoader examples + + All the examples below are based on the JBossCache standalone distribut= ion. We assume the ZIP file has been unzipped into a directory jbo= ss-cache . = + +
+ Local cache with CacheLoader + + This demo shows a local PojoCache with a CacheLoader. We will insert a= POJO into the cache, and see that the POJO is transparently saved using th= e CacheLoader. = + + + To run this, you have to modify jboss-cache/output/etc/META-I= NF/oodb-service.xml : change CacheLoaderConfig= to point to a valid directory (create it if it doesn't yet exist): = + +<attribute name=3D"CacheLoaderConfig"> + location=3Dc:\\tmp\\oodb + </attribute> + = + + + Then start the beanshell and source oodb.bsh into i= t. Note that oodb.bsh already contains code to create an= d retrieve POJO from the cache. So remember to comment them out if you deci= de to create the Person instance yourself. = + +bela(a)laptop /cygdrive/c/jboss-cache + $ ./runShellDemo.sh + BeanShell 1.3.0 - by Pat Niemeyer (pat(a)pat.net) + bsh % sourceRelative("oodb.bsh"); + interceptor chain is: + class org.jboss.cache.interceptors.CallInterceptor + class org.jboss.cache.interceptors.CacheLoaderInterceptor + class org.jboss.cache.interceptors.TransactionInterceptor + <null> + bsh % + = + + + Next, create an instance of Person, and set its address and other fiel= ds: = + +bsh % p=3Dnew Person(); + <name=3Dnull, age=3D0, hobbies=3D, address=3Dnull, skills= =3Dnull, languages=3Dnull> + bsh % p.age=3D3; + <3> + bsh % p.name=3D"Michelle"; + <Michelle> + bsh % addr=3Dnew Address(); + <street=3Dnull, city=3Dnull, zip=3D0> + bsh % addr.city=3D"San Jose"; + <San Jose> + bsh % addr.zip=3D95124; + <95124> + bsh % addr.street=3D"1704 Almond Blossom Lane"; + <1704 Almond Blossom Lane> + bsh % p.setAddress(addr); + bsh % tree.putObject("/person/me", p); + bsh % p; + <name=3DMichelle, age=3D3, hobbies=3D, address=3Dstreet=3D1= 704 Almond Blossom Lane, = + city=3DSan Jose, zip=3D95124, skills=3Dnull, languages=3Dnull> + bsh % + = + + + The Person object with all of its fields and subobj= ects is now saved. Let's kill beanshell and restart it. At this point, = because the instance of Person we created was given the = name "p", we can retrieve it again: = + +bela(a)laptop /cygdrive/c/jboss-cache + $ ./runShellDemo.sh + BeanShell 1.3.0 - by Pat Niemeyer (pat(a)pat.net) + bsh % sourceRelative("oodb.bsh"); + interceptor chain is: + class org.jboss.cache.interceptors.CallInterceptor + class org.jboss.cache.interceptors.CacheLoaderInterceptor + class org.jboss.cache.interceptors.TransactionInterceptor + <null> + bsh % tree; + </> + bsh % p=3Dtree.getObject("/person/me"); + <name=3DMichelle, age=3D3, hobbies=3D, address=3Dstreet=3D1= 704 Almond Blossom Lane, = + city=3DSan Jose, zip=3D95124, skills=3Dnull, languages=3Dnull> + bsh % tree; + </p + /address + > + bsh % + = + + + The interesting thing here is that the cache was initially empty ("/")= . Only when we loaded "p", did it get populated (lazy loading). You can see= that the values of "p" are loaded from the datastore where they were previ= ously saved. = + +
+ = +
+ + Replicated cache with shared datastore + + The scenario that we'll run in this example is described in the doc= umentation for JBossCache. It consists of 2 separate nodes that replicate t= heir contents between each other. In addition, they both point to the same datastore. The configuration is in file jboss= -cache/output/etc/META-INF/replAsyncSharedCacheLoader-service.xml= : = + +<!-- Whether or not to fetch state on joining a cluster= --> + <attribute name=3D"FetchStateOnStartup">false</attrib= ute> + <attribute name=3D"CacheLoaderClass">org.jboss.cache.loa= der.FileCacheLoader</attribute> + <attribute name=3D"CacheLoaderConfig"> + location=3Dc:\\tmp + </attribute> + <attribute name=3D"CacheLoaderShared">true</attribute= > + <attribute name=3D"CacheLoaderPreload">/</attribute&g= t; + <attribute name=3D"CacheLoaderFetchTransientState">false= </attribute> + <attribute name=3D"CacheLoaderFetchPersistentState">true= </attribute> + + + The FetchStateOnStartup attribute set to fa= lse means that a newly started cache will not attempt to fetch the state (neither transient nor persistent). Therefore,= attributes CacheLoaderFetchTransientState and = CacheLoaderFetchPersistentState will be ignored. CacheLo= aderShared set to true means that both nodes w= ill share the same datastore, which resides in c:\tmp in= the example (this assumes that both nodes have access to the same file sys= tem). Please make sure that c:\tmp exists, or point the = config string to a different existing directory. = + + + This configuration would essentially provide for two cold nodes, in the sense that all contents of a new cache is in the datast= ore, and is lazy-loaded via the CacheLoader when accessed. However, this is= not true, as CacheLoaderPreload points to "/", which is= the root of the entire tree. Therefore, all of the contents of the cache a= re recursively pre-loaded. This is probably a bad configuration when you ha= ve a lot of data in the cache, because all of your dat= a will be loaded into the cache. = + + + Note that with a shared datastore, the node that makes a modification i= s the one who writes it to the store using the CacheLoader. This prevents b= oth nodes from writing the same data twice. = + + + We can now start 2 instances by opening two shells and executing the fo= llowing ANT target: = + +bela(a)laptop /cygdrive/c/jboss-cache + $ ./build.sh run.demo.async.shared.cacheloader + Buildfile: build.xml + + init: + + compile: + + run.demo.async.shared.cacheloader: + [java] ** node loaded: /a + [java] ** node loaded: /a/b + [java] ** node loaded: /a/b/c + [java] ** node loaded: /uno + [java] ** node loaded: /uno/due + + [java] ------------------------------------------------------- + [java] GMS: address is 192.168.1.184:1357 + [java] ------------------------------------------------------- + [java] interceptor chain is: + [java] class org.jboss.cache.interceptors.CallInterceptor + [java] class org.jboss.cache.interceptors.ReplicationIntercept= or + [java] class org.jboss.cache.interceptors.CacheLoaderIntercept= or + [java] class org.jboss.cache.interceptors.TransactionIntercept= or + [java] ** view change: [192.168.1.184:1355|1] [192.168.1.184:1= 355, + 192.168.1.184:1357] + [java] ** node modified: / + = + + + 2 GUI instances will appear, showing the tree structure of the cache gr= aphically. Nodes can be added, modified or removed by right-clicking or usi= ng the menu. Any modification is replicated between the two nodes. If both = nodes are killed, and subsequently one or both nodes are restarted, the sta= te is the same as before shutdown as it was persisted to the shared store v= ia the CacheLoader. = + + + Note that the example above shows the 2 nodes running on the same machi= ne (192.168.1.184) on ports 1355 and 1357. = + + + + Replicated cache with unshared (local) datastore + + In this example, we'll run 2 nodes again, but this time, instead of= sharing the same datastore, each node has its own datastore. The configura= tion is in file jboss-cache/output/etc/META-INF/node{1,2}.xml . We'll look at node1.xml: = + +<attribute name=3D"CacheLoaderClass">org.jboss.cache= .loader.bdbje.BdbjeCacheLoader</attribute> + <attribute name=3D"CacheLoaderConfig"> + location=3Dc:\\tmp\\node1 + </attribute> + <attribute name=3D"CacheLoaderShared">false</attribut= e> + <attribute name=3D"CacheLoaderPreload">/</attribute&g= t; + <attribute name=3D"CacheLoaderFetchTransientState">false= </attribute> + <attribute name=3D"CacheLoaderFetchPersistentState">true= </attribute> + = + + + Again, we use the Sleepycat CacheLoader implementation in Cach= eLoaderClass . The CacheLoaderConfig points to= c:\tmp\node1 . This is the directory in which the Sleep= ycat DB for node1 will reside. File node2.xml has a configuration that poin= ts to c:\tmp\node2 , so we have 2 different unshared dat= astores. Note that, of course, we still have the same filesystem in our cas= e, because we run the 2 nodes on the same machine. In practice those two di= rectories would reside on two different machines, and each machine would ru= n one JBossCache process. Note that the 2 directories have to exis = + + + To create an unshared datastore, we set the CacheLoaderShared<= /literal> attribute to false . = + + + The example can be run by again opening 2 shells, and running 2 ANT tar= gets (here we show the target for node1): = + +bela(a)laptop /cygdrive/c/jboss-cache + $ ./build.sh run.demo.unshared.node2 + Buildfile: build.xml + + init: + + compile: + + run.demo.unshared.node2: + [java] ** node loaded: /a + [java] ** node loaded: /a/a2 + ... + = + + + The run.demo.unshared.node2 target runs node2, which= will have its own store located at c:\tmp\node2 (shown = above). Whenever a change is made on either of the 2 nodes, it is replicate= d to the other node, and persisted in both local datastores. You can kill a= nd restart a node, or even both nodes, and the data will still be available= due to the persistent backend store(s). = + + + + Troubleshooting + + Here are some tips for troubleshooting, if you encounter problems durin= g this demo. = + + + + + Most of the time, the problem will come from cache replication layer,= i.e., JGroups package. On the output window, you can see the JGroups membe= rship view. See if it is updated when you run the BSH commands. It should s= how a view with at least two members. For example, on my window, I see = + +[java] ** view change: [BWANG-HOME:4381|1] [BWANG-HOME:438= 1, BWANG-HOME:4383] + = + + + with 2 members: 4381 and 4383. On the other hand, if you don't cl= ose the previous running cache instance, the membership view will also incl= ude the previous existing ones. This can corrupt the states. So you will ha= ve to make sure there is no running TreeCache processes before each demo. I= f you have problem with this, please consult the JGroups website + + + + + + +
+ Modified: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/Revisio= n_History.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/Revision_Hist= ory.xml 2009-11-19 02:24:19 UTC (rev 8291) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/en-US/Revision_Hist= ory.xml 2009-11-19 02:26:31 UTC (rev 8292) @@ -8,15 +8,16 @@ 1.0 - + Tue Nov 19 2009 - - - + Laura + Bailey + lbailey(a)redhat.com - + Initial = +draft. --===============7964894625799929383==-- From jbosscache-commits at lists.jboss.org Wed Nov 18 22:25:08 2009 Content-Type: multipart/mixed; boundary="===============4824116573187982825==" MIME-Version: 1.0 From: VIAGRA Store (c tm) To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] Personal 75% OFF to jbosscache-commits@lists.jboss.org. Pfizer. Date: Wed, 18 Nov 2009 22:25:07 -0500 Message-ID: <200911190325.nAJ3P7Wg028475@lists01.dmz-a.mwc.hst.phx2.redhat.com> --===============4824116573187982825== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable --===============4824116573187982825== Content-Type: text/html MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFs Ly9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L2xvb3NlLmR0ZCI+CjxodG1sPgo8aGVh ZD4KPG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNo YXJzZXQ9dXRmLTgiPgo8dGl0bGU+V2VibGV0dGVyPC90aXRsZT4KPC9oZWFkPgoKPGJvZHk+Cgo8 dGFibGUgd2lkdGg9IjEwMCUiIGJvcmRlcj0iMCIgY2VsbHNwYWNpbmc9IjAiIGNlbGxwYWRkaW5n PSIwIj4KICA8dHI+CiAgICA8dGQgYWxpZ249ImNlbnRlciIgdmFsaWduPSJ0b3AiIGJnY29sb3I9 IiM2NjY2NjYiPjx0YWJsZSB3aWR0aD0iNzAwIiBib3JkZXI9IjAiIGNlbGxwYWRkaW5nPSIwIiBj ZWxsc3BhY2luZz0iMCI+CiAgICA8dHI+PHRkIGFsaWduPSJjZW50ZXIiIGJnY29sb3I9IiNGRkZG RkYiPgogICAgPGZvbnQgY29sb3I9IiMwMDAwMDAiIHNpemU9IjEiIGZhY2U9IkFyaWFsLCBIZWx2 ZXRpY2EsIHNhbnMtc2VyaWYiPgogICAgIEhhdmluZyB0cm91YmxlIHZpZXdpbmcgaW1hZ2VzPyA8 YSBocmVmPSJodHRwOi8vYzNmY2QwNDM2NC54dXdlbGR2LmNuLyI+Q2xpY2sgaGVyZTwvYT4gdG8g dmlldyBhcyBhIHdlYnBhZ2UuPGJyPgoJCTwvZm9udD4KICAgIDwvdGQ+CiAgIAk8L3RyPgogICAg PHRyIGJnY29sb3I9IiNGRkZGRkYiPjx0ZCBhbGlnbj0iY2VudGVyIiB2YWxpZ249InRvcCIgYmdj b2xvcj0iI0ZGRkZGRiI+CgogICAgPHRhYmxlIGJvcmRlcj0iMCIgY2VsbHNwYWNpbmc9IjAiIGNl bGxwYWRkaW5nPSIwIj4KICAgIDx0cj48dGQgYmdjb2xvcj0iIzk5OTk5OSI+Jm5ic3A7PC90ZD4K ICAgIDwvdHI+CiAgICAgIDx0cj4KICAgICAgICA8dGQgd2lkdGg9IjI0MiIgYWxpZ249InJpZ2h0 IiB2YWxpZ249Im1pZGRsZSI+PGZvbnQgZmFjZT0iQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJp ZiIgIHN0eWxlPSJmb250LXNpemU6MTFweDsiIGNvbG9yPSIjMDAwMDAwIj48c3Ryb25nPgoJCVZv bHVtZSAyNCwgSXNzdWUgPGZvbnQgZmFjZT0iQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZiIg IHN0eWxlPSJmb250LXNpemU6MTFweDsiIGNvbG9yPSIjMDAwMDAwIj4KCQk2NTwvZm9udD4gfCA8 L3N0cm9uZz48Zm9udCBjb2xvcj0iIzAwNjlCNyI+PHN0cm9uZz4KCQlOb3ZlbWJlciAxOCwgMjAw OTwvc3Ryb25nPjwvZm9udD48L2ZvbnQ+PC90ZD4KICAgICAgPC90cj4KICAgICAgICAgICAgICA8 dHI+CiAgICAgICAgICAgICAgICA8dGQgYWxpZ249ImNlbnRlciI+PGJyPjxhIGhyZWY9Imh0dHA6 Ly8yYTUwMDE2N2IueHV3ZWxkdi5jbi8iPgoJCQkJPGltZyBhbHQ9IlRyeSB0aGlzIGxpbmssIGlm IHRoaXMgcGljdHVyZSdzIHVuYXZhaWxhYmxlIiBoZWlnaHQ9IjMyMCIgc3JjPSJodHRwOi8vNmIz MmMzYS54dXdlbGR2LmNuLzM0ZTU1YzM3LmdpZiIgc3R5bGU9ImJvcmRlci13aWR0aDogMHB4IiB3 aWR0aD0iNTQwIj4KCQkJCTwvYT48L3RkPgogICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAg IDwvdGFibGU+Cgk8dGFibGUgYm9yZGVyPSIwIiBjZWxsc3BhY2luZz0iMCIgY2VsbHBhZGRpbmc9 IjEyIj4KICAgICAgPHRyPgogICAgICAgIDx0ZCBhbGlnbj0ibGVmdCIgdmFsaWduPSJ0b3AiPjxm b250IGZhY2U9IkFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWYiICAgc3R5bGU9ImZvbnQtc2l6 ZToxMnB4OyIgY29sb3I9IiMwMDAwMDAiPgo8c3Ryb25nPk1hbmFnZSBNeSBFJiM4MjExO21haWwg U3Vic2NyaXB0aW9uczwvc3Ryb25nPgo8YnI+Cjxicj4KCQlJZiB5b3Ugd291bGQgbGlrZSB0byBj YW5jZWwgeW91ciBzdWJzY3JpcHRpb24sIHBsZWFzZSA8YSBocmVmPSJodHRwOi8vMmEyYjQzLnh1 d2VsZHYuY24vIj5jbGljayBoZXJlPC9hPi48YnI+CklmIHlvdSB3b3VsZCBwcmVmZXIgdG8gc3Rv cCByZWNlaXZpbmcgPHN0cm9uZz5hbGwgZSYjODIxMTttYWlsPC9zdHJvbmc+IGZyb20gdXMsICBw bGVhc2UgPGEgaHJlZj0iaHR0cDovLzhmYjM1MjMxLnh1d2VsZHYuY24vIj5jbGljayBoZXJlPC9h Pi48YnI+Cjxicj4KCQk8c3Ryb25nPlByaXZhY3kgU3RhdGVtZW50PC9zdHJvbmc+PGJyPgoJCVNl ZSBvdXIgPGEgaHJlZj0iaHR0cDovLzc0YTg2ZmM3ZjIueHV3ZWxkdi5jbi8iPnByaXZhY3kgcG9s aWN5PC9hPiBmb3IgYWRkaXRpb25hbCBpbmZvcm1hdGlvbi4KCQk8YnI+Cjxicj4KPC9mb250Pjxj ZW50ZXI+CiAgPGZvbnQgY29sb3I9IiMwMDAwMDAiIGZhY2U9IlRyZWJ1Y2hldCBNUywgVmVyZGFu YSIgc3R5bGU9ImZvbnQtc2l6ZToxMnB4OyI+CgkJTmluZXAgPGEgaHJlZj0iaHR0cDovL2FmYjBi OWRlZWIueHV3ZWxkdi5jbi8iPiZjb3B5OzE5OTgtMjAwOTwvYT4sIEFsbCByaWdodHMgcmVzZXJ2 ZWQuIDwvZm9udD4KPC9jZW50ZXI+CiAgICAgICAgPC90ZD4KICAgICAgPC90cj4KICAgIDwvdGFi bGU+CgoKCgkJPC90ZD4KICAgIDwvdHI+CiAgICA8L3RhYmxlPgoKICAgIDwvdGQ+CiAgPC90cj4K PC90YWJsZT4KPC9ib2R5Pgo8L2h0bWw+Cg== --===============4824116573187982825==-- From jbosscache-commits at lists.jboss.org Wed Nov 18 23:06:05 2009 Content-Type: multipart/mixed; boundary="===============7536008893958144781==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8293 - enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US. Date: Wed, 18 Nov 2009 23:06:04 -0500 Message-ID: <200911190406.nAJ464MY025336@svn01.web.mwc.hst.phx2.redhat.com> --===============7536008893958144781== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-18 23:06:04 -0500 (Wed, 18 Nov 2009) New Revision: 8293 Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Frequen= tly_Asked_Questions_CP07.ent enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Frequen= tly_Asked_Questions_CP07.xml Removed: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Frequen= tly_Asked_Questions_CP06.ent enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Frequen= tly_Asked_Questions_CP06.xml Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/Book_Info.xml Log: Adding changes for CP07 build. Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/Book_Info.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/Book_Info.xml 2009= -11-19 02:26:31 UTC (rev 8292) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/Book_Info.xml 2009= -11-19 04:06:04 UTC (rev 8293) @@ -2,8 +2,8 @@ = - JBoss Cache Frequently Asked Questions CP06 - for Use with JBoss Enterprise Application Platform 4.3 Cumulati= ve Patch 6 + JBoss Cache Frequently Asked Questions CP07 + for Use with JBoss Enterprise Application Platform 4.3 Cumulati= ve Patch 7 2.0 1 JBoss Enterprise Application Platform Deleted: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_F= requently_Asked_Questions_CP06.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP06.ent 2009-11-19 02:26:31 UTC (rev 8292) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP06.ent 2009-11-19 04:06:04 UTC (rev 8293) @@ -1,3 +0,0 @@ - - - Deleted: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_F= requently_Asked_Questions_CP06.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP06.xml 2009-11-19 02:26:31 UTC (rev 8292) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP06.xml 2009-11-19 04:06:04 UTC (rev 8293) @@ -1,2252 +0,0 @@ - - - - - - - - General Information - - - - What is JBoss Cache? - - - - JBoss Cache is a replicated and transactional cache. = It is - replicated since multiple JBoss Cache instances can be d= istributed - (either within the same JVM or across several JVMs wheth= er they reside on - the same machine or on different machines on a network) = and data is - replicated across the whole group. It is transactional b= ecause a - user can configure a JTA compliant transaction manager a= nd make the cache - operation transactional. Note that the cache can also be= run without - any replication; this is the local mode. - - - Currently, JBoss Cache consists of two components: a = generic cache - (implemented internally as - org.jboss.cache.TreeCache - ) and a POJO cache (implemented - internally as - org.jboss.cache.aop.PojoCache - ). - TreeCache - is a tree-structured cache that provides replication and - transaction context, while - PojoCache - extends the functionality of - TreeCache - but behaves as a true object cache providing transparent - and finer-grained object mapping into internal cache. - - - - - - - Who are the JBoss Cache developers? - - - - JBossCache has been developed by Bela Ban, Ben Wang, = Harald - Gliebe, Manik Surtani and Brian Stansberry. Manik is the= lead on JBoss Cache and Ben is the lead on - PojoCache. - - - - - - - What is the license for JBoss Cache? - - - - JBoss Cache is licensed under - LGP= L - . - - - - - - - Where can I download JBoss Cache? - - - - The JBoss Cache - product download page - has prebuilt binaries as well as source distributions. Y= ou can also grab snapshots from the JBoss CVS - repository (see - this wiki page - ) - the module name is - JBossCache - - - - - - - How do I build JBoss Cache from CVS sources? - - - - To build, do - sh build.sh - jar - - . This will produce - jboss-cache.jar - in the - dist/lib - directory. Or if you want to - build the standalone package, do - sh build.sh dist - this will produce - dist/jboss-cache-dist.zip - 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. - - - - - - - Which JVMs are supported by JBoss Cache? - - - - JBoss Cache has been tested and supported on J2SE 1.4= .x and JDK 5.0. - On jboss-3.2 CVS tree, it also compiles on JDK1.3, but t= here is no - official support for this version and using this is not = recommended. - - - - - - - From JBoss Cache 1.3.0 onwards, there is a new direct= ory - lib-50 - , - what is it? - - - - - From JBoss Cache 1.3.0 onwards, we support the use of= Java 5 annotations, used by PojoCache. - As a result, there are - jboss-aop-jdk50.jar - and - jboss-cache-jdk50.jar - that - are needed to work with the Java 5 annotations. You will= need to replace - jboss-aop.jar - and - jboss-cache.jar - in the lib directory with the - -jdk50 - versions if you intend - to use PojoCache, Java 5 and annotations. - - - - - - - How do I know the version of JBoss Cache that I am us= ing? - - - - Since release 1.2, you can check the jar version by r= unning: - java -jar jboss-cache.jar org.jboss.cache.Version<= /code> - . - - - - - - - Can I run JBoss Cache outside of JBoss Application - Server? - - - - - Of course! JBoss Cache comes in two flavors: - - - - Integrated with JBoss Application Server as an = MBean service. - - - - Standalone, that can run in any Java EE server = such - as BEA WebLogic or IBM Websphere. Of course, it ca= n also run in - a standalone Java process (i.e., outside Java EE c= ontext). - - - - - - - - - Where can I report bugs or problems? - - - - Please report any bugs or problems to - JBoss Cache - User Forum - - . - - - - - - - JBoss Cache - Tree Cache - - - - How do I deploy JBoss Cache as a MBean service? - - - - To deploy JBoss Cache as an MBean inside JBoss, you c= an copy the - configuration xml file over to the - deploy - directory (from - all - configuration whereby the - necessary jars are present). Under the standalone package - etc/META-INF - directory , there are example - configuration files for different cache modes that can b= e used to - deploy JBoss Cache as well. - - - - - - - How do I know if my JBoss Cache MBean has been deploy= ed? - - - - To verify that your JBoss Cache MBean is deployed cor= rectly, - you can first check the log output under the command con= sole. Next - you can verify it from JBoss JMX console. Look for - jboss.cache - domain. - - - - - - - How do I access the JBoss Cache MBean? - - - - Accessing the JBoss Cache MBean is just like accessin= g any - JBoss MBean. Here is a code snippet: - - - - import org.jboss.mx.util.MBeanServerLocator; - import org.jboss.mx.util.MBeanProxyExt; - import org.jboss.cache.TreeCacheMBean; - import javax.management.MBeanServer; - ... - = - MBeanServer server; - TreeCacheMBean cache; - = - public init() throws Exception - { - try - { - server =3D MBeanServerLocator.locateJBoss(); - cache =3D (TreeCacheMBean) MBeanProxyExt.create(TreeCacheMBean.class, - "jboss.cache:service=3DTreeCache", - server); - } - catch (Exception ex) - { - // handle exception - } - } - = - public void myBusinessMethod() - { - Object value =3D cache.get("/my/node", "myKey"); - = - HashMap stuff =3D new HashMap(); - stuff.put("key1", "value1"); - stuff.put("key2", "value2"); - stuff.put("key3", "value3"); - = - cache.put("/my/new/node", stuff); - = - cache.remove("/my/node"); - = - ... - } - = - - - - - - - Can I run JBoss Cache on JBoss AS 3.2.x releases? - - - - Yes. The JBoss Cache source code is also up to date o= n the - jboss-3.2 CVS branch. However, only TreeCache is support= ed there - since JBossAop (which PojoCache relies on) is only avail= able in JBoss AS 4.x onwards. - - - - - - - Can I run multiple JBoss Cache instances on the same = VM? - - - - Yes. There are some scenarios where you may want to r= un - multiple instances of JBoss Cache. For example, you want= to run - multiple local cache instances with each instance having= its own - configuration (e.g., different cache policy). In this ca= se, you will - need multiple xml configuration files. - - - - - - - Can TreeCache run as a second level cache inside - Hibernate? - - - - - Yes. Since Hibernate 3.0 release, you can configure i= t to use - JBoss Cache (namely, TreeCache) as a second level cache.= For details, - see Hibernate documentation, and also see - - http://wiki.jboss.org/wiki/Wiki.jsp?page=3DJBossCache= Hibernate - - - - Note that since Hibernate 3.0.2 and JBossCache 1.2.2,= we have - fixed a critical bug that depending on the usage pattern= can cause - deadlock during query caching. - - - - - - - What about using PojoCache as a Hibernate cache? - - - - It is not necessary to use PojoCache for second level - cache inside Hibernate because Hibernate - manages fine-grained fields in Java objects. So using Po= joCache won't - provide any advantage. - - - - - - - How can I configure JBoss Cache? - - - - You can configure the JBoss Cache through a configura= tion xml - file. Or you can set it programmatically through its get= /set methods. - Check with the documentation for both examples. - - - - - - - In the configuration xml file, there are tags such as - class - , - MBean - , etc. What are - these? - - - - - These are tags for deploying JBoss Cache as a JBoss M= Bean - service. For consistency, we have kept them in the - standalone package as well, specifically, the - MBean - tag. If you run in standalone mode, - JBoss Cache will ignore these elements. - - - - - - - What is the difference between the different cache - modes? - - - - - JBossCache has five different cache modes, i.e., - LOCAL - , - REPL_SYNC - , - REPL_ASYNC - , - INVALIDATION_SYNC - and - INVALIDATION_ASYNC - . If you want to run JBoss Cache as a - single instance, then you should set the cache mode to - LOCAL - so that it won't attempt to replicate anything. - If you want to have synchronous replication among differ= ent - JBoss Cache instances, you set it to - REPL_SYNC - . - For asynchronous replication, use - AYSNC_REPL - . If you do not wish to replicate cached data but simply= inform other caches in a cluster that data - under - specific addresses are now stale and should be evicted f= rom memory, use - INVALIDATION_SYNC - or - INVALIDTAION_ASYNC - . Synchronous and asynchronous behavior applies to inval= idation as well as replication. - - - Note that - ASYNC_REPL - and - INVALIDATION_ASYNC - are non-blocking. This - can be useful when you want to have another JBoss Cache = serving as a - mirror or backup and you don't want to wait for confirma= tion that this mirror has received your - messages. - - - - - - - How does JBoss Cache's replication mechanism work? - - - - JBoss Cache leverages - JGroups - as a replication layer. A user - can configure the cluster of JBoss Cache instances by sh= aring the - same cluster name ( - cluster name - ). There is also - an option of whether to populate the cache data upon sta= rting a new - instance in the - ClusterConfig - attribute. - - - Note that once all instances join the same replicatio= n group, - every replication change is propagated to all participat= ing members. - There is no mechanism for sub-partitioning where some re= plication - can be done within only a subset of members. This is on = our to do - list. - - - - - - - I run a 2 node cluster. If the network dies, do the c= aches continue to run? - - - - Yes, both will continue to run, but depending on your= replication mode, all transactions or - operations may not complete. If - REPL_SYNC - is used, operations will fail while if - REPL_ASYNC - is used they will succeed. Even if they succeed though, = caches will be out of sync. - - - - - - - - Can I plug in library X instead of JGroups to handle = remote calls and group communications? - - - - At this stage (JBoss Cache 1.x) the answer is no. We = do have an abstraction layer between the - communication suite and JBoss Cache in the pipelines, an= d this may appear as a feature at some stage - in - the future. - - - - - - - Does the cache need to replicate to every other insta= nce in the cluster? Isn't this slow if the - cluster is large? - - - - - As of JBoss Cache 1.4.0, replication need not occur t= o every node in the cluster. This feature - - called Buddy Replication - - allows each node to pick one or more 'buddies' in the cl= uster and only replicate to its buddies. This - allows a cluster to scale - very easily with no extra impact on memory or network tr= affic with each node added. - - - See the User Guide for more information on Buddy Replica= tion, and how it can be used to achieve very - high - scalability. - - - - - - - If I have the need for different TreeCache properties= (e.g., - CacheMode - and - IsolationLevel - ), do I simply need to create multiple - TreeCache instances with the appropriate configuration? - - - - - Yes. All the above mentioned properties are per cache - instance. Therefore you will need a separate JBoss Cache - instance. - - - - - - - Does the Tree Cache config - ClusterName - have - any relation to the JBoss AS cluster - PartitionName - ? - - - - - Yes. They are both JGroups group names. Besides the n= otion of - a channel in JGroups, it also can partition the channel = into different - group names. - - - - - - - When using multiple JGroups based components - [cluster-service.xml, treecache (multiple instances)], w= hat is the - correct/valid way to configure those components to make = sure my - multicast addresses don't conflict? - - - - - There are two parameters to consider: multicast addre= ss (plus - port) and the group name. At minimum, you will have to r= un - components using a different group name. But whether to = run them on - the same channel depends upon whether the communication = performance - is critical for you or not. If it is, then it'd be best = to run them - on different channels. - - - - - - - Does JBoss Cache currently support cache persistence - storage? - - - - - Yes. Starting with release 1.1, JBoss Cache has a Cac= heLoader - interface that supports cache persistence. See below. - - - - - - - Does JBoss Cache currently support cache passivation/= overflow - to a data store? - - - - - Yes. Starting with release 1.2.4, JBoss Cache uses the - CacheLoader to support cache passivation/ overflow. See - documentation on how to configure and use this feature. - - - - - - - Is JBoss Cache thread safe? - - - - Yes, it is thread safe. - - - - - - Does JBoss Cache support XA (2PC) transactions now? - - - - No, although it is also on our to do list. Our intern= al - implementation does use a similar 2PC procedure to coord= inate a - transaction among different instances. - - - - - - - Which TransactionManagers are supported by - JBoss Cache? - - - - - JBoss Cache supports any TransactionManager that is J= TA - compliant such as JBossTM. A user can configure the tran= saction - manager through the configuration xml setting. JBossCach= e also has a - built in dummy transaction manager - ( - org.jboss.cache.tm.DummyTransactionManager - ) for - testing purposes only. But note that - DummyTransactionManager - is not thread safe .i.e., - it does not support concurrent transactions. Instead, on= ly one - transaction is allowed at a time. - - - - - - - How do I set up the cache to be transactional? - - - - You either use the default (JBoss) TransactionManager= to run - JBossCache inside JBoss, or you have to implement the - TransactionManagerLookup - interface, and return an - instance of your javax.transaction.TransactionManager. T= he - configuration property - TransactionManagerLookupClass - defines the class - to be used by the cache to fetch a reference to a - TransactionManager. It is trivial to implement this clas= s to support - other TransactionManagers. Once this attribute is specif= ied, the - cache will look up the transaction context from this tra= nsaction - manager. - - - For the client code, here is a snippet to start and c= ommit a - transaction: - - - tx =3D (UserTransaction)new InitialContext(prop).lookup(= "UserTransaction"); - tree =3D new TreeCache(); - config =3D new PropertyConfigurator(); - config.configure(tree, "META-INF/replSync-service.xml"); - - tx.begin() - tree.put(fqn, key, value); - tx.commit(); - - - - - - - How do I control the cache locking level? - - - - JBossCache lets you control the cache locking level t= hrough - the transaction isolation level. This is configured thro= ugh the - attribute - IsolationLevel - . Currently, JBossCache - employs pessimistic locking internally. And the transact= ion - isolation level from the pessimist locking corresponds t= o JDBC - isolation levels, namely, - NONE - , - READ_UNCOMMITTED - , - READ_COMMITTED - , - REPEATABLE_READ - , and - SERIALIZABLE - . Note that these isolation levels are ignored if optimi= stic locking is used. For details, please - refer - to the - user manual. - - - - - - - How does JBoss Cache lock data for concurrent access?= - - - - By default JBoss Cache uses pessimistic locking to lo= ck data nodes, based on the isolation level - configured. Since JBoss Cache 1.3.0, we also offer optim= istic locking to allow for greater concurrency - at - the cost of slight processing overhead and performance. = See the documentation for a more detailed - discussion on concurrency and locking in JBoss Cache. - - - - - - - - How do I enable Optimistic Locking in JBoss Cache? - - - - Use the XMl attribute - NodeLockingScheme - . Note that - IsolationLevel - is ignored if - NodeLockingScheme - is set to - OPTIMISTIC - . Also note that - NodeLockingScheme - defaults to - PESSIMISTIC - if omitted. - - - - - - - - How does the write lock apply to an Fqn node, say, - "/org/jboss/test"? - - - - - First of all, JBossCache has a notion of - root - that serves as a starting point for every navigational o= peration. - The default is "/" (since the default separator is "/" f= or the fqn). - The locking then is applied to the node under root, for = example - "/org" (no locking "/"). - - - Furthermore, let's say when JBossCache needs to apply= a write - lock on node "/org/jboss/test", it will first try to obt= ain read - lock from the parent nodes recursively (in this example,= "/org", and - "/org/jboss"). Only when it succeeds then it will try to= obtain a - write lock on "/org/jboss/test". - - - - - - - Can I use the cache locking level even without a tran= saction - context? - - - - - Yes. JBossCache controls the individual node locking = behavior - through the isolation level semantics. This means even i= f you don't - use a transaction, you can specify the lock level via is= olation - level. You can think of the node locking behavior outsid= e of a - transaction as if it is under transaction with - auto_commit - on. - - - - - - - With replication (REPL_SYNC/REPL_ASYNC) or invalidati= on (INVALIDATION_SYNC/INVALIDATION_ASYNC), how - often does the cache broadcast messages over the network? - - - - - If the updates are under transaction, then the broadc= asts - happen only when the transaction is about to commit (act= ually - during the prepare stage internally). That is, it will b= e a batch - update. However, if the operations are not under transac= tion - context, then each update will trigger replication. Note= that this - has performance implication if network transport is heav= y (it - usually is). - - - - - - - How can I do a mass removal? - - - - If you do a cache.remove("/root"), it will recursivel= y remove - all the entries under "/root". - - - - - - - Can I monitor and manage the JBoss Cache? - - - - With JBoss Cache 1.3.0, you can if you are running JB= oss Cache within JBoss AS or are using JDK - 5.0's - jconsole - utility. See the chapter titled - Management Information - in the JBoss Cache user guide for more details. - - - - - - - Can I disable JBoss Cache management attributes in JB= oss Cache 1.3.0? - - - - Yes, you can. Set the - UseInterceptorMbeans - configuration attribute to - false - (this defaults to - true - ). See the chapter titled - Management Information - in the JBoss Cache user guide for more details. - - - - - - - What is jboss-serialization.jar, introduced in JBoss = Cache 1.4.x and do I need this? - - - jboss-serialization.jar is the - - JBoss Serialization - - library, which is much more efficient in terms - of speed and CPU usage as well as the generated byte str= eam size than standard Java serialization. - This - very - significantly improves replication performance of custom= objects placed in the cache. - - - From 1.4.x, JBoss Cache relies on this library and it is= needed to run JBoss Cache. - - - - - - - Can I disable JBoss Serialization and revert back to = standard Java serialization? - - - - Yes you can, by passing in the - -Dserialization.jboss=3Dfalse - environment variable to your JVM. - - - - - - - - Does JBoss Cache support partitioning? - - - - Not right now. JBoss Cache does not support partition= ing that a - user can configure to have different set of data residin= g on - different cache instances while still participating as a= replication - group. - - - - - - - Does JBoss Cache handle the concept of application cl= assloading - inside, say, a J2EE container? - - - - - Application-specific classloading is used widely insi= de a J2EE - container. For example, a web application may require a = new - classloader to scope a specific version of the user libr= ary. - However, by default JBoss Cache is agnostic to the class= loader. In - general, this leads to two kinds of problems: - - - - - Object instance is stored in cache1 and replica= ted to - cache2. As a result, the instance in cache2 is cre= ated by the - system classloader. The replication may fail if th= e system - classloader on cache2 does not have access to the = required - class. Even if replication doesn't fail, a user th= read in cache2 - may not be able to access the object if the user t= hread is - expecting a type defined by the application classl= oader. - - - - - Object instance is created by thread 1 and will= be - accessed by thread 2 (with two different classload= ers). - JBossCache has no notion of the different classloa= ders involved. - As a result, you will have a - ClassCastException - . This is a standard - problem in passing an object from one application = space to - another; JBossCache just adds a level of indirecti= on in passing - the object. - - - - - To solve the first kind of issue, in JBoss Cache 1.2.= 4 we - introduced the concept of a - TreeCacheMarshaller - . - Basically, this allows application code to register a cl= assloader - with a portion of the cache tree for use in handling obj= ects - replicated to that portion. See the TreeCacheMarshaller = section of - the user guide for more details. - - - To solve the second kind of issue, the only solution = (that we - know of) is to cache "serialized" byte code and only de-= serialize it - during every object get (and this will be expensive!). T= hat is, - during a put operation, the object instance will be seri= alized and - therefore can be deserialized safely by a "foreign" clas= sloader. - However, the performance penalty of this approach is qui= te severe so - in general another local in-vm version will need to be u= sed as a - "near-line" cache. Note also that each time the serializ= ed bytes are - deserialized, a new instance of the object is created. - - - To help with this kind of handling, JBoss has a utili= ty class - called - MarshalledValue - that wraps around the - serialized object. Here is a code snippet that illustrat= es how you - can create a wrapper around JBossCache to handle the cla= ssloader - issue: - - - import org.jboss.invocation.MarshalledValue; - - public class CacheService { - private TreeCache cache_; - - public object get(Fqn fqn, String key) { - return getUnMarshalledValue(cache_.get(fqn, key)); - } - - public object set(Fqn fqn, String key, Object value) { - cache_.put(fqn, key, getMarshalledValue(value)); - return value; // only if successful - } - - ... - - private Object getUnMarshalledValue(object value) { - // assuming we use the calling thread context classloader - return ((MarshalledValue)value).get(); - } - - private Object getMarshalledValue(Object value) { - return new MarshalledValue(value); - } - } - - - - - - - - Does JBoss Cache currently support pre-event and post= -event - notification? - - - - - Yes. Starting with release 1.2.4, JBoss Cache has int= roduced - ExtendedTreeCacheListener which takes in consideration p= re and post - event notification. See documentation for more details. = Note that - TreeCacheListener and ExtendedTreeCacheListener will be = merged into - TreeCacheListener in release 1.3. - - - - - - - How do I implement a custom listener to listen to - TreeCache - events? - - - - - You create a class (myListener) that extends - AbstractTreeCacheListener and provide concrete implement= ation for - the node events that you are interested in. Then you add= this - listener to the TreeCache instance on startup to listen = to the - events as they occur by calling - TreeCache.addTreeCacheListener(myListener). - - - - public class MyListener extends AbstractTreeCacheListener - { - ... - - public void nodeModify(Fqn fqn, boolean pre, boolean isLocal) { - if(log.isTraceEnabled()){ - if(pre) - log.trace("Event DataNode about to be modified: " + fqn); - else - log.trace("Event DataNode modified: " + fqn); - } - } - - ... - } - - - - - - - Can I use useRegionBasedMarshalling attribute in JBoss Cache in order to get - around ClassCastExceptions happening when accessing data= in the cache that has just been redeployed? - - - - - Yes, you can. Originally, TreeCache Marshalling was designed as a - workaround for those replicated caches that upon state t= ransfer did not have access to the - classloaders defining the objects in the cache. - - - On each deployment, JBoss creates a new classloader p= er the top level deployment artifact, for - example an EAR. You also have to bear in mind that a cla= ss in an application server is defined not - only by the class name but also its classloader. So, ass= uming that the cache is not deployed as part - of your deployment, you could deploy an application and = put instances of classes belonging to this - deployment inside the cache. If you did a redeployment a= nd try to do a get operation of the data - previously put, this would result on a ClassCastExceptio= n. This is because even though the class names - are the same, the class definitions are not. The current= classloader is different to the one when - the classes were originally put. - - - By enabling marshalling, you can control the lifecycl= e of the data in the cache and if on - undeployment, you inactivate the region and unregister t= he classloader that you'd have registered on - deployment, you'd evict the data in the cache locally. T= hat means that in the next deployment, the - data won't be in the cache, therefore avoiding the probl= em. Obviously, using marshalling to get - around this problem is only recommended when you have so= me kind of persistence backing where the data - survives, for example using CacheLoaders, or when JBossC= ache is used as a second level cache in a - persistence framework. = - - - To implement this feature, please follow the instruct= ions indicated in the example located - in the TreeCacheMarshaller section of the user's guide. = It's worth noting that instead of a - ServletContextListener, you could add= this code into an MBean - that contained lifecycle methods, such as start= () and stop(). - The key would be for this MBean to depend on the target = cache, so that it can operate as long as the - cache is up and running. - - - - - - - - JBoss Cache - Pojo Cache - - - - - - What is PojoCache? - - - - PojoCache (currently implemented PojoCache as a sub-c= lass of - TreeCache) is a fine-grained field-level replicated and - transactional POJO (plain old Java object) cache. By POJ= O, we mean - that the cache: 1) automatically manages object mapping = and - relationship for a client under both local and replicate= d cache - mode, 2) provides support for inheritance relationship b= etween - "aspectized" POJOs. By leveraging the dynamic AOP in JBo= ssAop, it is - able to map a complex object into the cache store, prese= rve 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 perfor= mance and - minimize network traffic. - - - 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, p= roviding - ease of use. For example, if a POJO has been put in Pojo= Cache (by - calling putObject, for example), then any get/set method= will be - intercepted by PojoCache to provide the data from the - cache. - - - - - - - What's the relationship between PojoCache and TreeCac= heAop classes? - - - - Since release 1.4, we have created a new class called= PojoCache (to better reflect the - cache nature). The old implementation TreeCacheAop has b= een deprecated. - - - - - - - Does PojoCache have all the functional capabilities of - TreeCache? - - - - - Yes. PojoCache extends TreeCache so it has all the sa= me - features TreeCache such as cache mode, transaction isola= tion level, - and eviction policy. - - - - - - - What is the difference between TreeCache and - PojoCache? - - - - - Think of PojoCache as a TreeCache on steroids. :-) - Seriously, both are cache stores-- one is a generic cach= e and the other other one POJO Cache. - However, while TreeCache only - provides pure object reference storage (e.g., - put(FQN fqn, - Object key, Object value) - - ), 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 t= o cache, you - can have PojoCache manage it for you. You simply treat y= our - object systems as they are residing in-memory, e.g., use= your - regular POJO methods without worrying about cache manage= ment. - Furthermore, this is true in replication mode as well. - - - - - - - What are the steps to use the PojoCache feature? - - - - 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: - - - - - prepare POJO. You can do either via xml declara= tion 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 i= t. - - - - instrumentation. You will need to instrument yo= ur POJO either at compile-time or load-time. - If you do it during compile-time, you use so-calle= d aop pre-compiler (aopc) to do bytecode - manipulation. - If you do it via load-time, however, you need eith= er a special system class loader or, in JDK50, - you can - use the javaagent option. - - - - 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 exa= mple, please refer to the distro examples - directory. - There are numerous PojoCache examples that uses differen= t options. - - - - - - - Can I run PojoCache in JBoss AS 3.2.x application - server? - - - - - Yes and no. Yes, since JBossAop can also be back-port= ed 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. - - - - - - - Can PojoCache run as a MBean as well? - - - - Yes. It is almost the same as TreeCache MBean. The on= ly - difference is the object name and the class name. E.g., = instead - of - <mbean code=3D"org.jboss.cache.TreeCa= che" - name=3D"jboss.cache:service=3DTreeCache"> - you will have: - <mbean code=3D"org.jboss.cache.aop.Po= joCache" - name=3D"jboss.cache:service=3DPojoCache"> - in the xml configuration file. - - - - - - - Can I pre-compile the aop classes such that I don't n= eed to - use the system classloader and jboss-aop configuration x= ml? - - - - - Yes. The latest versions of JBossCache have a pre-com= piler - option called - aopc - . You can use this option to - pre-compile your "aspectized" POJO. Once the classes hav= e been byte - code generated, they can be treated as regular class fil= es, i.e., - you will not need to include any - jboss-aop.xml - that specifies the advisable POJO and to specify the JBo= ssAop system - class loader. - - - For an example of how to use - aopc - , please - see 1) - tools - directory for PojoCacheTasks14.xml - and PojoCacheTasks50.xml. Both contain Ant tasks that yo= u can - import to your regular project for - annoc - and - aopc - . In addition, please also check out the - examples - directory for concrete examples. - - - - - - - How do I use aopc on multiple module directories? - - - - In aopc, you specify the src path for a specific dire= ctory. To - pre-compile multiple ones, you will need to invoke aopc = multiple - times. - - - - - - - What's in the - jboss-aop.xml - configuration? - - - - - - jboss-aop.xml - is needed for POJO - instrumentation. In - jboss-aop.xml - , you can - declare your POJO (e.g., - Person - ) to be - "prepared", a JBossAop term to denote that the object wi= ll be - "aspectized" by the system. After this declaration, JBos= sAop will - invoke any interceptor that associates with this POJO. P= ojoCache - will dynamically add an - org.jboss.cache.aop.CacheInterceptor - to this POJO - to perform object mapping and relationship management. - - - Note that to add your POJO, you should declare all th= e fields - to be "prepared" as in the example. - - - - - - - Can I use annotation instead of the xml declaration?<= /para> - - - - Yes, starting with JBossCache 1.3, you can use annota= tion to - instrument your POJO for both JDK1.4 and 1.5. Check the = documentation for details. - - - - - - - What are the pro and con of xml vs. annotation? - - - - 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. - - - - - - - What are the - @org.jboss.cache.aop.annotation.Transient - and - @org.jboss.cache.aop.annotation.Serializable - field level annotations? - - - - - Starting in 1.4, we also offer two additional field-l= evel annotations. The first one, - @Transient - , - when applied has the same effect as declaring a field - transient - . PojoCache - won't put this field under management. - - The second one, - @Serializable - when applied, will cause PojoCache to - treat the field as a Serializable object even when it is - @PojoCacheable - . - - - - - - - What about compile-time vs. load-time instrumentation= then? - - - - 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. - - - - - - - Is it possible to store the same object multiple time= s but - with different Fqn paths? Like /foo/byName and /foo/byId= ? - - - - - 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. - - - - - - - Do I need to declare all my objects "prepared" in - jboss-aop.xml - ? - - - - - 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 dec= laration. - The cache will treat this object as a "primitive" type. = However, the - object will need to implement - Serializable - interface for replication. - - - - - - - Can the cache aop intercept update via reflection? - - - - No. The update via reflection will not be intercepted= in - JBossAop and therefore PojoCache will not be able to per= form the - necessary synchronization. - - - - - - - When I declare my POJO to be "aspectized", what happe= ns to the - fields with transient, static, and final modifiers? - - - - - PojoCache currently will ignore the fields with these - modifiers. That is, it won't put these fields into the c= ache (and - thus no replication either). - - - - - - - What are those keys such as - JBoss:internal:class - and - AOPInstance - ? - - - - - They are for internal use only. Users should ignore t= hese keys - and values in the node hashmap. - - - - - - - What about Collection classes? Do I need to declare t= hem - "prepared"? - - - - - No. Since the Collection classes such as - ArrayList - 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 t= he - putObject - call is invoked). The proxy will - delegate the operations to a cache interceptor that impl= ements the - actual Collection classes APIs. That is, the system clas= ses won't be - invoked when used in PojoCache. - - - 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 certa= in APIs. For - example, both - ArrayList - and - LinkedList - will have the same implementation. - Plan is currently underway to optimize these APIs. - - - - - - - How do I use - List - , - Set - , - and - Map - dynamic proxy? - - - - - PojoCache supports classes extending from - List - , - Set - , and - Map - without users to declare them "aspectized". - It is done via a dynamic proxy. Here is a code snippet t= o use an - ArrayList - proxy class. - - - ArrayList list =3D 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 POJ= O. - - ArrayList myList =3D (List)cache.getObject("/list/test"); = - // we are getting a dynamic proxy instead - myList.add("second"); = - // it works now - myList.add("third"); - myList.remove("third"); - - - - - - - What is the proper way of assigning two different key= s with - Collection class object? - - - - - Let's say you want to assign a - List - object - under two different names, you will need to use the clas= s proxy to - insert the second time to ensure both are managed by the= cache. Here - is the code snippet. - - - ArrayList list =3D new ArrayList(); - list.add("first"); - - cache.putObject("/list", list); = - // Put the list under the aop cache - - ArrayList myList =3D (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"); - - - - - - - OK, so I know I am supposed to use proxy when manipul= ating the - Collection classes once they are managed by the cache. B= ut what - happens to Pojos that share the Collection objects, e.g.= , a - List - instance that is shared by 2 Pojos? - - - - - Pojos that share Collection instance references will = be - handled by the cache automatically. That is, when you as= k the Cache - to manage it, the Cache will dynamically swap out the re= gular - Collection references with the dynamic proxy ones. As a = result, it - is transparent to the users. - - - - - - - What happens when my "aspectized" POJO has field memb= ers that - are of Collection class ? - - - - - When a user puts a POJO into the cache through the ca= ll - putObject - , it will recursively map the field - members into the cache store as well. When the field mem= ber is of a - Collection class (e.g., List, Set, or Map), PojoCache wi= ll first - map the collection into cache. Then, it will swap out dy= namically - the field reference with an corresponding proxy referenc= e. - - - This is necessary so that an internal update on the f= ield - member will be intercepted by the cache. - - - - - - - - What are the limitation of Collection classes in Pojo= Cache? - - - - Use of Collection class in PojoCache helps you to tra= ck fine-grained changes - in your collection fields automatically. However, curren= t implementation has the follow - limitation that we plan to address soon. - - Currently, we only support a limited implementation o= f Collection classes. That is, - we support APIs in List, Set, and Map. However, since th= e 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 o= ther implementation would not. - The Set interface maps to java.util.HashSet implementati= on. The List interface maps - to java.util.ArrayList implementation. The Map interface= maps to java.util.HashMap - implementation. - - Another related issue is the expected performance. Fo= r example, the current implementation is - ordered, - so - that makes insert/delete from the Collection slow. Perfo= rmance between Set, Map and List collections - also - vary. - Adding items to a Set is slower than a List or Map, sinc= e Set does not allow duplicate entries. - - - - - - - - What are the pros and cons of PojoCache? - - - - As mentioned in the reference doc, PojoCache has the = following advantages: - - - Fine-grained replication and/or persistency. If= you use a distributed PojoCache - and once your POJO is put in the cache store, ther= e 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. - - - - Fine-grained replication can have potential per= formance gain if your POJO is big and - the changes are fine-grained, e.g., only to some s= elected fields. - - - - POJO can posses object relationship, e.g., mult= iple referenced. Distributed - PojoCache will handle this transparently for you. - - - - And here are some cases that you may not want to use = PojoCache: - - - You use only cache. That is you don't need repl= ication or persistency. Then since - everything is operated on the in-memory POJO refer= ence, there is no need for PojoCache. - - - - You have simple and small POJOs. Your POJO is s= mall in size and also there is no - object relationship, then PojoCache possess not cl= ear advantage to plain cache. - - - - Your application is bounded by memory usage. Be= cause PojoCache need almost twice as much - of memory (the original POJO in-memory space and a= lso the additional cache store for the - primitive fields), you may not want to use PojoCac= he. - - - - 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. - - - - - - - - - Eviction Policies - - - - - - - Does JBoss Cache support eviction policies? - - - - Yes. JBoss Cache currently implements a LRU eviction = policy for - both TreeCache - ( - org.jboss.cache.eviction.LRUPolicy - ) and - PojoCache - ( - org.jboss.cache.aop.eviction.AopLRUPolicy - ). Users - can also plug in their own eviction policy algorithms. S= ee user - manual for details. Currently there is user-contributed = policy - called - FIFOPolicy - that evicts the node based on - FIFO principle only. - - - - - - - Why can't I use - org.jboss.cache.eviction.LRUPolicy - for - PojoCache as well? - - - - - For PojoCache, you will need to use - org.jboss.cache.aop.eviction.AopLRUPolicy - ) because - AOP has its eviction algorithm, although is LRU but has = totally - different notion of an "object", for example. - - - - - - - Does JBoss Cache's implemented LRU eviction policy op= erates in - replication mode? - - - - - Yes and no. :-) - - The LRU 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 obtai= n the cached - contents of an evicted node and finds out that is null (= e.g., - get - returns null), it should get it from the - other data source and re-populate the data in the cache.= During this - moment, the node content will be propagated and the cach= e content - will be in sync. - - - However, you still can run eviction policies with cac= he mode - set to either - REPL_SYNC - or - REPL_ASYNC - . Depending on your use case, you can - set multiple cache instances to have their own eviction = policy - (which are applied locally) or just have selected instan= ces with - eviction policies activated. - - - Also note that, with cache loader option, a locally e= victed - node can also be persisted to the backend store and a us= er can - retrieve it from the store later on. - - - - - - - Does JBoss Cache support - Region - ? - - - - - Yes. JBoss Cache has the notion of region where a use= r can - configure the eviction policy parameters (e.g., - maxNodes - or - timeToIdleSeconds - ) - - - A region in JBoss Cache denotes a portion of tree hie= rarchy, - e.g., a fully qualified name ( - FQN - ). For example, - a user can define - /org/jboss - and - /org/foocom - as two separate regions. But note - that you can configure the region programmatically now, = i.e., - everything has to be configured through the xml file. - - - - - - - What are the - EvictionPolicyConfig - tag - parameters for - org.jboss.cache.eviction.LRUPolicy - ? - - - - - They are: - - - - Parameters - - - - - wakeUpIntervalInSeconds - - Interval where the clean up thread wakes= to process - the sitting queue and sweep away the old dat= a. - - - - - region - - A area where each eviction policy parame= ters are - specified. Note that it needs a minimum of - /_default - region. - - - - - maxNodes - - Max number of nodes allowed in the evict= ion queue. 0 - means no limit. - - - - - timeToLiveInSeconds - - Age (in seconds) for the node to be evic= ted in the - queue. 0 denotes no limit. - - - - -
-
-
- - - - I have turned on the eviction policy, why do I still = get "out - of memory" (OOM) exception? - - - - - OOM can happen when the speed of cache access exceeds= the - speed of eviction policy handling timer. Eviction policy= handler - will wake up every - wakeUpIntervalInSeconds - seconds to process the eviction event queue. And the que= ue size is - fixed at 20000 now. So when the queue size is full, it w= ill create a - backlog and cause OOM to happen unless the eviction time= r catches - up. To address this problem, in addition to increase the= VM heap - size, you can also reduce the - wakeUpIntervaleInSeconds - so the timer thread - processes the queue more frequently. - - - We will also externalize the queue size so it will be - configurable in the next release. - - - -
-
- - Cache Loaders - - - - - - - What is a CacheLoader? - - - - A CacheLoader is the connection of JBossCache to a - (persistent) data store. The CacheLoader is called by JB= ossCache to - fetch data from a store when that data is not in the cac= he, and when - modifications are made to data in the cache the CacheLoa= der is - called to store those modifications back to the store. - - - In conjunction with eviction policies, JBossCache wit= h a - CacheLoader allows a user to maintain a bounded cache fo= r a large - backend datastore. Frequently used data is fetched from = the - datastore into the cache, and the least used data is evi= cted, in - order to provide fast access to frequently accessed data= . This is - all configured through XML, and the programmer doesn't h= ave to take - care of loading and eviction. - - - JBossCache currently ships with several CacheLoader - implementations, including: - - - - - - FileCacheLoader: this implementation uses th= e file - system to store and retrieve data. JBossCache n= odes are mapped - to directories, subnodes to subdirectories etc.= Attributes of - a node are mapped to a file - data - inside the - directory. - - - - - BdbjeCacheLoader: this implementation is bas= ed on the - Sleepycat Java Edition database, a fast and eff= icient - transactional database. It uses a single file f= or the entire - store. Note that if you use Sleepycat's CacheLo= ader with - JBoss Cache and wish to ship your product, you = will have to acquire a - commercial license from Sleepycat - - . - - - - - JDBCCacheLoader: this implementation uses th= e relational database as the persistent - storage. - - - - - ClusteredCacheLoader: this implementation qu= eries the rest of the cluster, treating other - servers' in-memory state as a data store. - - - - - And more. See the documentation for more det= ails. - - - - - - - - - Can writing to CacheLoaders be asynchronous? - - - - As of JBossCache 1.2.4, yes. Set the CacheLoaderAsync= hronous - property to true. See the JBossCache documentation for a= more - detailed discussion. By default though, all cache loader= writes are - synchronous and will block. - - - - - - - Can I write my own CacheLoader ? - - - - Yes. A CacheLoader is a class implementing - org.jboss.cache.loader.CacheLoader - . It is - configured via the XML file (see JBossCache and Tutorial - documentation). - - - - - - - Does a CacheLoader have to use a persistent store ? - - - - No, a CacheLoader could for example fetch (and possib= ly store) - its data from a webdav-capable webserver. Another exampl= e is a - caching proxy server, which fetches contents from the we= b. Note that - an implementation of CacheLoader may not implement the '= store' - functionality in this case, but just the 'load' - functionality. - - - - - - - What can I use a CacheLoader for? - - - - Some applications: - - - - - HTTP sessions can be persisted (besides bein= g replicated - by JBossCache). The CacheLoader can be configur= ed to be - shared, or unshared, meaning that every node in= a cluster has - its own local store. It is also possible to att= ach a - CacheLoader to just - one - of the - nodes. - - - - - Simple persistence for POJOs. Use of JBossCa= che aop and - a local CacheLoader persist POJOs transparently= into the store - provided by the CacheLoader. - - - - - Highly available replicated and persisted da= ta store. - The service is up as long as at least 1 node is= running, but - even if all nodes are taken offline, when the f= irst node is - started again, the data previously saved will s= till be - available (e.g. a shopping cart). - - - - - A caching web proxy (a la Squid): all data a= re contents - of URLs, users access the proxy, and if the URL= is not in the - cache, the CacheLoader fetches it from the web.= This could - actually be a replicated and transactional vers= ion of - Squid. - - - - - - - - - - How do I configure JBossCache with a CacheLoader? - - - - Through XML: both the fully-qualified classname of the - CacheLoader and its configuration string have to be give= n. - JBossCache will then instantiate a CacheLoader. See JBos= sCache - documentation for details. - - - - - - - Do I have to pay to use Sleepycat's CacheLoader? - - - - Not if you use it only for personal use. As soon as y= ou - distribute your product with BdbjeCacheLoader, you have = to purchase - a commercial license from Sleepycat. See details at - http://www.sleepycat.com/jeforjbosscache - - . - - - - - - - Can I use more than one cache loader? - - - - As of JBossCache 1.3.0, yes. With the new CacheLoader= Configuration XML - element (see user manual section on cache loaders) you c= an now - describe several cache loaders. The impact is that the c= ache will - look at all of the cache loaders in the order they've be= en - configured, until it finds a valid, non-null element of = data. When - performing writes, all cache loaders are written to (exc= ept if the - ignoreModifications element has been set to true for a s= pecific - cache loader. - - - - - - - Why do cache loaders go into an inconsistent state wh= en I use transactions, pessimistic locking, - and I - attempt to read a node after removing it from within the= same transaction scope? - - - - - This is a known bug (see - JBCACHE-477 - and - JBCACHE-352 - ), which have been fixed in JBoss Cache 1.4.0. A very si= mple workaround if you're using JBoss Cache - 1.3.x - is to use optimistic locking. - - - One of the consequences of this bug is that, for example= , if you use PojoCache with pojos that have - private references to a List and you update and remove s= omeelements of that List within a transaction - (when using pessimistic locking and a cache loader), you= may see IllegalStateExceptions thrown. - - - - - - - - - Troubleshooting - - - - - I am having problems getting JBoss Cache to work, whe= re can I get information on troubleshooting? - - - - Troubleshooting section can be found in the following - wiki link - . - - - - - - - -
Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Fre= quently_Asked_Questions_CP07.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP07.ent (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP07.ent 2009-11-19 04:06:04 UTC (rev 8293) @@ -0,0 +1,3 @@ + + + Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Fre= quently_Asked_Questions_CP07.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP07.xml (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/JBoss_Cache_Freque= ntly_Asked_Questions_CP07.xml 2009-11-19 04:06:04 UTC (rev 8293) @@ -0,0 +1,2252 @@ + + + + + + + + General Information + + + + What is JBoss Cache? + + + + JBoss Cache is a replicated and transactional cache. = It is + replicated since multiple JBoss Cache instances can be d= istributed + (either within the same JVM or across several JVMs wheth= er they reside on + the same machine or on different machines on a network) = and data is + replicated across the whole group. It is transactional b= ecause a + user can configure a JTA compliant transaction manager a= nd make the cache + operation transactional. Note that the cache can also be= run without + any replication; this is the local mode. + + + Currently, JBoss Cache consists of two components: a = generic cache + (implemented internally as + org.jboss.cache.TreeCache + ) and a POJO cache (implemented + internally as + org.jboss.cache.aop.PojoCache + ). + TreeCache + is a tree-structured cache that provides replication and + transaction context, while + PojoCache + extends the functionality of + TreeCache + but behaves as a true object cache providing transparent + and finer-grained object mapping into internal cache. + + + + + + + Who are the JBoss Cache developers? + + + + JBossCache has been developed by Bela Ban, Ben Wang, = Harald + Gliebe, Manik Surtani and Brian Stansberry. Manik is the= lead on JBoss Cache and Ben is the lead on + PojoCache. + + + + + + + What is the license for JBoss Cache? + + + + JBoss Cache is licensed under + LGP= L + . + + + + + + + Where can I download JBoss Cache? + + + + The JBoss Cache + product download page + has prebuilt binaries as well as source distributions. Y= ou can also grab snapshots from the JBoss CVS + repository (see + this wiki page + ) - the module name is + JBossCache + + + + + + + How do I build JBoss Cache from CVS sources? + + + + To build, do + sh build.sh + jar + + . This will produce + jboss-cache.jar + in the + dist/lib + directory. Or if you want to + build the standalone package, do + sh build.sh dist + this will produce + dist/jboss-cache-dist.zip + 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. + + + + + + + Which JVMs are supported by JBoss Cache? + + + + JBoss Cache has been tested and supported on J2SE 1.4= .x and JDK 5.0. + On jboss-3.2 CVS tree, it also compiles on JDK1.3, but t= here is no + official support for this version and using this is not = recommended. + + + + + + + From JBoss Cache 1.3.0 onwards, there is a new direct= ory + lib-50 + , + what is it? + + + + + From JBoss Cache 1.3.0 onwards, we support the use of= Java 5 annotations, used by PojoCache. + As a result, there are + jboss-aop-jdk50.jar + and + jboss-cache-jdk50.jar + that + are needed to work with the Java 5 annotations. You will= need to replace + jboss-aop.jar + and + jboss-cache.jar + in the lib directory with the + -jdk50 + versions if you intend + to use PojoCache, Java 5 and annotations. + + + + + + + How do I know the version of JBoss Cache that I am us= ing? + + + + Since release 1.2, you can check the jar version by r= unning: + java -jar jboss-cache.jar org.jboss.cache.Version<= /code> + . + + + + + + + Can I run JBoss Cache outside of JBoss Application + Server? + + + + + Of course! JBoss Cache comes in two flavors: + + + + Integrated with JBoss Application Server as an = MBean service. + + + + Standalone, that can run in any Java EE server = such + as BEA WebLogic or IBM Websphere. Of course, it ca= n also run in + a standalone Java process (i.e., outside Java EE c= ontext). + + + + + + + + + Where can I report bugs or problems? + + + + Please report any bugs or problems to + JBoss Cache + User Forum + + . + + + + + + + JBoss Cache - Tree Cache + + + + How do I deploy JBoss Cache as a MBean service? + + + + To deploy JBoss Cache as an MBean inside JBoss, you c= an copy the + configuration xml file over to the + deploy + directory (from + all + configuration whereby the + necessary jars are present). Under the standalone package + etc/META-INF + directory , there are example + configuration files for different cache modes that can b= e used to + deploy JBoss Cache as well. + + + + + + + How do I know if my JBoss Cache MBean has been deploy= ed? + + + + To verify that your JBoss Cache MBean is deployed cor= rectly, + you can first check the log output under the command con= sole. Next + you can verify it from JBoss JMX console. Look for + jboss.cache + domain. + + + + + + + How do I access the JBoss Cache MBean? + + + + Accessing the JBoss Cache MBean is just like accessin= g any + JBoss MBean. Here is a code snippet: + + + + import org.jboss.mx.util.MBeanServerLocator; + import org.jboss.mx.util.MBeanProxyExt; + import org.jboss.cache.TreeCacheMBean; + import javax.management.MBeanServer; + ... + = + MBeanServer server; + TreeCacheMBean cache; + = + public init() throws Exception + { + try + { + server =3D MBeanServerLocator.locateJBoss(); + cache =3D (TreeCacheMBean) MBeanProxyExt.create(TreeCacheMBean.class, + "jboss.cache:service=3DTreeCache", + server); + } + catch (Exception ex) + { + // handle exception + } + } + = + public void myBusinessMethod() + { + Object value =3D cache.get("/my/node", "myKey"); + = + HashMap stuff =3D new HashMap(); + stuff.put("key1", "value1"); + stuff.put("key2", "value2"); + stuff.put("key3", "value3"); + = + cache.put("/my/new/node", stuff); + = + cache.remove("/my/node"); + = + ... + } + = + + + + + + + Can I run JBoss Cache on JBoss AS 3.2.x releases? + + + + Yes. The JBoss Cache source code is also up to date o= n the + jboss-3.2 CVS branch. However, only TreeCache is support= ed there + since JBossAop (which PojoCache relies on) is only avail= able in JBoss AS 4.x onwards. + + + + + + + Can I run multiple JBoss Cache instances on the same = VM? + + + + Yes. There are some scenarios where you may want to r= un + multiple instances of JBoss Cache. For example, you want= to run + multiple local cache instances with each instance having= its own + configuration (e.g., different cache policy). In this ca= se, you will + need multiple xml configuration files. + + + + + + + Can TreeCache run as a second level cache inside + Hibernate? + + + + + Yes. Since Hibernate 3.0 release, you can configure i= t to use + JBoss Cache (namely, TreeCache) as a second level cache.= For details, + see Hibernate documentation, and also see + + http://wiki.jboss.org/wiki/Wiki.jsp?page=3DJBossCache= Hibernate + + + + Note that since Hibernate 3.0.2 and JBossCache 1.2.2,= we have + fixed a critical bug that depending on the usage pattern= can cause + deadlock during query caching. + + + + + + + What about using PojoCache as a Hibernate cache? + + + + It is not necessary to use PojoCache for second level + cache inside Hibernate because Hibernate + manages fine-grained fields in Java objects. So using Po= joCache won't + provide any advantage. + + + + + + + How can I configure JBoss Cache? + + + + You can configure the JBoss Cache through a configura= tion xml + file. Or you can set it programmatically through its get= /set methods. + Check with the documentation for both examples. + + + + + + + In the configuration xml file, there are tags such as + class + , + MBean + , etc. What are + these? + + + + + These are tags for deploying JBoss Cache as a JBoss M= Bean + service. For consistency, we have kept them in the + standalone package as well, specifically, the + MBean + tag. If you run in standalone mode, + JBoss Cache will ignore these elements. + + + + + + + What is the difference between the different cache + modes? + + + + + JBossCache has five different cache modes, i.e., + LOCAL + , + REPL_SYNC + , + REPL_ASYNC + , + INVALIDATION_SYNC + and + INVALIDATION_ASYNC + . If you want to run JBoss Cache as a + single instance, then you should set the cache mode to + LOCAL + so that it won't attempt to replicate anything. + If you want to have synchronous replication among differ= ent + JBoss Cache instances, you set it to + REPL_SYNC + . + For asynchronous replication, use + AYSNC_REPL + . If you do not wish to replicate cached data but simply= inform other caches in a cluster that data + under + specific addresses are now stale and should be evicted f= rom memory, use + INVALIDATION_SYNC + or + INVALIDTAION_ASYNC + . Synchronous and asynchronous behavior applies to inval= idation as well as replication. + + + Note that + ASYNC_REPL + and + INVALIDATION_ASYNC + are non-blocking. This + can be useful when you want to have another JBoss Cache = serving as a + mirror or backup and you don't want to wait for confirma= tion that this mirror has received your + messages. + + + + + + + How does JBoss Cache's replication mechanism work? + + + + JBoss Cache leverages + JGroups + as a replication layer. A user + can configure the cluster of JBoss Cache instances by sh= aring the + same cluster name ( + cluster name + ). There is also + an option of whether to populate the cache data upon sta= rting a new + instance in the + ClusterConfig + attribute. + + + Note that once all instances join the same replicatio= n group, + every replication change is propagated to all participat= ing members. + There is no mechanism for sub-partitioning where some re= plication + can be done within only a subset of members. This is on = our to do + list. + + + + + + + I run a 2 node cluster. If the network dies, do the c= aches continue to run? + + + + Yes, both will continue to run, but depending on your= replication mode, all transactions or + operations may not complete. If + REPL_SYNC + is used, operations will fail while if + REPL_ASYNC + is used they will succeed. Even if they succeed though, = caches will be out of sync. + + + + + + + + Can I plug in library X instead of JGroups to handle = remote calls and group communications? + + + + At this stage (JBoss Cache 1.x) the answer is no. We = do have an abstraction layer between the + communication suite and JBoss Cache in the pipelines, an= d this may appear as a feature at some stage + in + the future. + + + + + + + Does the cache need to replicate to every other insta= nce in the cluster? Isn't this slow if the + cluster is large? + + + + + As of JBoss Cache 1.4.0, replication need not occur t= o every node in the cluster. This feature - + called Buddy Replication - + allows each node to pick one or more 'buddies' in the cl= uster and only replicate to its buddies. This + allows a cluster to scale + very easily with no extra impact on memory or network tr= affic with each node added. + + + See the User Guide for more information on Buddy Replica= tion, and how it can be used to achieve very + high + scalability. + + + + + + + If I have the need for different TreeCache properties= (e.g., + CacheMode + and + IsolationLevel + ), do I simply need to create multiple + TreeCache instances with the appropriate configuration? + + + + + Yes. All the above mentioned properties are per cache + instance. Therefore you will need a separate JBoss Cache + instance. + + + + + + + Does the Tree Cache config + ClusterName + have + any relation to the JBoss AS cluster + PartitionName + ? + + + + + Yes. They are both JGroups group names. Besides the n= otion of + a channel in JGroups, it also can partition the channel = into different + group names. + + + + + + + When using multiple JGroups based components + [cluster-service.xml, treecache (multiple instances)], w= hat is the + correct/valid way to configure those components to make = sure my + multicast addresses don't conflict? + + + + + There are two parameters to consider: multicast addre= ss (plus + port) and the group name. At minimum, you will have to r= un + components using a different group name. But whether to = run them on + the same channel depends upon whether the communication = performance + is critical for you or not. If it is, then it'd be best = to run them + on different channels. + + + + + + + Does JBoss Cache currently support cache persistence + storage? + + + + + Yes. Starting with release 1.1, JBoss Cache has a Cac= heLoader + interface that supports cache persistence. See below. + + + + + + + Does JBoss Cache currently support cache passivation/= overflow + to a data store? + + + + + Yes. Starting with release 1.2.4, JBoss Cache uses the + CacheLoader to support cache passivation/ overflow. See + documentation on how to configure and use this feature. + + + + + + + Is JBoss Cache thread safe? + + + + Yes, it is thread safe. + + + + + + Does JBoss Cache support XA (2PC) transactions now? + + + + No, although it is also on our to do list. Our intern= al + implementation does use a similar 2PC procedure to coord= inate a + transaction among different instances. + + + + + + + Which TransactionManagers are supported by + JBoss Cache? + + + + + JBoss Cache supports any TransactionManager that is J= TA + compliant such as JBossTM. A user can configure the tran= saction + manager through the configuration xml setting. JBossCach= e also has a + built in dummy transaction manager + ( + org.jboss.cache.tm.DummyTransactionManager + ) for + testing purposes only. But note that + DummyTransactionManager + is not thread safe .i.e., + it does not support concurrent transactions. Instead, on= ly one + transaction is allowed at a time. + + + + + + + How do I set up the cache to be transactional? + + + + You either use the default (JBoss) TransactionManager= to run + JBossCache inside JBoss, or you have to implement the + TransactionManagerLookup + interface, and return an + instance of your javax.transaction.TransactionManager. T= he + configuration property + TransactionManagerLookupClass + defines the class + to be used by the cache to fetch a reference to a + TransactionManager. It is trivial to implement this clas= s to support + other TransactionManagers. Once this attribute is specif= ied, the + cache will look up the transaction context from this tra= nsaction + manager. + + + For the client code, here is a snippet to start and c= ommit a + transaction: + + + tx =3D (UserTransaction)new InitialContext(prop).lookup(= "UserTransaction"); + tree =3D new TreeCache(); + config =3D new PropertyConfigurator(); + config.configure(tree, "META-INF/replSync-service.xml"); + + tx.begin() + tree.put(fqn, key, value); + tx.commit(); + + + + + + + How do I control the cache locking level? + + + + JBossCache lets you control the cache locking level t= hrough + the transaction isolation level. This is configured thro= ugh the + attribute + IsolationLevel + . Currently, JBossCache + employs pessimistic locking internally. And the transact= ion + isolation level from the pessimist locking corresponds t= o JDBC + isolation levels, namely, + NONE + , + READ_UNCOMMITTED + , + READ_COMMITTED + , + REPEATABLE_READ + , and + SERIALIZABLE + . Note that these isolation levels are ignored if optimi= stic locking is used. For details, please + refer + to the + user manual. + + + + + + + How does JBoss Cache lock data for concurrent access?= + + + + By default JBoss Cache uses pessimistic locking to lo= ck data nodes, based on the isolation level + configured. Since JBoss Cache 1.3.0, we also offer optim= istic locking to allow for greater concurrency + at + the cost of slight processing overhead and performance. = See the documentation for a more detailed + discussion on concurrency and locking in JBoss Cache. + + + + + + + + How do I enable Optimistic Locking in JBoss Cache? + + + + Use the XMl attribute + NodeLockingScheme + . Note that + IsolationLevel + is ignored if + NodeLockingScheme + is set to + OPTIMISTIC + . Also note that + NodeLockingScheme + defaults to + PESSIMISTIC + if omitted. + + + + + + + + How does the write lock apply to an Fqn node, say, + "/org/jboss/test"? + + + + + First of all, JBossCache has a notion of + root + that serves as a starting point for every navigational o= peration. + The default is "/" (since the default separator is "/" f= or the fqn). + The locking then is applied to the node under root, for = example + "/org" (no locking "/"). + + + Furthermore, let's say when JBossCache needs to apply= a write + lock on node "/org/jboss/test", it will first try to obt= ain read + lock from the parent nodes recursively (in this example,= "/org", and + "/org/jboss"). Only when it succeeds then it will try to= obtain a + write lock on "/org/jboss/test". + + + + + + + Can I use the cache locking level even without a tran= saction + context? + + + + + Yes. JBossCache controls the individual node locking = behavior + through the isolation level semantics. This means even i= f you don't + use a transaction, you can specify the lock level via is= olation + level. You can think of the node locking behavior outsid= e of a + transaction as if it is under transaction with + auto_commit + on. + + + + + + + With replication (REPL_SYNC/REPL_ASYNC) or invalidati= on (INVALIDATION_SYNC/INVALIDATION_ASYNC), how + often does the cache broadcast messages over the network? + + + + + If the updates are under transaction, then the broadc= asts + happen only when the transaction is about to commit (act= ually + during the prepare stage internally). That is, it will b= e a batch + update. However, if the operations are not under transac= tion + context, then each update will trigger replication. Note= that this + has performance implication if network transport is heav= y (it + usually is). + + + + + + + How can I do a mass removal? + + + + If you do a cache.remove("/root"), it will recursivel= y remove + all the entries under "/root". + + + + + + + Can I monitor and manage the JBoss Cache? + + + + With JBoss Cache 1.3.0, you can if you are running JB= oss Cache within JBoss AS or are using JDK + 5.0's + jconsole + utility. See the chapter titled + Management Information + in the JBoss Cache user guide for more details. + + + + + + + Can I disable JBoss Cache management attributes in JB= oss Cache 1.3.0? + + + + Yes, you can. Set the + UseInterceptorMbeans + configuration attribute to + false + (this defaults to + true + ). See the chapter titled + Management Information + in the JBoss Cache user guide for more details. + + + + + + + What is jboss-serialization.jar, introduced in JBoss = Cache 1.4.x and do I need this? + + + jboss-serialization.jar is the + + JBoss Serialization + + library, which is much more efficient in terms + of speed and CPU usage as well as the generated byte str= eam size than standard Java serialization. + This + very + significantly improves replication performance of custom= objects placed in the cache. + + + From 1.4.x, JBoss Cache relies on this library and it is= needed to run JBoss Cache. + + + + + + + Can I disable JBoss Serialization and revert back to = standard Java serialization? + + + + Yes you can, by passing in the + -Dserialization.jboss=3Dfalse + environment variable to your JVM. + + + + + + + + Does JBoss Cache support partitioning? + + + + Not right now. JBoss Cache does not support partition= ing that a + user can configure to have different set of data residin= g on + different cache instances while still participating as a= replication + group. + + + + + + + Does JBoss Cache handle the concept of application cl= assloading + inside, say, a J2EE container? + + + + + Application-specific classloading is used widely insi= de a J2EE + container. For example, a web application may require a = new + classloader to scope a specific version of the user libr= ary. + However, by default JBoss Cache is agnostic to the class= loader. In + general, this leads to two kinds of problems: + + + + + Object instance is stored in cache1 and replica= ted to + cache2. As a result, the instance in cache2 is cre= ated by the + system classloader. The replication may fail if th= e system + classloader on cache2 does not have access to the = required + class. Even if replication doesn't fail, a user th= read in cache2 + may not be able to access the object if the user t= hread is + expecting a type defined by the application classl= oader. + + + + + Object instance is created by thread 1 and will= be + accessed by thread 2 (with two different classload= ers). + JBossCache has no notion of the different classloa= ders involved. + As a result, you will have a + ClassCastException + . This is a standard + problem in passing an object from one application = space to + another; JBossCache just adds a level of indirecti= on in passing + the object. + + + + + To solve the first kind of issue, in JBoss Cache 1.2.= 4 we + introduced the concept of a + TreeCacheMarshaller + . + Basically, this allows application code to register a cl= assloader + with a portion of the cache tree for use in handling obj= ects + replicated to that portion. See the TreeCacheMarshaller = section of + the user guide for more details. + + + To solve the second kind of issue, the only solution = (that we + know of) is to cache "serialized" byte code and only de-= serialize it + during every object get (and this will be expensive!). T= hat is, + during a put operation, the object instance will be seri= alized and + therefore can be deserialized safely by a "foreign" clas= sloader. + However, the performance penalty of this approach is qui= te severe so + in general another local in-vm version will need to be u= sed as a + "near-line" cache. Note also that each time the serializ= ed bytes are + deserialized, a new instance of the object is created. + + + To help with this kind of handling, JBoss has a utili= ty class + called + MarshalledValue + that wraps around the + serialized object. Here is a code snippet that illustrat= es how you + can create a wrapper around JBossCache to handle the cla= ssloader + issue: + + + import org.jboss.invocation.MarshalledValue; + + public class CacheService { + private TreeCache cache_; + + public object get(Fqn fqn, String key) { + return getUnMarshalledValue(cache_.get(fqn, key)); + } + + public object set(Fqn fqn, String key, Object value) { + cache_.put(fqn, key, getMarshalledValue(value)); + return value; // only if successful + } + + ... + + private Object getUnMarshalledValue(object value) { + // assuming we use the calling thread context classloader + return ((MarshalledValue)value).get(); + } + + private Object getMarshalledValue(Object value) { + return new MarshalledValue(value); + } + } + + + + + + + + Does JBoss Cache currently support pre-event and post= -event + notification? + + + + + Yes. Starting with release 1.2.4, JBoss Cache has int= roduced + ExtendedTreeCacheListener which takes in consideration p= re and post + event notification. See documentation for more details. = Note that + TreeCacheListener and ExtendedTreeCacheListener will be = merged into + TreeCacheListener in release 1.3. + + + + + + + How do I implement a custom listener to listen to + TreeCache + events? + + + + + You create a class (myListener) that extends + AbstractTreeCacheListener and provide concrete implement= ation for + the node events that you are interested in. Then you add= this + listener to the TreeCache instance on startup to listen = to the + events as they occur by calling + TreeCache.addTreeCacheListener(myListener). + + + + public class MyListener extends AbstractTreeCacheListener + { + ... + + public void nodeModify(Fqn fqn, boolean pre, boolean isLocal) { + if(log.isTraceEnabled()){ + if(pre) + log.trace("Event DataNode about to be modified: " + fqn); + else + log.trace("Event DataNode modified: " + fqn); + } + } + + ... + } + + + + + + + Can I use useRegionBasedMarshalling attribute in JBoss Cache in order to get + around ClassCastExceptions happening when accessing data= in the cache that has just been redeployed? + + + + + Yes, you can. Originally, TreeCache Marshalling was designed as a + workaround for those replicated caches that upon state t= ransfer did not have access to the + classloaders defining the objects in the cache. + + + On each deployment, JBoss creates a new classloader p= er the top level deployment artifact, for + example an EAR. You also have to bear in mind that a cla= ss in an application server is defined not + only by the class name but also its classloader. So, ass= uming that the cache is not deployed as part + of your deployment, you could deploy an application and = put instances of classes belonging to this + deployment inside the cache. If you did a redeployment a= nd try to do a get operation of the data + previously put, this would result on a ClassCastExceptio= n. This is because even though the class names + are the same, the class definitions are not. The current= classloader is different to the one when + the classes were originally put. + + + By enabling marshalling, you can control the lifecycl= e of the data in the cache and if on + undeployment, you inactivate the region and unregister t= he classloader that you'd have registered on + deployment, you'd evict the data in the cache locally. T= hat means that in the next deployment, the + data won't be in the cache, therefore avoiding the probl= em. Obviously, using marshalling to get + around this problem is only recommended when you have so= me kind of persistence backing where the data + survives, for example using CacheLoaders, or when JBossC= ache is used as a second level cache in a + persistence framework. = + + + To implement this feature, please follow the instruct= ions indicated in the example located + in the TreeCacheMarshaller section of the user's guide. = It's worth noting that instead of a + ServletContextListener, you could add= this code into an MBean + that contained lifecycle methods, such as start= () and stop(). + The key would be for this MBean to depend on the target = cache, so that it can operate as long as the + cache is up and running. + + + + + + + + JBoss Cache - Pojo Cache + + + + + + What is PojoCache? + + + + PojoCache (currently implemented PojoCache as a sub-c= lass of + TreeCache) is a fine-grained field-level replicated and + transactional POJO (plain old Java object) cache. By POJ= O, we mean + that the cache: 1) automatically manages object mapping = and + relationship for a client under both local and replicate= d cache + mode, 2) provides support for inheritance relationship b= etween + "aspectized" POJOs. By leveraging the dynamic AOP in JBo= ssAop, it is + able to map a complex object into the cache store, prese= rve 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 perfor= mance and + minimize network traffic. + + + 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, p= roviding + ease of use. For example, if a POJO has been put in Pojo= Cache (by + calling putObject, for example), then any get/set method= will be + intercepted by PojoCache to provide the data from the + cache. + + + + + + + What's the relationship between PojoCache and TreeCac= heAop classes? + + + + Since release 1.4, we have created a new class called= PojoCache (to better reflect the + cache nature). The old implementation TreeCacheAop has b= een deprecated. + + + + + + + Does PojoCache have all the functional capabilities of + TreeCache? + + + + + Yes. PojoCache extends TreeCache so it has all the sa= me + features TreeCache such as cache mode, transaction isola= tion level, + and eviction policy. + + + + + + + What is the difference between TreeCache and + PojoCache? + + + + + Think of PojoCache as a TreeCache on steroids. :-) + Seriously, both are cache stores-- one is a generic cach= e and the other other one POJO Cache. + However, while TreeCache only + provides pure object reference storage (e.g., + put(FQN fqn, + Object key, Object value) + + ), 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 t= o cache, you + can have PojoCache manage it for you. You simply treat y= our + object systems as they are residing in-memory, e.g., use= your + regular POJO methods without worrying about cache manage= ment. + Furthermore, this is true in replication mode as well. + + + + + + + What are the steps to use the PojoCache feature? + + + + 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: + + + + + prepare POJO. You can do either via xml declara= tion 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 i= t. + + + + instrumentation. You will need to instrument yo= ur POJO either at compile-time or load-time. + If you do it during compile-time, you use so-calle= d aop pre-compiler (aopc) to do bytecode + manipulation. + If you do it via load-time, however, you need eith= er a special system class loader or, in JDK50, + you can + use the javaagent option. + + + + 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 exa= mple, please refer to the distro examples + directory. + There are numerous PojoCache examples that uses differen= t options. + + + + + + + Can I run PojoCache in JBoss AS 3.2.x application + server? + + + + + Yes and no. Yes, since JBossAop can also be back-port= ed 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. + + + + + + + Can PojoCache run as a MBean as well? + + + + Yes. It is almost the same as TreeCache MBean. The on= ly + difference is the object name and the class name. E.g., = instead + of + <mbean code=3D"org.jboss.cache.TreeCa= che" + name=3D"jboss.cache:service=3DTreeCache"> + you will have: + <mbean code=3D"org.jboss.cache.aop.Po= joCache" + name=3D"jboss.cache:service=3DPojoCache"> + in the xml configuration file. + + + + + + + Can I pre-compile the aop classes such that I don't n= eed to + use the system classloader and jboss-aop configuration x= ml? + + + + + Yes. The latest versions of JBossCache have a pre-com= piler + option called + aopc + . You can use this option to + pre-compile your "aspectized" POJO. Once the classes hav= e been byte + code generated, they can be treated as regular class fil= es, i.e., + you will not need to include any + jboss-aop.xml + that specifies the advisable POJO and to specify the JBo= ssAop system + class loader. + + + For an example of how to use + aopc + , please + see 1) + tools + directory for PojoCacheTasks14.xml + and PojoCacheTasks50.xml. Both contain Ant tasks that yo= u can + import to your regular project for + annoc + and + aopc + . In addition, please also check out the + examples + directory for concrete examples. + + + + + + + How do I use aopc on multiple module directories? + + + + In aopc, you specify the src path for a specific dire= ctory. To + pre-compile multiple ones, you will need to invoke aopc = multiple + times. + + + + + + + What's in the + jboss-aop.xml + configuration? + + + + + + jboss-aop.xml + is needed for POJO + instrumentation. In + jboss-aop.xml + , you can + declare your POJO (e.g., + Person + ) to be + "prepared", a JBossAop term to denote that the object wi= ll be + "aspectized" by the system. After this declaration, JBos= sAop will + invoke any interceptor that associates with this POJO. P= ojoCache + will dynamically add an + org.jboss.cache.aop.CacheInterceptor + to this POJO + to perform object mapping and relationship management. + + + Note that to add your POJO, you should declare all th= e fields + to be "prepared" as in the example. + + + + + + + Can I use annotation instead of the xml declaration?<= /para> + + + + Yes, starting with JBossCache 1.3, you can use annota= tion to + instrument your POJO for both JDK1.4 and 1.5. Check the = documentation for details. + + + + + + + What are the pro and con of xml vs. annotation? + + + + 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. + + + + + + + What are the + @org.jboss.cache.aop.annotation.Transient + and + @org.jboss.cache.aop.annotation.Serializable + field level annotations? + + + + + Starting in 1.4, we also offer two additional field-l= evel annotations. The first one, + @Transient + , + when applied has the same effect as declaring a field + transient + . PojoCache + won't put this field under management. + + The second one, + @Serializable + when applied, will cause PojoCache to + treat the field as a Serializable object even when it is + @PojoCacheable + . + + + + + + + What about compile-time vs. load-time instrumentation= then? + + + + 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. + + + + + + + Is it possible to store the same object multiple time= s but + with different Fqn paths? Like /foo/byName and /foo/byId= ? + + + + + 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. + + + + + + + Do I need to declare all my objects "prepared" in + jboss-aop.xml + ? + + + + + 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 dec= laration. + The cache will treat this object as a "primitive" type. = However, the + object will need to implement + Serializable + interface for replication. + + + + + + + Can the cache aop intercept update via reflection? + + + + No. The update via reflection will not be intercepted= in + JBossAop and therefore PojoCache will not be able to per= form the + necessary synchronization. + + + + + + + When I declare my POJO to be "aspectized", what happe= ns to the + fields with transient, static, and final modifiers? + + + + + PojoCache currently will ignore the fields with these + modifiers. That is, it won't put these fields into the c= ache (and + thus no replication either). + + + + + + + What are those keys such as + JBoss:internal:class + and + AOPInstance + ? + + + + + They are for internal use only. Users should ignore t= hese keys + and values in the node hashmap. + + + + + + + What about Collection classes? Do I need to declare t= hem + "prepared"? + + + + + No. Since the Collection classes such as + ArrayList + 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 t= he + putObject + call is invoked). The proxy will + delegate the operations to a cache interceptor that impl= ements the + actual Collection classes APIs. That is, the system clas= ses won't be + invoked when used in PojoCache. + + + 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 certa= in APIs. For + example, both + ArrayList + and + LinkedList + will have the same implementation. + Plan is currently underway to optimize these APIs. + + + + + + + How do I use + List + , + Set + , + and + Map + dynamic proxy? + + + + + PojoCache supports classes extending from + List + , + Set + , and + Map + without users to declare them "aspectized". + It is done via a dynamic proxy. Here is a code snippet t= o use an + ArrayList + proxy class. + + + ArrayList list =3D 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 POJ= O. + + ArrayList myList =3D (List)cache.getObject("/list/test"); = + // we are getting a dynamic proxy instead + myList.add("second"); = + // it works now + myList.add("third"); + myList.remove("third"); + + + + + + + What is the proper way of assigning two different key= s with + Collection class object? + + + + + Let's say you want to assign a + List + object + under two different names, you will need to use the clas= s proxy to + insert the second time to ensure both are managed by the= cache. Here + is the code snippet. + + + ArrayList list =3D new ArrayList(); + list.add("first"); + + cache.putObject("/list", list); = + // Put the list under the aop cache + + ArrayList myList =3D (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"); + + + + + + + OK, so I know I am supposed to use proxy when manipul= ating the + Collection classes once they are managed by the cache. B= ut what + happens to Pojos that share the Collection objects, e.g.= , a + List + instance that is shared by 2 Pojos? + + + + + Pojos that share Collection instance references will = be + handled by the cache automatically. That is, when you as= k the Cache + to manage it, the Cache will dynamically swap out the re= gular + Collection references with the dynamic proxy ones. As a = result, it + is transparent to the users. + + + + + + + What happens when my "aspectized" POJO has field memb= ers that + are of Collection class ? + + + + + When a user puts a POJO into the cache through the ca= ll + putObject + , it will recursively map the field + members into the cache store as well. When the field mem= ber is of a + Collection class (e.g., List, Set, or Map), PojoCache wi= ll first + map the collection into cache. Then, it will swap out dy= namically + the field reference with an corresponding proxy referenc= e. + + + This is necessary so that an internal update on the f= ield + member will be intercepted by the cache. + + + + + + + + What are the limitation of Collection classes in Pojo= Cache? + + + + Use of Collection class in PojoCache helps you to tra= ck fine-grained changes + in your collection fields automatically. However, curren= t implementation has the follow + limitation that we plan to address soon. + + Currently, we only support a limited implementation o= f Collection classes. That is, + we support APIs in List, Set, and Map. However, since th= e 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 o= ther implementation would not. + The Set interface maps to java.util.HashSet implementati= on. The List interface maps + to java.util.ArrayList implementation. The Map interface= maps to java.util.HashMap + implementation. + + Another related issue is the expected performance. Fo= r example, the current implementation is + ordered, + so + that makes insert/delete from the Collection slow. Perfo= rmance between Set, Map and List collections + also + vary. + Adding items to a Set is slower than a List or Map, sinc= e Set does not allow duplicate entries. + + + + + + + + What are the pros and cons of PojoCache? + + + + As mentioned in the reference doc, PojoCache has the = following advantages: + + + Fine-grained replication and/or persistency. If= you use a distributed PojoCache + and once your POJO is put in the cache store, ther= e 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. + + + + Fine-grained replication can have potential per= formance gain if your POJO is big and + the changes are fine-grained, e.g., only to some s= elected fields. + + + + POJO can posses object relationship, e.g., mult= iple referenced. Distributed + PojoCache will handle this transparently for you. + + + + And here are some cases that you may not want to use = PojoCache: + + + You use only cache. That is you don't need repl= ication or persistency. Then since + everything is operated on the in-memory POJO refer= ence, there is no need for PojoCache. + + + + You have simple and small POJOs. Your POJO is s= mall in size and also there is no + object relationship, then PojoCache possess not cl= ear advantage to plain cache. + + + + Your application is bounded by memory usage. Be= cause PojoCache need almost twice as much + of memory (the original POJO in-memory space and a= lso the additional cache store for the + primitive fields), you may not want to use PojoCac= he. + + + + 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. + + + + + + + + + Eviction Policies + + + + + + + Does JBoss Cache support eviction policies? + + + + Yes. JBoss Cache currently implements a LRU eviction = policy for + both TreeCache + ( + org.jboss.cache.eviction.LRUPolicy + ) and + PojoCache + ( + org.jboss.cache.aop.eviction.AopLRUPolicy + ). Users + can also plug in their own eviction policy algorithms. S= ee user + manual for details. Currently there is user-contributed = policy + called + FIFOPolicy + that evicts the node based on + FIFO principle only. + + + + + + + Why can't I use + org.jboss.cache.eviction.LRUPolicy + for + PojoCache as well? + + + + + For PojoCache, you will need to use + org.jboss.cache.aop.eviction.AopLRUPolicy + ) because + AOP has its eviction algorithm, although is LRU but has = totally + different notion of an "object", for example. + + + + + + + Does JBoss Cache's implemented LRU eviction policy op= erates in + replication mode? + + + + + Yes and no. :-) + + The LRU 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 obtai= n the cached + contents of an evicted node and finds out that is null (= e.g., + get + returns null), it should get it from the + other data source and re-populate the data in the cache.= During this + moment, the node content will be propagated and the cach= e content + will be in sync. + + + However, you still can run eviction policies with cac= he mode + set to either + REPL_SYNC + or + REPL_ASYNC + . Depending on your use case, you can + set multiple cache instances to have their own eviction = policy + (which are applied locally) or just have selected instan= ces with + eviction policies activated. + + + Also note that, with cache loader option, a locally e= victed + node can also be persisted to the backend store and a us= er can + retrieve it from the store later on. + + + + + + + Does JBoss Cache support + Region + ? + + + + + Yes. JBoss Cache has the notion of region where a use= r can + configure the eviction policy parameters (e.g., + maxNodes + or + timeToIdleSeconds + ) + + + A region in JBoss Cache denotes a portion of tree hie= rarchy, + e.g., a fully qualified name ( + FQN + ). For example, + a user can define + /org/jboss + and + /org/foocom + as two separate regions. But note + that you can configure the region programmatically now, = i.e., + everything has to be configured through the xml file. + + + + + + + What are the + EvictionPolicyConfig + tag + parameters for + org.jboss.cache.eviction.LRUPolicy + ? + + + + + They are: + + + + Parameters + + + + + wakeUpIntervalInSeconds + + Interval where the clean up thread wakes= to process + the sitting queue and sweep away the old dat= a. + + + + + region + + A area where each eviction policy parame= ters are + specified. Note that it needs a minimum of + /_default + region. + + + + + maxNodes + + Max number of nodes allowed in the evict= ion queue. 0 + means no limit. + + + + + timeToLiveInSeconds + + Age (in seconds) for the node to be evic= ted in the + queue. 0 denotes no limit. + + + + +
+
+
+ + + + I have turned on the eviction policy, why do I still = get "out + of memory" (OOM) exception? + + + + + OOM can happen when the speed of cache access exceeds= the + speed of eviction policy handling timer. Eviction policy= handler + will wake up every + wakeUpIntervalInSeconds + seconds to process the eviction event queue. And the que= ue size is + fixed at 20000 now. So when the queue size is full, it w= ill create a + backlog and cause OOM to happen unless the eviction time= r catches + up. To address this problem, in addition to increase the= VM heap + size, you can also reduce the + wakeUpIntervaleInSeconds + so the timer thread + processes the queue more frequently. + + + We will also externalize the queue size so it will be + configurable in the next release. + + + +
+
+ + Cache Loaders + + + + + + + What is a CacheLoader? + + + + A CacheLoader is the connection of JBossCache to a + (persistent) data store. The CacheLoader is called by JB= ossCache to + fetch data from a store when that data is not in the cac= he, and when + modifications are made to data in the cache the CacheLoa= der is + called to store those modifications back to the store. + + + In conjunction with eviction policies, JBossCache wit= h a + CacheLoader allows a user to maintain a bounded cache fo= r a large + backend datastore. Frequently used data is fetched from = the + datastore into the cache, and the least used data is evi= cted, in + order to provide fast access to frequently accessed data= . This is + all configured through XML, and the programmer doesn't h= ave to take + care of loading and eviction. + + + JBossCache currently ships with several CacheLoader + implementations, including: + + + + + + FileCacheLoader: this implementation uses th= e file + system to store and retrieve data. JBossCache n= odes are mapped + to directories, subnodes to subdirectories etc.= Attributes of + a node are mapped to a file + data + inside the + directory. + + + + + BdbjeCacheLoader: this implementation is bas= ed on the + Sleepycat Java Edition database, a fast and eff= icient + transactional database. It uses a single file f= or the entire + store. Note that if you use Sleepycat's CacheLo= ader with + JBoss Cache and wish to ship your product, you = will have to acquire a + commercial license from Sleepycat + + . + + + + + JDBCCacheLoader: this implementation uses th= e relational database as the persistent + storage. + + + + + ClusteredCacheLoader: this implementation qu= eries the rest of the cluster, treating other + servers' in-memory state as a data store. + + + + + And more. See the documentation for more det= ails. + + + + + + + + + Can writing to CacheLoaders be asynchronous? + + + + As of JBossCache 1.2.4, yes. Set the CacheLoaderAsync= hronous + property to true. See the JBossCache documentation for a= more + detailed discussion. By default though, all cache loader= writes are + synchronous and will block. + + + + + + + Can I write my own CacheLoader ? + + + + Yes. A CacheLoader is a class implementing + org.jboss.cache.loader.CacheLoader + . It is + configured via the XML file (see JBossCache and Tutorial + documentation). + + + + + + + Does a CacheLoader have to use a persistent store ? + + + + No, a CacheLoader could for example fetch (and possib= ly store) + its data from a webdav-capable webserver. Another exampl= e is a + caching proxy server, which fetches contents from the we= b. Note that + an implementation of CacheLoader may not implement the '= store' + functionality in this case, but just the 'load' + functionality. + + + + + + + What can I use a CacheLoader for? + + + + Some applications: + + + + + HTTP sessions can be persisted (besides bein= g replicated + by JBossCache). The CacheLoader can be configur= ed to be + shared, or unshared, meaning that every node in= a cluster has + its own local store. It is also possible to att= ach a + CacheLoader to just + one + of the + nodes. + + + + + Simple persistence for POJOs. Use of JBossCa= che aop and + a local CacheLoader persist POJOs transparently= into the store + provided by the CacheLoader. + + + + + Highly available replicated and persisted da= ta store. + The service is up as long as at least 1 node is= running, but + even if all nodes are taken offline, when the f= irst node is + started again, the data previously saved will s= till be + available (e.g. a shopping cart). + + + + + A caching web proxy (a la Squid): all data a= re contents + of URLs, users access the proxy, and if the URL= is not in the + cache, the CacheLoader fetches it from the web.= This could + actually be a replicated and transactional vers= ion of + Squid. + + + + + + + + + + How do I configure JBossCache with a CacheLoader? + + + + Through XML: both the fully-qualified classname of the + CacheLoader and its configuration string have to be give= n. + JBossCache will then instantiate a CacheLoader. See JBos= sCache + documentation for details. + + + + + + + Do I have to pay to use Sleepycat's CacheLoader? + + + + Not if you use it only for personal use. As soon as y= ou + distribute your product with BdbjeCacheLoader, you have = to purchase + a commercial license from Sleepycat. See details at + http://www.sleepycat.com/jeforjbosscache + + . + + + + + + + Can I use more than one cache loader? + + + + As of JBossCache 1.3.0, yes. With the new CacheLoader= Configuration XML + element (see user manual section on cache loaders) you c= an now + describe several cache loaders. The impact is that the c= ache will + look at all of the cache loaders in the order they've be= en + configured, until it finds a valid, non-null element of = data. When + performing writes, all cache loaders are written to (exc= ept if the + ignoreModifications element has been set to true for a s= pecific + cache loader. + + + + + + + Why do cache loaders go into an inconsistent state wh= en I use transactions, pessimistic locking, + and I + attempt to read a node after removing it from within the= same transaction scope? + + + + + This is a known bug (see + JBCACHE-477 + and + JBCACHE-352 + ), which have been fixed in JBoss Cache 1.4.0. A very si= mple workaround if you're using JBoss Cache + 1.3.x + is to use optimistic locking. + + + One of the consequences of this bug is that, for example= , if you use PojoCache with pojos that have + private references to a List and you update and remove s= omeelements of that List within a transaction + (when using pessimistic locking and a cache loader), you= may see IllegalStateExceptions thrown. + + + + + + + + + Troubleshooting + + + + + I am having problems getting JBoss Cache to work, whe= re can I get information on troubleshooting? + + + + Troubleshooting section can be found in the following + wiki link + . + + + + + + + +
--===============7536008893958144781==-- From jbosscache-commits at lists.jboss.org Wed Nov 18 23:07:02 2009 Content-Type: multipart/mixed; boundary="===============4827593052213734022==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8294 - enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US. Date: Wed, 18 Nov 2009 23:07:02 -0500 Message-ID: <200911190407.nAJ472RQ025477@svn01.web.mwc.hst.phx2.redhat.com> --===============4827593052213734022== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-18 23:07:02 -0500 (Wed, 18 Nov 2009) New Revision: 8294 Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/Revision_History.xml Log: Adding changes for CP07 build. Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/Revision_His= tory.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/Revision_History.x= ml 2009-11-19 04:06:04 UTC (rev 8293) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/en-US/Revision_History.x= ml 2009-11-19 04:07:02 UTC (rev 8294) @@ -8,15 +8,15 @@ 1.0 - + Thu Nov 19 2009 - - - + Laura + Bailey + lbailey(a)redhat.com - + Initial draft. --===============4827593052213734022==-- From jbosscache-commits at lists.jboss.org Wed Nov 18 23:10:03 2009 Content-Type: multipart/mixed; boundary="===============6816952371356751773==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8295 - enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US. Date: Wed, 18 Nov 2009 23:10:02 -0500 Message-ID: <200911190410.nAJ4A23r025838@svn01.web.mwc.hst.phx2.redhat.com> --===============6816952371356751773== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-18 23:10:01 -0500 (Wed, 18 Nov 2009) New Revision: 8295 Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss_= Cache_Pojo_Cache_Guide_CP07.ent enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss_= Cache_Pojo_Cache_Guide_CP07.xml Removed: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss_= Cache_Pojo_Cache_Guide_CP06.ent enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss_= Cache_Pojo_Cache_Guide_CP06.xml Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/Book_I= nfo.xml enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/Revisi= on_History.xml Log: Adding changes for CP07 build. Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US= /Book_Info.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/Book_= Info.xml 2009-11-19 04:07:02 UTC (rev 8294) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/Book_= Info.xml 2009-11-19 04:10:01 UTC (rev 8295) @@ -2,8 +2,8 @@ = - JBoss Cache Pojo Cache Guide CP06 - for Use with JBoss Enterprise Application Platform 4.3 Cumulati= ve Patch 6 + JBoss Cache Pojo Cache Guide CP07 + for Use with JBoss Enterprise Application Platform 4.3 Cumulati= ve Patch 7 2.0 1 JBoss Enterprise Application Platform Deleted: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/= JBoss_Cache_Pojo_Cache_Guide_CP06.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP06.ent 2009-11-19 04:07:02 UTC (rev 8294) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP06.ent 2009-11-19 04:10:01 UTC (rev 8295) @@ -1,3 +0,0 @@ - - - Deleted: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/= JBoss_Cache_Pojo_Cache_Guide_CP06.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP06.xml 2009-11-19 04:07:02 UTC (rev 8294) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP06.xml 2009-11-19 04:10:01 UTC (rev 8295) @@ -1,45 +0,0 @@ - - - - - - Preface - - PojoCache is an in-memomy, transactional, and replicated POJO (plain old= Java object) cache system that allows users to operate on a POJO transpare= ntly without active user management of either replication or persistency as= pects. PojoCache, a component of JBossCache (uses PojoCache class as an int= ernal implementation, the old implementation TreeCacheAop has been deprecat= ed.), is the first in the market to provide a POJO cache functionality. JBo= ssCache by itself is a 100% Java based library that can be run either a= s a standalone program or inside an application server. = - - - This document is meant to be a user guide to explain the architecture, a= pi, configuration, and examples for PojoCache. We assume the readers are fa= miliar with both JGroups and TreeCache usages. Since PojoCache uses JBossAo= p framework, an introduction will also be given there. = - - - If you have questions, use the user forum linked = on the JBossCache website. We also provide tracking links for tracking bug = reports and feature requests on JBoss = Jira web site . If you are interested in the development of PojoCac= he, post a message on the forum. If you are interested in translating this = documentation into your language, contact us on the developer mailing list. = - - - JBossCache is an open-source product based on LGPL. Commercial developme= nt support, production support and training for JBoss Cache is available th= rough JBoss Inc. (see JBoss web site ). JBoss Cache is a project of the JBoss Professional Open Source pro= duct suite. = - - - In some of the example listings, what is meant to be displayed on one li= ne does not fit inside the available page width. These lines have been brok= en up. A '\' at the end of a line means that a break has been introduce= d to fit in the page, with the following lines indented. So: - Let's pretend to have an extremely \ - long line that \ - does not fit - This one is short - = - - Is really: - Let's pretend to have an extremely long line that does not fit - This one is short - = - - - - - - - - - - - - - - - Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JB= oss_Cache_Pojo_Cache_Guide_CP07.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP07.ent (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP07.ent 2009-11-19 04:10:01 UTC (rev 8295) @@ -0,0 +1,3 @@ + + + Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JB= oss_Cache_Pojo_Cache_Guide_CP07.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP07.xml (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/JBoss= _Cache_Pojo_Cache_Guide_CP07.xml 2009-11-19 04:10:01 UTC (rev 8295) @@ -0,0 +1,45 @@ + + + + + + Preface + + PojoCache is an in-memory, transactional, and replicated POJO (plain old= Java object) cache system that allows users to operate on a POJO transpare= ntly without active user management of either replication or persistency as= pects. PojoCache, a component of JBossCache (uses PojoCache class as an int= ernal implementation, the old implementation TreeCacheAop has been deprecat= ed.), is the first in the market to provide a POJO cache functionality. JBo= ssCache by itself is a 100% Java based library that can be run either a= s a standalone program or inside an application server. = + + + This document is meant to be a user guide to explain the architecture, a= pi, configuration, and examples for PojoCache. We assume the readers are fa= miliar with both JGroups and TreeCache usages. Since PojoCache uses JBossAo= p framework, an introduction will also be given there. = + + + If you have questions, use the user forum linked = on the JBossCache website. We also provide tracking links for tracking bug = reports and feature requests on JBoss = Jira web site . If you are interested in the development of PojoCac= he, post a message on the forum. If you are interested in translating this = documentation into your language, contact us on the developer mailing list. = + + + JBossCache is an open-source product based on LGPL. Commercial developme= nt support, production support and training for JBoss Cache is available th= rough JBoss Inc. (see JBoss web site ). JBoss Cache is a project of the JBoss Professional Open Source pro= duct suite. = + + + In some of the example listings, what is meant to be displayed on one li= ne does not fit inside the available page width. These lines have been brok= en up. A '\' at the end of a line means that a break has been introduce= d to fit in the page, with the following lines indented. So: + Let's pretend to have an extremely \ + long line that \ + does not fit + This one is short + = + + Is really: + Let's pretend to have an extremely long line that does not fit + This one is short + = + + + + + + + + + + + + + + + Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US= /Revision_History.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/Revis= ion_History.xml 2009-11-19 04:07:02 UTC (rev 8294) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/en-US/Revis= ion_History.xml 2009-11-19 04:10:01 UTC (rev 8295) @@ -8,15 +8,15 @@ 1.0 - + thu Nov 19 2009 - - - + Laura + Bailey + lbailey(a)redhat.com - + Initial draft. --===============6816952371356751773==-- From jbosscache-commits at lists.jboss.org Wed Nov 18 23:12:12 2009 Content-Type: multipart/mixed; boundary="===============2236653530891803762==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8296 - enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US. Date: Wed, 18 Nov 2009 23:12:12 -0500 Message-ID: <200911190412.nAJ4CC1x026406@svn01.web.mwc.hst.phx2.redhat.com> --===============2236653530891803762== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-18 23:12:11 -0500 (Wed, 18 Nov 2009) New Revision: 8296 Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss_= Cache_Tree_Cache_Guide_CP07.ent enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss_= Cache_Tree_Cache_Guide_CP07.xml Removed: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss_= Cache_Tree_Cache_Guide_CP06.ent enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss_= Cache_Tree_Cache_Guide_CP06.xml Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/Book_I= nfo.xml enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/Revisi= on_History.xml Log: Adding changes for CP07 build. Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US= /Book_Info.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/Book_= Info.xml 2009-11-19 04:10:01 UTC (rev 8295) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/Book_= Info.xml 2009-11-19 04:12:11 UTC (rev 8296) @@ -2,8 +2,8 @@ = - JBoss Cache Tree Cache Guide CP06 - for Use with JBoss Enterprise Application Platform 4.3 Cumulati= ve Patch 6 + JBoss Cache Tree Cache Guide CP07 + for Use with JBoss Enterprise Application Platform 4.3 Cumulati= ve Patch 7 2.0 1 JBoss Enterprise Application Platform Deleted: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/= JBoss_Cache_Tree_Cache_Guide_CP06.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP06.ent 2009-11-19 04:10:01 UTC (rev 8295) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP06.ent 2009-11-19 04:12:11 UTC (rev 8296) @@ -1,3 +0,0 @@ - - - Deleted: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/= JBoss_Cache_Tree_Cache_Guide_CP06.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP06.xml 2009-11-19 04:10:01 UTC (rev 8295) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP06.xml 2009-11-19 04:12:11 UTC (rev 8296) @@ -1,53 +0,0 @@ - - - - - - Preface - - This and its accompanying documents describe JBoss Cache's TreeCache, a = tree-structured replicated, transactional cache. JBoss Cache's PojoCache, a= n "object-oriented" cache that is the AOP-enabled subclass of TreeCache, al= lowing for Plain Old Java Objects (POJOs) to be inserted and replicated tra= nsactionally in a cluster, is described separately in a similar user guide. = - - - The TreeCache is fully configurable. Aspects of the system such as repli= cation mechanisms, transaction isolation levels, eviction policies, and tra= nsaction managers are all configurable. The TreeCache can be used in a stan= dalone fashion - independent of JBoss Application Server or any other appli= cation server. PojoCache on the other hand requires both TreeCache and the = JBossAOP standalone subsystem. PojoCache, documented separately, is the fir= st in the market to provide a POJO cache functionality. = - - - This document is meant to be a user guide to explain the architecture, a= pi, configuration, and examples for JBoss Cache's TreeCache. Good knowledge= of the Java programming language along with a string appreciation and unde= rstanding of transactions and concurrent threads is presumed. No prior know= ledge of JBoss Application Server is expected or required. = - - - If you have questions, use the user forum linked= on the JBoss Cache website= . We also provide a mechanism for tracking bug reports and feature= requests on the JBoss JIRA issue trac= ker . If you are interested in the development of JBoss Cache or i= n translating this documentation into other languages, we'd love to hear fr= om you. Please post a message on the user forum or contact us on the developer mailing list . = - - - JBoss Cache is an open-source product based on LGPL. Commercial developm= ent support, production support and training for JBoss Cache is available t= hrough JBoss Inc. JBoss Cache i= s a product in JBoss Professional Open Source JEMS (JBoss Enterprise Middleware Suite). = - - - = - - = - - = - - = - - = - - = - - = - - = - - = - - = - - = - - = - - = - - = - - - - Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JB= oss_Cache_Tree_Cache_Guide_CP07.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP07.ent (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP07.ent 2009-11-19 04:12:11 UTC (rev 8296) @@ -0,0 +1,3 @@ + + + Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JB= oss_Cache_Tree_Cache_Guide_CP07.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP07.xml (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP07.xml 2009-11-19 04:12:11 UTC (rev 8296) @@ -0,0 +1,53 @@ + + + + + + Preface + + This and its accompanying documents describe JBoss Cache's TreeCache, a = tree-structured replicated, transactional cache. JBoss Cache's PojoCache, a= n "object-oriented" cache that is the AOP-enabled subclass of TreeCache, al= lowing for Plain Old Java Objects (POJOs) to be inserted and replicated tra= nsactionally in a cluster, is described separately in a similar user guide. = + + + The TreeCache is fully configurable. Aspects of the system such as repli= cation mechanisms, transaction isolation levels, eviction policies, and tra= nsaction managers are all configurable. The TreeCache can be used in a stan= dalone fashion - independent of JBoss Application Server or any other appli= cation server. PojoCache on the other hand requires both TreeCache and the = JBossAOP standalone subsystem. PojoCache, documented separately, is the fir= st in the market to provide a POJO cache functionality. = + + + This document is meant to be a user guide to explain the architecture, a= pi, configuration, and examples for JBoss Cache's TreeCache. Good knowledge= of the Java programming language along with a string appreciation and unde= rstanding of transactions and concurrent threads is presumed. No prior know= ledge of JBoss Application Server is expected or required. = + + + If you have questions, use the user forum linked= on the JBoss Cache website= . We also provide a mechanism for tracking bug reports and feature= requests on the JBoss JIRA issue trac= ker . If you are interested in the development of JBoss Cache or i= n translating this documentation into other languages, we'd love to hear fr= om you. Please post a message on the user forum or contact us on the developer mailing list . = + + + JBoss Cache is an open-source product based on LGPL. Commercial developm= ent support, production support and training for JBoss Cache is available t= hrough JBoss Inc. JBoss Cache i= s a product in JBoss Professional Open Source JEMS (JBoss Enterprise Middleware Suite). = + + + = + + = + + = + + = + + = + + = + + = + + = + + = + + = + + = + + = + + = + + = + + + + Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US= /Revision_History.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/Revis= ion_History.xml 2009-11-19 04:10:01 UTC (rev 8295) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/Revis= ion_History.xml 2009-11-19 04:12:11 UTC (rev 8296) @@ -8,15 +8,15 @@ 1.0 - + Thu Nov 19 2009 - - - + Laura + Bailey + lbailey(a)redhat.com - + Initial draft. --===============2236653530891803762==-- From jbosscache-commits at lists.jboss.org Wed Nov 18 23:14:22 2009 Content-Type: multipart/mixed; boundary="===============3646015184725443604==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8297 - enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US. Date: Wed, 18 Nov 2009 23:14:22 -0500 Message-ID: <200911190414.nAJ4EMj6026654@svn01.web.mwc.hst.phx2.redhat.com> --===============3646015184725443604== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-18 23:14:21 -0500 (Wed, 18 Nov 2009) New Revision: 8297 Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_Tu= torial_CP07.ent enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_Tu= torial_CP07.xml Removed: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_Tu= torial_CP06.ent enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_Tu= torial_CP06.xml Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/Book_Info.xml enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/Revision_Histo= ry.xml Log: Adding changes for CP07 build. Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/Book_In= fo.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/Book_Info.xml= 2009-11-19 04:12:11 UTC (rev 8296) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/Book_Info.xml= 2009-11-19 04:14:21 UTC (rev 8297) @@ -2,8 +2,8 @@ = - JBoss Cache Tutorial CP06 - for Use with JBoss Enterprise Application Platform 4.3 Cumulati= ve Patch 6 + JBoss Cache Tutorial CP07 + for Use with JBoss Enterprise Application Platform 4.3 Cumulati= ve Patch 7 2.0 1 JBoss Enterprise Application Platform Deleted: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Ca= che_Tutorial_CP06.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP06.ent 2009-11-19 04:12:11 UTC (rev 8296) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP06.ent 2009-11-19 04:14:21 UTC (rev 8297) @@ -1,3 +0,0 @@ - - - Deleted: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Ca= che_Tutorial_CP06.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP06.xml 2009-11-19 04:12:11 UTC (rev 8296) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP06.xml 2009-11-19 04:14:21 UTC (rev 8297) @@ -1,503 +0,0 @@ - - - - - JBossCache Tutorial - - - Introduction - - JBossCache is an in-memory replicated (synchronous or asynchronous), tr= ansactional, and fine-grained cache. It consists of two subsystems: TreeCac= he (plain cache) and PojoCache (object-oriented POJO cache). In this tutori= al, we will demonstrate the usage of both cache features. For details of th= e usage and APIs, please refer to the user manuals for TreeCache and PojoCa= che. = - -
- Scope - - - - Cache creation and modification - - - - - Replication - - - - - PojoCache - - - - - Transaction - - - -
- = -
- - Configuration - - First download the standalone TreeCache code from here. Unzip i= t, and you will get a root directory (jboss-cache in our example). = - - - The configuration files are located under the etc directory. You can mo= dify the behavior of TreeCache through editing the various configuration fi= les. = - - - - - log4j.xml. Logging output. You can turn on logging= level or change log file directory (default is /tmp/jbosscache.lo= g). = - - - - - replSync-service.xml. Tree cache configuration fil= e (file name is not fixed. You specify the file to be read in Prop= ertyConfigurator). The settings are for a replicated, synchronous= , and transactional cache. The default DummyTransactionManager is used with= a transaction isolation level of REPEATABLE_READ. For details of the confi= guration parameters, please refer to the Treecache. Note that this file is used i= n the BSH ( BeanShell, a l= ightweight Java compatible scripting language) script to configure the cach= e. = - - - - - jboss-aop.xml. AOP pointcut and advice definition = for the example POJO classes, Person and Address, respectively. For details= of how to put your own class under AOP, please refer to the PojoCache. This file= is read in when the process is started. = - - - - - - Script - - The script files that are needed (located under install directory) in t= his tutorial are: = - - - - - build.sh (or build.bat for DOS/= Windows). Simple build script that wraps around ant. Users can simply type = sh build.sh for help. Note from now on, we will only ref= er to the Unix version with the understanding that there is a corresponding= DOS counterpart. The same goes for runDemoShell explained next. = - - - - - runDemoShell.sh. Simple run script that wraps arou= nd BeanShell. This is used to operate the replicated cache through interact= ive command line. = - - - - - plain.bsh. Java code that instantiate and configur= e the cache. It also creates an example cache entry. = - - - - - aop.bsh. Java codes that instantiate and configure= the aop cache. In addition, it also sets up the example POJO (plain old Ja= va object) classes (e.g., Person and Address). = - - - - - aopWithTx.bsh. Same with aop.bsh except it also in= stantiates a transaction context. = - - - - - - Example POJO - - The example POJO classes used for PojoCache demo are: Person and Address. They are located under te= sts/org/jboss/cache/aop directory. Person has = attributes of String age, Address addr, List languages = , etc. We will demonstrate that once you put the POJO instance in the cache= , plain get/set POJO methods will be intercepted by the cache. = - - - Here is the snippet of the class definition for Person and Address . = - -public class Person { - String name=3Dnull; - int age=3D0; - Map hobbies=3Dnull; - Address address=3Dnull; - Set skills; - List languages; - - public String getName() { return name; } - public void setName(String name) { this.name=3Dname; } - ... - } - = - -public class Address { - String street=3Dnull; - String city=3Dnull; - int zip=3D0; - - public String getStreet() { return street; } - public void setStreet(String street) { this.street=3Dstreet; } - ... - } - = - - - - Demo - - To run the demo, you will need at least two windows: one to peruse the = cache contents (plus non-aop operations) and the other to operate the cache= directly. Of course, you can also open more than one GUI window to see the= cache replication at work to multiple members. You will also need to run t= he scripts under jboss-cache installation directory after you unzip the rel= ease package (jboss-cache-dist.zip). Due to the limitation of the GUI, plea= se note that: = - - - - - For each demo example, it'd be best if you re-start the whole set= up. - - - - - While you can modify the cache content on the GUI window and it will = show up on the BSH cache content (e.g., through cache.printDetails= () ), this won't work on PojoCache demo. That is, you can onl= y modify the cache content on the BSH window. - - - - - The two demo programs to run are: - - - - - On the first window for the GUI, type sh build.sh = to see the available commands. To run the GUI, type sh build.sh r= un.demo . It will startup a PojoCache GUI. Later on, you can clic= k on a node to view the the contents. Note that you can also add/modify the= node contents for non-AOP cache entries. Since the GUI entry only accepts = String for now, operation on aop cache from the GUI will not always work (u= nless it is a String type). = - - - - - On the second window for the interactive Java commands, type sh runSh= ellDemo.sh to fire off the BeanShell interactive command shell (you can use= either ^D or ^Z in Windows and Unix to exit afterward). You can then read = in the Java code scripts to showcase the cache capabilities (e.g., plain.bs= h, aop.bsh, and aopWithTx.bsh). See the following for details. = - - - - - - Plain cache - - Once you are in the shell, you can either execute the script to populat= e the cache, or type it in manually by command line. To run the script, typ= e sourceRelative("plain.bsh"); under the interactive BSH= shell. For this to work, you'll need to have your working directory se= t to the directory in which plain.bsh resides (otherwise give the full path= name of plain.bsh). Basically, the script will create cache entries that wi= ll be replicated onto the GUI. (You may have to type show() into the result= ing beanshell window yourself) Here are the snippets for the script: = - -import org.jboss.cache.*; - show(); // verbose mode for bean shell - TreeCache tree =3D new TreeCache(); - PropertyConfigurator config =3D new PropertyConfigurator(); = - // configure tree cache. Needs to be in the classpath - config.configure(tree, "META-INF/replSync-service.xml"); - tree.startService(); = - // kick start tree cache - tree.put("/a/b/c", "ben", "me"); = - // create a cache entry. - // Node "/a/b/c" will be created if it does not yet exist. - = - - - You should see in the GUI that a new entry of /a/b/c= has been created. Click on the node c to see the content. You can modify t= he contents from the GUI as well. To create another node, for example, you = can type in the shell: = - -tree.put("/a/b/c/d", "JBoss", "Open Source"); - tree.get("/a/b/c/d", "JBoss"); - = - - - - PojoCache - - Once you are in the shell, type sourceRelative("aop.bsh"); to execute the shell script. Basically, aop.bsh illustrates the step= s to instantiate a cache, configure it, and then create entries under it. H= ere are the snippets: = - -import org.jboss.cache.PropertyConfigurator; - import org.jboss.cache.aop.PojoCache; - import org.jboss.cache.aop.test.Person; - import org.jboss.cache.aop.test.Address; - show(); // verbose mode for bean shell - PojoCache tree =3D new PojoCache(); - PropertyConfigurator config =3D new PropertyConfigurator(); // co= nfigure tree cache. - config.configure(tree, "META-INF/replSync-service.xml"); - Person joe =3D new Person(); // instantiate a Person object named= joe - joe.setName("Joe Black"); - joe.setAge(31); - Address addr =3D new Address(); // instantiate a Address object n= amed addr - addr.setCity("Sunnyvale"); - addr.setStreet("123 Albert Ave"); - addr.setZip(94086); joe.setAddress(addr); // set the address refe= rence - tree.startService(); // kick start tree cache - tree.putObject("/aop/joe", joe); = - // add aop sanctioned object (and sub-objects) into cache. - // since it is aop-sanctioned, use of plain get/set methods will = take care - // of cache contents automatically. - joe.setAge(41); - = - - - Note the API needed to put the object (and its dependent ones) into cac= he is putObject. Once the second window finishes execution, you should see = the first GUI window has been populated with entries of /aop/joe/address. C= lick on each tree node will display different values associated with that n= ode. = - - - Next step to see AOP in action, you can do plain get/set methods withou= t ever worrying about put it in the cache. For example, you can do in the s= hell window joe.setAge(20); and see that GUI gets updated with the age fiel= d automatically (if not, click away and back will refresh the GUI content).= Also to demonstrate the object graph replication, you can modify Joe's= address and see the cache will update it automatically. For example, type = addr.setCity("San Jose"); in the interactive shell, you should see in the G= UI that the address got modified. = - - - Finally, PojoCache also supports get/set with parameter type of Collect= ion classes (i.e., List, Map, and Set). For example, type the following in = the shell command line: = - -ArrayList lang =3D new ArrayList(); - lang.add("Ensligh"); - lang.add("Mandarin"); - joe.setLanguages(lang); - = - - - - PojoCache with Transaction - - To see TreeCache transaction at work, you start with the same setup wit= h last section except you load the bsh of aopWithTx.bsh instead of aop.bsh.= The additional snippets are: = - -import org.jboss.cache.PropertyConfigurator; - import org.jboss.cache.aop.PojoCache; - import org.jboss.cache.aop.test.Person; - import org.jboss.cache.aop.test.Address;// Tx imports - import javax.transaction.UserTransaction; import javax.naming.*; - import org.jboss.cache.transaction.DummyTransactionManager; - show(); // verbose mode for bean shell - // Set up transaction manager - DummyTransactionManager.getInstance(); - Properties prop =3D new Properties(); - prop.put(Context.INITIAL_CONTEXT_FACTORY, - "org.jboss.cache.transaction.DummyContextFactory"); - UserTransaction tx =3D (UserTransaction)new - InitialContext(prop).lookup("UserTransaction"); - PojoCache tree =3D new PojoCache(); - PropertyConfigurator config =3D new PropertyConfigurator(); = - // configure tree cache. - config.configure(tree, "META-INF/replSync-service.xml"); - joe =3D new Person(); - joe.setName("Joe Black"); - joe.setAge(31); - - Address addr =3D new Address(); - addr.setCity("Sunnyvale"); - addr.setStreet("123 Albert Ave"); - addr.setZip(94086); - joe.setAddress(addr); - - tree.startService(); // kick start tree cache - tree.putObject("/aop/joe", joe); // add aop sanctioned object - // since it is aop-sanctioned, use of plain get/set methods will = take care - of cache contents automatically. - // Also it is transacted - tx.begin(); - joe.setAge(41); - joe.getAddress().setZip(95124); - tx.commit(); - = - - - In this example, a default dummy transaction manager is used. - -tx.begin(); - addr.setZip(95131); - tx.rollback(); - = - - - - CacheLoader examples - - All the examples below are based on the JBossCache standalone distribut= ion. We assume the ZIP file has been unzipped into a directory jbo= ss-cache . = - -
- Local cache with CacheLoader - - This demo shows a local PojoCache with a CacheLoader. We will insert a= POJO into the cache, and see that the POJO is transparently saved using th= e CacheLoader. = - - - To run this, you have to modify jboss-cache/output/etc/META-I= NF/oodb-service.xml : change CacheLoaderConfig= to point to a valid directory (create it if it doesn't yet exist): = - -<attribute name=3D"CacheLoaderConfig"> - location=3Dc:\\tmp\\oodb - </attribute> - = - - - Then start the beanshell and source oodb.bsh into i= t. Note that oodb.bsh already contains code to create an= d retrieve POJO from the cache. So remember to comment them out if you deci= de to create the Person instance yourself. = - -bela(a)laptop /cygdrive/c/jboss-cache - $ ./runShellDemo.sh - BeanShell 1.3.0 - by Pat Niemeyer (pat(a)pat.net) - bsh % sourceRelative("oodb.bsh"); - interceptor chain is: - class org.jboss.cache.interceptors.CallInterceptor - class org.jboss.cache.interceptors.CacheLoaderInterceptor - class org.jboss.cache.interceptors.TransactionInterceptor - <null> - bsh % - = - - - Next, create an instance of Person, and set its address and other fiel= ds: = - -bsh % p=3Dnew Person(); - <name=3Dnull, age=3D0, hobbies=3D, address=3Dnull, skills= =3Dnull, languages=3Dnull> - bsh % p.age=3D3; - <3> - bsh % p.name=3D"Michelle"; - <Michelle> - bsh % addr=3Dnew Address(); - <street=3Dnull, city=3Dnull, zip=3D0> - bsh % addr.city=3D"San Jose"; - <San Jose> - bsh % addr.zip=3D95124; - <95124> - bsh % addr.street=3D"1704 Almond Blossom Lane"; - <1704 Almond Blossom Lane> - bsh % p.setAddress(addr); - bsh % tree.putObject("/person/me", p); - bsh % p; - <name=3DMichelle, age=3D3, hobbies=3D, address=3Dstreet=3D1= 704 Almond Blossom Lane, = - city=3DSan Jose, zip=3D95124, skills=3Dnull, languages=3Dnull> - bsh % - = - - - The Person object with all of its fields and subobj= ects is now saved. Let's kill beanshell and restart it. At this point, = because the instance of Person we created was given the = name "p", we can retrieve it again: = - -bela(a)laptop /cygdrive/c/jboss-cache - $ ./runShellDemo.sh - BeanShell 1.3.0 - by Pat Niemeyer (pat(a)pat.net) - bsh % sourceRelative("oodb.bsh"); - interceptor chain is: - class org.jboss.cache.interceptors.CallInterceptor - class org.jboss.cache.interceptors.CacheLoaderInterceptor - class org.jboss.cache.interceptors.TransactionInterceptor - <null> - bsh % tree; - </> - bsh % p=3Dtree.getObject("/person/me"); - <name=3DMichelle, age=3D3, hobbies=3D, address=3Dstreet=3D1= 704 Almond Blossom Lane, = - city=3DSan Jose, zip=3D95124, skills=3Dnull, languages=3Dnull> - bsh % tree; - </p - /address - > - bsh % - = - - - The interesting thing here is that the cache was initially empty ("/")= . Only when we loaded "p", did it get populated (lazy loading). You can see= that the values of "p" are loaded from the datastore where they were previ= ously saved. = - -
- = -
- - Replicated cache with shared datastore - - The scenario that we'll run in this example is described in the doc= umentation for JBossCache. It consists of 2 separate nodes that replicate t= heir contents between each other. In addition, they both point to the same datastore. The configuration is in file jboss= -cache/output/etc/META-INF/replAsyncSharedCacheLoader-service.xml= : = - -<!-- Whether or not to fetch state on joining a cluster= --> - <attribute name=3D"FetchStateOnStartup">false</attrib= ute> - <attribute name=3D"CacheLoaderClass">org.jboss.cache.loa= der.FileCacheLoader</attribute> - <attribute name=3D"CacheLoaderConfig"> - location=3Dc:\\tmp - </attribute> - <attribute name=3D"CacheLoaderShared">true</attribute= > - <attribute name=3D"CacheLoaderPreload">/</attribute&g= t; - <attribute name=3D"CacheLoaderFetchTransientState">false= </attribute> - <attribute name=3D"CacheLoaderFetchPersistentState">true= </attribute> - - - The FetchStateOnStartup attribute set to fa= lse means that a newly started cache will not attempt to fetch the state (neither transient nor persistent). Therefore,= attributes CacheLoaderFetchTransientState and = CacheLoaderFetchPersistentState will be ignored. CacheLo= aderShared set to true means that both nodes w= ill share the same datastore, which resides in c:\tmp in= the example (this assumes that both nodes have access to the same file sys= tem). Please make sure that c:\tmp exists, or point the = config string to a different existing directory. = - - - This configuration would essentially provide for two cold nodes, in the sense that all contents of a new cache is in the datast= ore, and is lazy-loaded via the CacheLoader when accessed. However, this is= not true, as CacheLoaderPreload points to "/", which is= the root of the entire tree. Therefore, all of the contents of the cache a= re recursively pre-loaded. This is probably a bad configuration when you ha= ve a lot of data in the cache, because all of your dat= a will be loaded into the cache. = - - - Note that with a shared datastore, the node that makes a modification i= s the one who writes it to the store using the CacheLoader. This prevents b= oth nodes from writing the same data twice. = - - - We can now start 2 instances by opening two shells and executing the fo= llowing ANT target: = - -bela(a)laptop /cygdrive/c/jboss-cache - $ ./build.sh run.demo.async.shared.cacheloader - Buildfile: build.xml - - init: - - compile: - - run.demo.async.shared.cacheloader: - [java] ** node loaded: /a - [java] ** node loaded: /a/b - [java] ** node loaded: /a/b/c - [java] ** node loaded: /uno - [java] ** node loaded: /uno/due - - [java] ------------------------------------------------------- - [java] GMS: address is 192.168.1.184:1357 - [java] ------------------------------------------------------- - [java] interceptor chain is: - [java] class org.jboss.cache.interceptors.CallInterceptor - [java] class org.jboss.cache.interceptors.ReplicationIntercept= or - [java] class org.jboss.cache.interceptors.CacheLoaderIntercept= or - [java] class org.jboss.cache.interceptors.TransactionIntercept= or - [java] ** view change: [192.168.1.184:1355|1] [192.168.1.184:1= 355, - 192.168.1.184:1357] - [java] ** node modified: / - = - - - 2 GUI instances will appear, showing the tree structure of the cache gr= aphically. Nodes can be added, modified or removed by right-clicking or usi= ng the menu. Any modification is replicated between the two nodes. If both = nodes are killed, and subsequently one or both nodes are restarted, the sta= te is the same as before shutdown as it was persisted to the shared store v= ia the CacheLoader. = - - - Note that the example above shows the 2 nodes running on the same machi= ne (192.168.1.184) on ports 1355 and 1357. = - - - - Replicated cache with unshared (local) datastore - - In this example, we'll run 2 nodes again, but this time, instead of= sharing the same datastore, each node has its own datastore. The configura= tion is in file jboss-cache/output/etc/META-INF/node{1,2}.xml . We'll look at node1.xml: = - -<attribute name=3D"CacheLoaderClass">org.jboss.cache= .loader.bdbje.BdbjeCacheLoader</attribute> - <attribute name=3D"CacheLoaderConfig"> - location=3Dc:\\tmp\\node1 - </attribute> - <attribute name=3D"CacheLoaderShared">false</attribut= e> - <attribute name=3D"CacheLoaderPreload">/</attribute&g= t; - <attribute name=3D"CacheLoaderFetchTransientState">false= </attribute> - <attribute name=3D"CacheLoaderFetchPersistentState">true= </attribute> - = - - - Again, we use the Sleepycat CacheLoader implementation in Cach= eLoaderClass . The CacheLoaderConfig points to= c:\tmp\node1 . This is the directory in which the Sleep= ycat DB for node1 will reside. File node2.xml has a configuration that poin= ts to c:\tmp\node2 , so we have 2 different unshared dat= astores. Note that, of course, we still have the same filesystem in our cas= e, because we run the 2 nodes on the same machine. In practice those two di= rectories would reside on two different machines, and each machine would ru= n one JBossCache process. Note that the 2 directories have to exis = - - - To create an unshared datastore, we set the CacheLoaderShared<= /literal> attribute to false . = - - - The example can be run by again opening 2 shells, and running 2 ANT tar= gets (here we show the target for node1): = - -bela(a)laptop /cygdrive/c/jboss-cache - $ ./build.sh run.demo.unshared.node2 - Buildfile: build.xml - - init: - - compile: - - run.demo.unshared.node2: - [java] ** node loaded: /a - [java] ** node loaded: /a/a2 - ... - = - - - The run.demo.unshared.node2 target runs node2, which= will have its own store located at c:\tmp\node2 (shown = above). Whenever a change is made on either of the 2 nodes, it is replicate= d to the other node, and persisted in both local datastores. You can kill a= nd restart a node, or even both nodes, and the data will still be available= due to the persistent backend store(s). = - - - - Troubleshooting - - Here are some tips for troubleshooting, if you encounter problems durin= g this demo. = - - - - - Most of the time, the problem will come from cache replication layer,= i.e., JGroups package. On the output window, you can see the JGroups membe= rship view. See if it is updated when you run the BSH commands. It should s= how a view with at least two members. For example, on my window, I see = - -[java] ** view change: [BWANG-HOME:4381|1] [BWANG-HOME:438= 1, BWANG-HOME:4383] - = - - - with 2 members: 4381 and 4383. On the other hand, if you don't cl= ose the previous running cache instance, the membership view will also incl= ude the previous existing ones. This can corrupt the states. So you will ha= ve to make sure there is no running TreeCache processes before each demo. I= f you have problem with this, please consult the JGroups website - - - - - - -
- Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cach= e_Tutorial_CP07.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP07.ent (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP07.ent 2009-11-19 04:14:21 UTC (rev 8297) @@ -0,0 +1,3 @@ + + + Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cach= e_Tutorial_CP07.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP07.xml (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/JBoss_Cache_T= utorial_CP07.xml 2009-11-19 04:14:21 UTC (rev 8297) @@ -0,0 +1,503 @@ + + + + + JBossCache Tutorial + + + Introduction + + JBossCache is an in-memory replicated (synchronous or asynchronous), tr= ansactional, and fine-grained cache. It consists of two subsystems: TreeCac= he (plain cache) and PojoCache (object-oriented POJO cache). In this tutori= al, we will demonstrate the usage of both cache features. For details of th= e usage and APIs, please refer to the user manuals for TreeCache and PojoCa= che. = + +
+ Scope + + + + Cache creation and modification + + + + + Replication + + + + + PojoCache + + + + + Transaction + + + +
+ = +
+ + Configuration + + First download the standalone TreeCache code from here. Unzip i= t, and you will get a root directory (jboss-cache in our example). = + + + The configuration files are located under the etc directory. You can mo= dify the behavior of TreeCache through editing the various configuration fi= les. = + + + + + log4j.xml. Logging output. You can turn on logging= level or change log file directory (default is /tmp/jbosscache.lo= g). = + + + + + replSync-service.xml. Tree cache configuration fil= e (file name is not fixed. You specify the file to be read in Prop= ertyConfigurator). The settings are for a replicated, synchronous= , and transactional cache. The default DummyTransactionManager is used with= a transaction isolation level of REPEATABLE_READ. For details of the confi= guration parameters, please refer to the Treecache. Note that this file is used i= n the BSH ( BeanShell, a l= ightweight Java compatible scripting language) script to configure the cach= e. = + + + + + jboss-aop.xml. AOP pointcut and advice definition = for the example POJO classes, Person and Address, respectively. For details= of how to put your own class under AOP, please refer to the PojoCache. This file= is read in when the process is started. = + + + + + + Script + + The script files that are needed (located under install directory) in t= his tutorial are: = + + + + + build.sh (or build.bat for DOS/= Windows). Simple build script that wraps around ant. Users can simply type = sh build.sh for help. Note from now on, we will only ref= er to the Unix version with the understanding that there is a corresponding= DOS counterpart. The same goes for runDemoShell explained next. = + + + + + runDemoShell.sh. Simple run script that wraps arou= nd BeanShell. This is used to operate the replicated cache through interact= ive command line. = + + + + + plain.bsh. Java code that instantiate and configur= e the cache. It also creates an example cache entry. = + + + + + aop.bsh. Java codes that instantiate and configure= the aop cache. In addition, it also sets up the example POJO (plain old Ja= va object) classes (e.g., Person and Address). = + + + + + aopWithTx.bsh. Same with aop.bsh except it also in= stantiates a transaction context. = + + + + + + Example POJO + + The example POJO classes used for PojoCache demo are: Person and Address. They are located under te= sts/org/jboss/cache/aop directory. Person has = attributes of String age, Address addr, List languages = , etc. We will demonstrate that once you put the POJO instance in the cache= , plain get/set POJO methods will be intercepted by the cache. = + + + Here is the snippet of the class definition for Person and Address . = + +public class Person { + String name=3Dnull; + int age=3D0; + Map hobbies=3Dnull; + Address address=3Dnull; + Set skills; + List languages; + + public String getName() { return name; } + public void setName(String name) { this.name=3Dname; } + ... + } + = + +public class Address { + String street=3Dnull; + String city=3Dnull; + int zip=3D0; + + public String getStreet() { return street; } + public void setStreet(String street) { this.street=3Dstreet; } + ... + } + = + + + + Demo + + To run the demo, you will need at least two windows: one to peruse the = cache contents (plus non-aop operations) and the other to operate the cache= directly. Of course, you can also open more than one GUI window to see the= cache replication at work to multiple members. You will also need to run t= he scripts under jboss-cache installation directory after you unzip the rel= ease package (jboss-cache-dist.zip). Due to the limitation of the GUI, plea= se note that: = + + + + + For each demo example, it'd be best if you re-start the whole set= up. + + + + + While you can modify the cache content on the GUI window and it will = show up on the BSH cache content (e.g., through cache.printDetails= () ), this won't work on PojoCache demo. That is, you can onl= y modify the cache content on the BSH window. + + + + + The two demo programs to run are: + + + + + On the first window for the GUI, type sh build.sh = to see the available commands. To run the GUI, type sh build.sh r= un.demo . It will startup a PojoCache GUI. Later on, you can clic= k on a node to view the the contents. Note that you can also add/modify the= node contents for non-AOP cache entries. Since the GUI entry only accepts = String for now, operation on aop cache from the GUI will not always work (u= nless it is a String type). = + + + + + On the second window for the interactive Java commands, type sh runSh= ellDemo.sh to fire off the BeanShell interactive command shell (you can use= either ^D or ^Z in Windows and Unix to exit afterward). You can then read = in the Java code scripts to showcase the cache capabilities (e.g., plain.bs= h, aop.bsh, and aopWithTx.bsh). See the following for details. = + + + + + + Plain cache + + Once you are in the shell, you can either execute the script to populat= e the cache, or type it in manually by command line. To run the script, typ= e sourceRelative("plain.bsh"); under the interactive BSH= shell. For this to work, you'll need to have your working directory se= t to the directory in which plain.bsh resides (otherwise give the full path= name of plain.bsh). Basically, the script will create cache entries that wi= ll be replicated onto the GUI. (You may have to type show() into the result= ing beanshell window yourself) Here are the snippets for the script: = + +import org.jboss.cache.*; + show(); // verbose mode for bean shell + TreeCache tree =3D new TreeCache(); + PropertyConfigurator config =3D new PropertyConfigurator(); = + // configure tree cache. Needs to be in the classpath + config.configure(tree, "META-INF/replSync-service.xml"); + tree.startService(); = + // kick start tree cache + tree.put("/a/b/c", "ben", "me"); = + // create a cache entry. + // Node "/a/b/c" will be created if it does not yet exist. + = + + + You should see in the GUI that a new entry of /a/b/c= has been created. Click on the node c to see the content. You can modify t= he contents from the GUI as well. To create another node, for example, you = can type in the shell: = + +tree.put("/a/b/c/d", "JBoss", "Open Source"); + tree.get("/a/b/c/d", "JBoss"); + = + + + + PojoCache + + Once you are in the shell, type sourceRelative("aop.bsh"); to execute the shell script. Basically, aop.bsh illustrates the step= s to instantiate a cache, configure it, and then create entries under it. H= ere are the snippets: = + +import org.jboss.cache.PropertyConfigurator; + import org.jboss.cache.aop.PojoCache; + import org.jboss.cache.aop.test.Person; + import org.jboss.cache.aop.test.Address; + show(); // verbose mode for bean shell + PojoCache tree =3D new PojoCache(); + PropertyConfigurator config =3D new PropertyConfigurator(); // co= nfigure tree cache. + config.configure(tree, "META-INF/replSync-service.xml"); + Person joe =3D new Person(); // instantiate a Person object named= joe + joe.setName("Joe Black"); + joe.setAge(31); + Address addr =3D new Address(); // instantiate a Address object n= amed addr + addr.setCity("Sunnyvale"); + addr.setStreet("123 Albert Ave"); + addr.setZip(94086); joe.setAddress(addr); // set the address refe= rence + tree.startService(); // kick start tree cache + tree.putObject("/aop/joe", joe); = + // add aop sanctioned object (and sub-objects) into cache. + // since it is aop-sanctioned, use of plain get/set methods will = take care + // of cache contents automatically. + joe.setAge(41); + = + + + Note the API needed to put the object (and its dependent ones) into cac= he is putObject. Once the second window finishes execution, you should see = the first GUI window has been populated with entries of /aop/joe/address. C= lick on each tree node will display different values associated with that n= ode. = + + + Next step to see AOP in action, you can do plain get/set methods withou= t ever worrying about put it in the cache. For example, you can do in the s= hell window joe.setAge(20); and see that GUI gets updated with the age fiel= d automatically (if not, click away and back will refresh the GUI content).= Also to demonstrate the object graph replication, you can modify Joe's= address and see the cache will update it automatically. For example, type = addr.setCity("San Jose"); in the interactive shell, you should see in the G= UI that the address got modified. = + + + Finally, PojoCache also supports get/set with parameter type of Collect= ion classes (i.e., List, Map, and Set). For example, type the following in = the shell command line: = + +ArrayList lang =3D new ArrayList(); + lang.add("Ensligh"); + lang.add("Mandarin"); + joe.setLanguages(lang); + = + + + + PojoCache with Transaction + + To see TreeCache transaction at work, you start with the same setup wit= h last section except you load the bsh of aopWithTx.bsh instead of aop.bsh.= The additional snippets are: = + +import org.jboss.cache.PropertyConfigurator; + import org.jboss.cache.aop.PojoCache; + import org.jboss.cache.aop.test.Person; + import org.jboss.cache.aop.test.Address;// Tx imports + import javax.transaction.UserTransaction; import javax.naming.*; + import org.jboss.cache.transaction.DummyTransactionManager; + show(); // verbose mode for bean shell + // Set up transaction manager + DummyTransactionManager.getInstance(); + Properties prop =3D new Properties(); + prop.put(Context.INITIAL_CONTEXT_FACTORY, + "org.jboss.cache.transaction.DummyContextFactory"); + UserTransaction tx =3D (UserTransaction)new + InitialContext(prop).lookup("UserTransaction"); + PojoCache tree =3D new PojoCache(); + PropertyConfigurator config =3D new PropertyConfigurator(); = + // configure tree cache. + config.configure(tree, "META-INF/replSync-service.xml"); + joe =3D new Person(); + joe.setName("Joe Black"); + joe.setAge(31); + + Address addr =3D new Address(); + addr.setCity("Sunnyvale"); + addr.setStreet("123 Albert Ave"); + addr.setZip(94086); + joe.setAddress(addr); + + tree.startService(); // kick start tree cache + tree.putObject("/aop/joe", joe); // add aop sanctioned object + // since it is aop-sanctioned, use of plain get/set methods will = take care + of cache contents automatically. + // Also it is transacted + tx.begin(); + joe.setAge(41); + joe.getAddress().setZip(95124); + tx.commit(); + = + + + In this example, a default dummy transaction manager is used. + +tx.begin(); + addr.setZip(95131); + tx.rollback(); + = + + + + CacheLoader examples + + All the examples below are based on the JBossCache standalone distribut= ion. We assume the ZIP file has been unzipped into a directory jbo= ss-cache . = + +
+ Local cache with CacheLoader + + This demo shows a local PojoCache with a CacheLoader. We will insert a= POJO into the cache, and see that the POJO is transparently saved using th= e CacheLoader. = + + + To run this, you have to modify jboss-cache/output/etc/META-I= NF/oodb-service.xml : change CacheLoaderConfig= to point to a valid directory (create it if it doesn't yet exist): = + +<attribute name=3D"CacheLoaderConfig"> + location=3Dc:\\tmp\\oodb + </attribute> + = + + + Then start the beanshell and source oodb.bsh into i= t. Note that oodb.bsh already contains code to create an= d retrieve POJO from the cache. So remember to comment them out if you deci= de to create the Person instance yourself. = + +bela(a)laptop /cygdrive/c/jboss-cache + $ ./runShellDemo.sh + BeanShell 1.3.0 - by Pat Niemeyer (pat(a)pat.net) + bsh % sourceRelative("oodb.bsh"); + interceptor chain is: + class org.jboss.cache.interceptors.CallInterceptor + class org.jboss.cache.interceptors.CacheLoaderInterceptor + class org.jboss.cache.interceptors.TransactionInterceptor + <null> + bsh % + = + + + Next, create an instance of Person, and set its address and other fiel= ds: = + +bsh % p=3Dnew Person(); + <name=3Dnull, age=3D0, hobbies=3D, address=3Dnull, skills= =3Dnull, languages=3Dnull> + bsh % p.age=3D3; + <3> + bsh % p.name=3D"Michelle"; + <Michelle> + bsh % addr=3Dnew Address(); + <street=3Dnull, city=3Dnull, zip=3D0> + bsh % addr.city=3D"San Jose"; + <San Jose> + bsh % addr.zip=3D95124; + <95124> + bsh % addr.street=3D"1704 Almond Blossom Lane"; + <1704 Almond Blossom Lane> + bsh % p.setAddress(addr); + bsh % tree.putObject("/person/me", p); + bsh % p; + <name=3DMichelle, age=3D3, hobbies=3D, address=3Dstreet=3D1= 704 Almond Blossom Lane, = + city=3DSan Jose, zip=3D95124, skills=3Dnull, languages=3Dnull> + bsh % + = + + + The Person object with all of its fields and subobj= ects is now saved. Let's kill beanshell and restart it. At this point, = because the instance of Person we created was given the = name "p", we can retrieve it again: = + +bela(a)laptop /cygdrive/c/jboss-cache + $ ./runShellDemo.sh + BeanShell 1.3.0 - by Pat Niemeyer (pat(a)pat.net) + bsh % sourceRelative("oodb.bsh"); + interceptor chain is: + class org.jboss.cache.interceptors.CallInterceptor + class org.jboss.cache.interceptors.CacheLoaderInterceptor + class org.jboss.cache.interceptors.TransactionInterceptor + <null> + bsh % tree; + </> + bsh % p=3Dtree.getObject("/person/me"); + <name=3DMichelle, age=3D3, hobbies=3D, address=3Dstreet=3D1= 704 Almond Blossom Lane, = + city=3DSan Jose, zip=3D95124, skills=3Dnull, languages=3Dnull> + bsh % tree; + </p + /address + > + bsh % + = + + + The interesting thing here is that the cache was initially empty ("/")= . Only when we loaded "p", did it get populated (lazy loading). You can see= that the values of "p" are loaded from the datastore where they were previ= ously saved. = + +
+ = +
+ + Replicated cache with shared datastore + + The scenario that we'll run in this example is described in the doc= umentation for JBossCache. It consists of 2 separate nodes that replicate t= heir contents between each other. In addition, they both point to the same datastore. The configuration is in file jboss= -cache/output/etc/META-INF/replAsyncSharedCacheLoader-service.xml= : = + +<!-- Whether or not to fetch state on joining a cluster= --> + <attribute name=3D"FetchStateOnStartup">false</attrib= ute> + <attribute name=3D"CacheLoaderClass">org.jboss.cache.loa= der.FileCacheLoader</attribute> + <attribute name=3D"CacheLoaderConfig"> + location=3Dc:\\tmp + </attribute> + <attribute name=3D"CacheLoaderShared">true</attribute= > + <attribute name=3D"CacheLoaderPreload">/</attribute&g= t; + <attribute name=3D"CacheLoaderFetchTransientState">false= </attribute> + <attribute name=3D"CacheLoaderFetchPersistentState">true= </attribute> + + + The FetchStateOnStartup attribute set to fa= lse means that a newly started cache will not attempt to fetch the state (neither transient nor persistent). Therefore,= attributes CacheLoaderFetchTransientState and = CacheLoaderFetchPersistentState will be ignored. CacheLo= aderShared set to true means that both nodes w= ill share the same datastore, which resides in c:\tmp in= the example (this assumes that both nodes have access to the same file sys= tem). Please make sure that c:\tmp exists, or point the = config string to a different existing directory. = + + + This configuration would essentially provide for two cold nodes, in the sense that all contents of a new cache is in the datast= ore, and is lazy-loaded via the CacheLoader when accessed. However, this is= not true, as CacheLoaderPreload points to "/", which is= the root of the entire tree. Therefore, all of the contents of the cache a= re recursively pre-loaded. This is probably a bad configuration when you ha= ve a lot of data in the cache, because all of your dat= a will be loaded into the cache. = + + + Note that with a shared datastore, the node that makes a modification i= s the one who writes it to the store using the CacheLoader. This prevents b= oth nodes from writing the same data twice. = + + + We can now start 2 instances by opening two shells and executing the fo= llowing ANT target: = + +bela(a)laptop /cygdrive/c/jboss-cache + $ ./build.sh run.demo.async.shared.cacheloader + Buildfile: build.xml + + init: + + compile: + + run.demo.async.shared.cacheloader: + [java] ** node loaded: /a + [java] ** node loaded: /a/b + [java] ** node loaded: /a/b/c + [java] ** node loaded: /uno + [java] ** node loaded: /uno/due + + [java] ------------------------------------------------------- + [java] GMS: address is 192.168.1.184:1357 + [java] ------------------------------------------------------- + [java] interceptor chain is: + [java] class org.jboss.cache.interceptors.CallInterceptor + [java] class org.jboss.cache.interceptors.ReplicationIntercept= or + [java] class org.jboss.cache.interceptors.CacheLoaderIntercept= or + [java] class org.jboss.cache.interceptors.TransactionIntercept= or + [java] ** view change: [192.168.1.184:1355|1] [192.168.1.184:1= 355, + 192.168.1.184:1357] + [java] ** node modified: / + = + + + 2 GUI instances will appear, showing the tree structure of the cache gr= aphically. Nodes can be added, modified or removed by right-clicking or usi= ng the menu. Any modification is replicated between the two nodes. If both = nodes are killed, and subsequently one or both nodes are restarted, the sta= te is the same as before shutdown as it was persisted to the shared store v= ia the CacheLoader. = + + + Note that the example above shows the 2 nodes running on the same machi= ne (192.168.1.184) on ports 1355 and 1357. = + + + + Replicated cache with unshared (local) datastore + + In this example, we'll run 2 nodes again, but this time, instead of= sharing the same datastore, each node has its own datastore. The configura= tion is in file jboss-cache/output/etc/META-INF/node{1,2}.xml . We'll look at node1.xml: = + +<attribute name=3D"CacheLoaderClass">org.jboss.cache= .loader.bdbje.BdbjeCacheLoader</attribute> + <attribute name=3D"CacheLoaderConfig"> + location=3Dc:\\tmp\\node1 + </attribute> + <attribute name=3D"CacheLoaderShared">false</attribut= e> + <attribute name=3D"CacheLoaderPreload">/</attribute&g= t; + <attribute name=3D"CacheLoaderFetchTransientState">false= </attribute> + <attribute name=3D"CacheLoaderFetchPersistentState">true= </attribute> + = + + + Again, we use the Sleepycat CacheLoader implementation in Cach= eLoaderClass . The CacheLoaderConfig points to= c:\tmp\node1 . This is the directory in which the Sleep= ycat DB for node1 will reside. File node2.xml has a configuration that poin= ts to c:\tmp\node2 , so we have 2 different unshared dat= astores. Note that, of course, we still have the same filesystem in our cas= e, because we run the 2 nodes on the same machine. In practice those two di= rectories would reside on two different machines, and each machine would ru= n one JBossCache process. Note that the 2 directories have to exis = + + + To create an unshared datastore, we set the CacheLoaderShared<= /literal> attribute to false . = + + + The example can be run by again opening 2 shells, and running 2 ANT tar= gets (here we show the target for node1): = + +bela(a)laptop /cygdrive/c/jboss-cache + $ ./build.sh run.demo.unshared.node2 + Buildfile: build.xml + + init: + + compile: + + run.demo.unshared.node2: + [java] ** node loaded: /a + [java] ** node loaded: /a/a2 + ... + = + + + The run.demo.unshared.node2 target runs node2, which= will have its own store located at c:\tmp\node2 (shown = above). Whenever a change is made on either of the 2 nodes, it is replicate= d to the other node, and persisted in both local datastores. You can kill a= nd restart a node, or even both nodes, and the data will still be available= due to the persistent backend store(s). = + + + + Troubleshooting + + Here are some tips for troubleshooting, if you encounter problems durin= g this demo. = + + + + + Most of the time, the problem will come from cache replication layer,= i.e., JGroups package. On the output window, you can see the JGroups membe= rship view. See if it is updated when you run the BSH commands. It should s= how a view with at least two members. For example, on my window, I see = + +[java] ** view change: [BWANG-HOME:4381|1] [BWANG-HOME:438= 1, BWANG-HOME:4383] + = + + + with 2 members: 4381 and 4383. On the other hand, if you don't cl= ose the previous running cache instance, the membership view will also incl= ude the previous existing ones. This can corrupt the states. So you will ha= ve to make sure there is no running TreeCache processes before each demo. I= f you have problem with this, please consult the JGroups website + + + + + + +
+ Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/Revisio= n_History.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/Revision_Hist= ory.xml 2009-11-19 04:12:11 UTC (rev 8296) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/en-US/Revision_Hist= ory.xml 2009-11-19 04:14:21 UTC (rev 8297) @@ -8,15 +8,15 @@ 1.0 - + thu Nov 19 2009 - - - + Laura + Bailey + lbailey(a)redhat.com - + Initial draft. --===============3646015184725443604==-- From jbosscache-commits at lists.jboss.org Thu Nov 19 03:14:15 2009 Content-Type: multipart/mixed; boundary="===============2485380960517827544==" MIME-Version: 1.0 From: VIAGRA Store (c tm) To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] Personal 75% OFF to jbosscache-commits@lists.jboss.org. Pfizer. Date: Thu, 19 Nov 2009 03:14:14 -0500 Message-ID: <200911190814.nAJ8EELk020879@lists01.dmz-a.mwc.hst.phx2.redhat.com> --===============2485380960517827544== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable --===============2485380960517827544== Content-Type: text/html MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFs Ly9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L2xvb3NlLmR0ZCI+CjxodG1sPgo8aGVh ZD4KPG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNo YXJzZXQ9dXRmLTgiPgo8dGl0bGU+V2VibGV0dGVyPC90aXRsZT4KPC9oZWFkPgoKPGJvZHk+Cgo8 dGFibGUgd2lkdGg9IjEwMCUiIGJvcmRlcj0iMCIgY2VsbHNwYWNpbmc9IjAiIGNlbGxwYWRkaW5n PSIwIj4KICA8dHI+CiAgICA8dGQgYWxpZ249ImNlbnRlciIgdmFsaWduPSJ0b3AiIGJnY29sb3I9 IiM2NjY2NjYiPjx0YWJsZSB3aWR0aD0iNzAwIiBib3JkZXI9IjAiIGNlbGxwYWRkaW5nPSIwIiBj ZWxsc3BhY2luZz0iMCI+CiAgICA8dHI+PHRkIGFsaWduPSJjZW50ZXIiIGJnY29sb3I9IiNGRkZG RkYiPgogICAgPGZvbnQgY29sb3I9IiMwMDAwMDAiIHNpemU9IjEiIGZhY2U9IkFyaWFsLCBIZWx2 ZXRpY2EsIHNhbnMtc2VyaWYiPgogICAgIEhhdmluZyB0cm91YmxlIHZpZXdpbmcgaW1hZ2VzPyA8 YSBocmVmPSJodHRwOi8vNzAyNDc0MzguY2V6ZXNoay5jbi8iPkNsaWNrIGhlcmU8L2E+IHRvIHZp ZXcgYXMgYSB3ZWJwYWdlLjxicj4KCQk8L2ZvbnQ+CiAgICA8L3RkPgogICAJPC90cj4KICAgIDx0 ciBiZ2NvbG9yPSIjRkZGRkZGIj48dGQgYWxpZ249ImNlbnRlciIgdmFsaWduPSJ0b3AiIGJnY29s b3I9IiNGRkZGRkYiPgoKICAgIDx0YWJsZSBib3JkZXI9IjAiIGNlbGxzcGFjaW5nPSIwIiBjZWxs cGFkZGluZz0iMCI+CiAgICA8dHI+PHRkIGJnY29sb3I9IiM5OTk5OTkiPiZuYnNwOzwvdGQ+CiAg ICA8L3RyPgogICAgICA8dHI+CiAgICAgICAgPHRkIHdpZHRoPSIyNDIiIGFsaWduPSJyaWdodCIg dmFsaWduPSJtaWRkbGUiPjxmb250IGZhY2U9IkFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWYi ICBzdHlsZT0iZm9udC1zaXplOjExcHg7IiBjb2xvcj0iIzAwMDAwMCI+PHN0cm9uZz4KCQlWb2x1 bWUgMTEsIElzc3VlIDxmb250IGZhY2U9IkFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWYiICBz dHlsZT0iZm9udC1zaXplOjExcHg7IiBjb2xvcj0iIzAwMDAwMCI+CgkJNjU8L2ZvbnQ+IHwgPC9z dHJvbmc+PGZvbnQgY29sb3I9IiMwMDY5QjciPjxzdHJvbmc+CgkJTm92ZW1iZXIgMTgsIDIwMDk8 L3N0cm9uZz48L2ZvbnQ+PC9mb250PjwvdGQ+CiAgICAgIDwvdHI+CiAgICAgICAgICAgICAgPHRy PgogICAgICAgICAgICAgICAgPHRkIGFsaWduPSJjZW50ZXIiPjxicj48YSBocmVmPSJodHRwOi8v Mzc1ZWFjLmNlemVzaGsuY24vIj4KCQkJCTxpbWcgYWx0PSJUcnkgdGhpcyBsaW5rLCBpZiB0aGlz IHBpY3R1cmUncyB1bmF2YWlsYWJsZSIgaGVpZ2h0PSIzMjAiIHNyYz0iaHR0cDovL2EzM2U0N2Zj LmNlemVzaGsuY24vZTY5ZGY5MWZjLmdpZiIgc3R5bGU9ImJvcmRlci13aWR0aDogMHB4IiB3aWR0 aD0iNTQwIj4KCQkJCTwvYT48L3RkPgogICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgIDwv dGFibGU+Cgk8dGFibGUgYm9yZGVyPSIwIiBjZWxsc3BhY2luZz0iMCIgY2VsbHBhZGRpbmc9IjEy Ij4KICAgICAgPHRyPgogICAgICAgIDx0ZCBhbGlnbj0ibGVmdCIgdmFsaWduPSJ0b3AiPjxmb250 IGZhY2U9IkFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWYiICAgc3R5bGU9ImZvbnQtc2l6ZTox MnB4OyIgY29sb3I9IiMwMDAwMDAiPgo8c3Ryb25nPk1hbmFnZSBNeSBFJiM4MjExO21haWwgU3Vi c2NyaXB0aW9uczwvc3Ryb25nPgo8YnI+Cjxicj4KCQlJZiB5b3Ugd291bGQgbGlrZSB0byBjYW5j ZWwgeW91ciBzdWJzY3JpcHRpb24sIHBsZWFzZSA8YSBocmVmPSJodHRwOi8vMWNlZDZiZS5jZXpl c2hrLmNuLyI+Y2xpY2sgaGVyZTwvYT4uPGJyPgpJZiB5b3Ugd291bGQgcHJlZmVyIHRvIHN0b3Ag cmVjZWl2aW5nIDxzdHJvbmc+YWxsIGUmIzgyMTE7bWFpbDwvc3Ryb25nPiBmcm9tIHVzLCAgcGxl YXNlIDxhIGhyZWY9Imh0dHA6Ly9jZGJjMDUzZDQ1LmNlemVzaGsuY24vIj5jbGljayBoZXJlPC9h Pi48YnI+Cjxicj4KCQk8c3Ryb25nPlByaXZhY3kgU3RhdGVtZW50PC9zdHJvbmc+PGJyPgoJCVNl ZSBvdXIgPGEgaHJlZj0iaHR0cDovLzVmM2I4ZDYuY2V6ZXNoay5jbi8iPnByaXZhY3kgcG9saWN5 PC9hPiBmb3IgYWRkaXRpb25hbCBpbmZvcm1hdGlvbi4KCQk8YnI+Cjxicj4KPC9mb250PjxjZW50 ZXI+CiAgPGZvbnQgY29sb3I9IiMwMDAwMDAiIGZhY2U9IlRyZWJ1Y2hldCBNUywgVmVyZGFuYSIg c3R5bGU9ImZvbnQtc2l6ZToxMnB4OyI+CgkJWXN5eG9nZXkgPGEgaHJlZj0iaHR0cDovL2JhZmI1 LmNlemVzaGsuY24vIj4mY29weTsxOTk4LTIwMDk8L2E+LCBBbGwgcmlnaHRzIHJlc2VydmVkLiA8 L2ZvbnQ+CjwvY2VudGVyPgogICAgICAgIDwvdGQ+CiAgICAgIDwvdHI+CiAgICA8L3RhYmxlPgoK CgoJCTwvdGQ+CiAgICA8L3RyPgogICAgPC90YWJsZT4KCiAgICA8L3RkPgogIDwvdHI+CjwvdGFi bGU+CjwvYm9keT4KPC9odG1sPgo= --===============2485380960517827544==-- From jbosscache-commits at lists.jboss.org Thu Nov 19 07:35:26 2009 Content-Type: multipart/mixed; boundary="===============4468053201075837854==" MIME-Version: 1.0 From: Arnold To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] User jbosscache-commits Date: Thu, 19 Nov 2009 07:35:25 -0500 Message-ID: <200911191235.nAJCZNsZ013946@lists01.dmz-a.mwc.hst.phx2.redhat.com> --===============4468053201075837854== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Cooking tip http://volny.cz/nokia7110/hot.html --===============4468053201075837854==-- From jbosscache-commits at lists.jboss.org Fri Nov 20 02:23:08 2009 Content-Type: multipart/mixed; boundary="===============1433906561505927924==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8298 - enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/images. Date: Fri, 20 Nov 2009 02:23:08 -0500 Message-ID: <200911200723.nAK7N8Aq028370@svn01.web.mwc.hst.phx2.redhat.com> --===============1433906561505927924== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-20 02:23:07 -0500 (Fri, 20 Nov 2009) New Revision: 8298 Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US/images= /EvictionUML.png Log: Adding changes for CP07. Modified: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/en-US= /images/EvictionUML.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) --===============1433906561505927924==-- From jbosscache-commits at lists.jboss.org Sun Nov 22 22:21:58 2009 Content-Type: multipart/mixed; boundary="===============2937211557014893344==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8299 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US. Date: Sun, 22 Nov 2009 22:21:58 -0500 Message-ID: <200911230321.nAN3LwUJ015282@svn01.web.mwc.hst.phx2.redhat.com> --===============2937211557014893344== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-22 22:21:58 -0500 (Sun, 22 Nov 2009) New Revision: 8299 Removed: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss_= Cache_Tree_Cache_Guide_CP08.ent Log: Adding changes for CP08. Deleted: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/= JBoss_Cache_Tree_Cache_Guide_CP08.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP08.ent 2009-11-20 07:23:07 UTC (rev 8298) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP08.ent 2009-11-23 03:21:58 UTC (rev 8299) @@ -1,3 +0,0 @@ - - - --===============2937211557014893344==-- From jbosscache-commits at lists.jboss.org Sun Nov 22 22:23:09 2009 Content-Type: multipart/mixed; boundary="===============8112453235914311399==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8300 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US. Date: Sun, 22 Nov 2009 22:23:09 -0500 Message-ID: <200911230323.nAN3N9e7015409@svn01.web.mwc.hst.phx2.redhat.com> --===============8112453235914311399== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-22 22:23:09 -0500 (Sun, 22 Nov 2009) New Revision: 8300 Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss_= Cache_Tree_Cache_Guide_CP08.ent Log: Adding changes for CP08. Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JB= oss_Cache_Tree_Cache_Guide_CP08.ent =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP08.ent (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/en-US/JBoss= _Cache_Tree_Cache_Guide_CP08.ent 2009-11-23 03:23:09 UTC (rev 8300) @@ -0,0 +1,3 @@ + + + --===============8112453235914311399==-- From jbosscache-commits at lists.jboss.org Sun Nov 22 22:40:04 2009 Content-Type: multipart/mixed; boundary="===============1606792279746862126==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8301 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ. Date: Sun, 22 Nov 2009 22:40:02 -0500 Message-ID: <200911230340.nAN3e2iU018088@svn01.web.mwc.hst.phx2.redhat.com> --===============1606792279746862126== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-22 22:40:01 -0500 (Sun, 22 Nov 2009) New Revision: 8301 Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/publican.cfg Log: Adding new publican config file. Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/publican.cfg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/publican.cfg = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_FAQ/publican.cfg 2009-11-23 = 03:40:01 UTC (rev 8301) @@ -0,0 +1,7 @@ +# Config::Simple 4.59 +# Mon Nov 23 13:36:03 2009 + +debug: 1 +xml_lang: en-US +brand: JBoss + --===============1606792279746862126==-- From jbosscache-commits at lists.jboss.org Sun Nov 22 22:40:36 2009 Content-Type: multipart/mixed; boundary="===============0617819051653015374==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8302 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide. Date: Sun, 22 Nov 2009 22:40:36 -0500 Message-ID: <200911230340.nAN3eaP1018428@svn01.web.mwc.hst.phx2.redhat.com> --===============0617819051653015374== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-22 22:40:36 -0500 (Sun, 22 Nov 2009) New Revision: 8302 Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/publican.cfg Log: Adding new publican config file. Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/publican= .cfg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/publican.cf= g (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Pojo_Cache_Guide/publican.cf= g 2009-11-23 03:40:36 UTC (rev 8302) @@ -0,0 +1,7 @@ +# Config::Simple 4.59 +# Mon Nov 23 13:38:26 2009 + +debug: 1 +xml_lang: en-US +brand: JBoss + --===============0617819051653015374==-- From jbosscache-commits at lists.jboss.org Sun Nov 22 22:43:15 2009 Content-Type: multipart/mixed; boundary="===============1327497212422076951==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8303 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide. Date: Sun, 22 Nov 2009 22:43:15 -0500 Message-ID: <200911230343.nAN3hF23019330@svn01.web.mwc.hst.phx2.redhat.com> --===============1327497212422076951== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-22 22:43:15 -0500 (Sun, 22 Nov 2009) New Revision: 8303 Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/publican.cfg Log: Adding new publican config file. Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/publican= .cfg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/publican.cf= g (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tree_Cache_Guide/publican.cf= g 2009-11-23 03:43:15 UTC (rev 8303) @@ -0,0 +1,7 @@ +# Config::Simple 4.59 +# Mon Nov 23 13:41:11 2009 + +debug: 1 +xml_lang: en-US +brand: JBoss + --===============1327497212422076951==-- From jbosscache-commits at lists.jboss.org Sun Nov 22 22:45:14 2009 Content-Type: multipart/mixed; boundary="===============3547736101711908508==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8304 - enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial. Date: Sun, 22 Nov 2009 22:45:14 -0500 Message-ID: <200911230345.nAN3jEKp019717@svn01.web.mwc.hst.phx2.redhat.com> --===============3547736101711908508== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-22 22:45:14 -0500 (Sun, 22 Nov 2009) New Revision: 8304 Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/publican.cfg Log: Adding new publican config file. Added: enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/publican.cfg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/publican.cfg = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_2_8/Cache_Tutorial/publican.cfg 2009-1= 1-23 03:45:14 UTC (rev 8304) @@ -0,0 +1,7 @@ +# Config::Simple 4.59 +# Mon Nov 23 13:43:08 2009 + +debug: 1 +xml_lang: en-US +brand: JBoss + --===============3547736101711908508==-- From jbosscache-commits at lists.jboss.org Sun Nov 22 23:43:57 2009 Content-Type: multipart/mixed; boundary="===============5881021683492995941==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8305 - enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ. Date: Sun, 22 Nov 2009 23:43:57 -0500 Message-ID: <200911230443.nAN4hv6D029735@svn01.web.mwc.hst.phx2.redhat.com> --===============5881021683492995941== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-22 23:43:57 -0500 (Sun, 22 Nov 2009) New Revision: 8305 Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/publican.cfg Log: Added new publican config file. Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/publican.cfg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/publican.cfg = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_FAQ/publican.cfg 2009-11-23 = 04:43:57 UTC (rev 8305) @@ -0,0 +1,7 @@ +# Config::Simple 4.59 +# Mon Nov 23 14:41:25 2009 + +debug: 1 +xml_lang: en-US +brand: JBoss + --===============5881021683492995941==-- From jbosscache-commits at lists.jboss.org Sun Nov 22 23:44:56 2009 Content-Type: multipart/mixed; boundary="===============1638400473621760465==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8306 - enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide. Date: Sun, 22 Nov 2009 23:44:56 -0500 Message-ID: <200911230444.nAN4iu59029933@svn01.web.mwc.hst.phx2.redhat.com> --===============1638400473621760465== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-22 23:44:56 -0500 (Sun, 22 Nov 2009) New Revision: 8306 Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/publican.cfg Log: Added new publican config file. Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/publican= .cfg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/publican.cf= g (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Pojo_Cache_Guide/publican.cf= g 2009-11-23 04:44:56 UTC (rev 8306) @@ -0,0 +1,7 @@ +# Config::Simple 4.59 +# Mon Nov 23 14:42:51 2009 + +debug: 1 +xml_lang: en-US +brand: JBoss + --===============1638400473621760465==-- From jbosscache-commits at lists.jboss.org Sun Nov 22 23:48:54 2009 Content-Type: multipart/mixed; boundary="===============5363544739286567690==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8307 - enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide. Date: Sun, 22 Nov 2009 23:48:54 -0500 Message-ID: <200911230448.nAN4msJE030650@svn01.web.mwc.hst.phx2.redhat.com> --===============5363544739286567690== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-22 23:48:54 -0500 (Sun, 22 Nov 2009) New Revision: 8307 Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/publican.cfg Log: Adding new publican config file. Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/publican= .cfg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/publican.cf= g (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tree_Cache_Guide/publican.cf= g 2009-11-23 04:48:54 UTC (rev 8307) @@ -0,0 +1,7 @@ +# Config::Simple 4.59 +# Mon Nov 23 14:46:37 2009 + +debug: 1 +xml_lang: en-US +brand: JBoss + --===============5363544739286567690==-- From jbosscache-commits at lists.jboss.org Sun Nov 22 23:50:58 2009 Content-Type: multipart/mixed; boundary="===============4533405342300601911==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8308 - enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial. Date: Sun, 22 Nov 2009 23:50:57 -0500 Message-ID: <200911230450.nAN4ovEs031157@svn01.web.mwc.hst.phx2.redhat.com> --===============4533405342300601911== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-22 23:50:57 -0500 (Sun, 22 Nov 2009) New Revision: 8308 Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/publican.cfg Log: Adding new publican config file. Added: enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/publican.cfg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/publican.cfg = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_4_3_7/Cache_Tutorial/publican.cfg 2009-1= 1-23 04:50:57 UTC (rev 8308) @@ -0,0 +1,7 @@ +# Config::Simple 4.59 +# Mon Nov 23 14:48:53 2009 + +debug: 1 +xml_lang: en-US +brand: JBoss + --===============4533405342300601911==-- From jbosscache-commits at lists.jboss.org Wed Nov 25 00:26:11 2009 Content-Type: multipart/mixed; boundary="===============5342664269245562586==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8309 - enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_FAQ. Date: Wed, 25 Nov 2009 00:26:10 -0500 Message-ID: <200911250526.nAP5QAal030708@svn01.web.mwc.hst.phx2.redhat.com> --===============5342664269245562586== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-25 00:26:08 -0500 (Wed, 25 Nov 2009) New Revision: 8309 Added: enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_FAQ/publican.cfg Log: Adding new publican config file. Added: enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_FAQ/publican.cfg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_FAQ/publican.cfg = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_FAQ/publican.cfg 2009-11-25 = 05:26:08 UTC (rev 8309) @@ -0,0 +1,7 @@ +# Config::Simple 4.59 +# Wed Nov 25 15:24:02 2009 + +debug: 1 +xml_lang: en-US +brand: JBoss + --===============5342664269245562586==-- From jbosscache-commits at lists.jboss.org Wed Nov 25 00:27:50 2009 Content-Type: multipart/mixed; boundary="===============1749698949914268390==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8310 - enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_Tutorial. Date: Wed, 25 Nov 2009 00:27:49 -0500 Message-ID: <200911250527.nAP5Rn4q030955@svn01.web.mwc.hst.phx2.redhat.com> --===============1749698949914268390== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-25 00:27:47 -0500 (Wed, 25 Nov 2009) New Revision: 8310 Added: enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_Tutorial/publican.cfg Log: Adding new publican config file. Added: enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_Tutorial/publican.cfg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_Tutorial/publican.cfg = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_Tutorial/publican.cfg 2009-1= 1-25 05:27:47 UTC (rev 8310) @@ -0,0 +1,7 @@ +# Config::Simple 4.59 +# Wed Nov 25 15:25:41 2009 + +debug: 1 +xml_lang: en-US +brand: JBoss + --===============1749698949914268390==-- From jbosscache-commits at lists.jboss.org Wed Nov 25 00:28:38 2009 Content-Type: multipart/mixed; boundary="===============2312172049531918263==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r8311 - enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_User_Guide. Date: Wed, 25 Nov 2009 00:28:38 -0500 Message-ID: <200911250528.nAP5Scdg031065@svn01.web.mwc.hst.phx2.redhat.com> --===============2312172049531918263== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-25 00:28:36 -0500 (Wed, 25 Nov 2009) New Revision: 8311 Added: enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_User_Guide/publican.cfg Log: Adding new publican config file. Added: enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_User_Guide/publican.cfg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_User_Guide/publican.cfg = (rev 0) +++ enterprise-docs/tags/JBoss_EAP_5_0_0/Cache_User_Guide/publican.cfg 2009= -11-25 05:28:36 UTC (rev 8311) @@ -0,0 +1,7 @@ +# Config::Simple 4.59 +# Wed Nov 25 15:26:34 2009 + +debug: 1 +xml_lang: en-US +brand: JBoss + --===============2312172049531918263==--