User development,
The document "JBoss Cache in JBoss AS", was updated Feb 22, 2010
by Manik Surtani.
To view the document, visit:
http://community.jboss.org/docs/DOC-12922#cf
Document:
--------------------------------------------------------------
The purpose of this page is to detail how JBoss Cache is used in JBoss AS.
h1. Cache Manager
h1. HTTP Session Replication
h3. Default configuration
h1. EJB3 Session Replication
Integration code is in svn
https://svn.jboss.org/repos/jbossas/projects/ejb3/trunk/core/
in the org.jboss.ejb3.cache.tree package.
Testsuite is
https://svn.jboss.org/repos/jbossas/projects/ejb3/trunk/testsuite via the
clustered-tests target. The actual test code is in the
org.jboss.ejb3.test.clusteredsession package.
A
https://www.jboss.org/community/docs/DOC-9565 is in the works which will better define
the SPI for the jbc integration.
h5. Basic characteristics:
Session-type use case. Sessions are only meant to be accessed on one node at a time, with
that node remaining sticky. Replicating data via JBC is solely to provide HA in case of
loss/shutdown of the owning node or some failure in session stickiness. Session stickiness
makes this a good candidate for buddy replication.
h5. JBC features used:
* Passivation
* FileCacheLoader (default; users can configure their choice, but FCL is the logical
choice for most environments)
* Eviction
** Programmatic registration of eviction regions
** Custom eviction algorithm based on LRUAlgorithm
** JBC-based eviction will be removed in future in favor of direct control of eviction by
the integration code. Calls to evict() will still be used.
* Partial state transfer. When a bean is deployed, region associated with bean type is
activated and state transferred.
* Region based marshalling.
* BuddyReplication (disabled by default)
* REPL_SYNC or REPL_ASYNC, with async as the default
* No TransactionManager. In the future BatchModeTransactionManager will be used.
* Cache accessed via CacheManager.
h5. Storage structure inside JBC
/sfsb
+++ /uniquenameofdeploymentandbean
++++++ /bucket [0-99]
+++++++++ /sessionid
Session is stored as a single K/V pair, key is string "bean", value is the
StatefulBeanContext
TODO: convert the key to an enum.
The region for region-based-marshalling and partial state transfer is
/sfsb/uniquenameofdeploymentandbean.
The "bucket [0-99] Fqn level above is a workaround to a FileCacheLoader issue wherein
some filesystems limit the max number of child directories under
/sfsb/uniquenameofdeploymentandbean to ~32K. The addition of 100 bucket nodes in the tree
allows passivation of up to 3.2 million beans.
h3. Default configuration
See the sfsb-cache config in the
https://svn.jboss.org/repos/jbossas/trunk/cluster/src/resources/jboss-cac....
h1. Entity Caching (Hibernate)
Integration Code is in svn
https://svn.jboss.org/repos/hibernate/core/trunk/cache-jbosscache2/
Testsuite is contained in the same project as the main code.
Extensive documentation is available
http://galder.zamarreno.com/wp-content/uploads/2008/09/hibernate-jbosscac...
For now, I (Brian) am not going to comment much on this as the docs are good and the code
is clear; learn from those while I focus on the others. :-) I'll come back to this
later.)
h3. Default configuration
h1. HA-JNDI
h3. Default configuration
h1. AS Wishlist
This is on a
http://community.jboss.org/docs/DOC-13413
h1. Testing JBoss Cache with JBoss AS
A
http://community.jboss.org/docs/DOC-12851 was created detailing how this can be done,
specific to JBoss AS 5.
--------------------------------------------------------------