[jboss-cvs] JBossCache/docs/JBossCache-UserGuide/en/modules ...
Manik Surtani
msurtani at jboss.com
Mon Jan 22 17:50:09 EST 2007
User: msurtani
Date: 07/01/22 17:50:09
Modified: docs/JBossCache-UserGuide/en/modules
configuration.xml transactions.xml preface.xml
eviction_policies.xml treecache_marshaller.xml
cache_loaders.xml
Added: docs/JBossCache-UserGuide/en/modules
deployment.xml configuration_reference.xml
jmx_reference.xml
Removed: docs/JBossCache-UserGuide/en/modules
mgmt_information.xml jboss_integration.xml
Log:
Refactoring docs dir
Revision Changes Path
1.2 +148 -551 JBossCache/docs/JBossCache-UserGuide/en/modules/configuration.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: configuration.xml
===================================================================
RCS file: /cvsroot/jboss/JBossCache/docs/JBossCache-UserGuide/en/modules/configuration.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- configuration.xml 19 Jan 2007 17:01:00 -0000 1.1
+++ configuration.xml 22 Jan 2007 22:50:09 -0000 1.2
@@ -6,191 +6,197 @@
<literal>PropertyConfigurator</literal>
and an XML file.
</para>
+ <para>You should refer to
+ <link linkend="configuration_reference">the Configuration Reference chapter</link>
+ for a comprehensive list of all confiruration options available.
+ </para>
<section>
<title>Sample XML-Based Configuration</title>
<para>
A sample XML configuration file is shown
below:
</para>
- <programlisting><?xml version="1.0" encoding="UTF-8" ?>
- <server>~/
- <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" />
-
- <!-- ==================================================================== -->
- <!-- Defines TreeCache configuration -->
- <!-- ==================================================================== -->
- <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
- <depends>jboss:service=Naming</depends>
- <depends>jboss:service=TransactionManager</depends>
+ <programlisting>
+ <![CDATA[
+ <?xml version="1.0" encoding="UTF-8" ?>
+ <server>~/
+ <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" />
+
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
+ <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
+ <depends>jboss:service=Naming</depends>
+ <depends>jboss:service=TransactionManager</depends>
- <!-- Configure the TransactionManager -->
- <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
+ <!-- Configure the TransactionManager -->
+ <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
- <!-- Node locking scheme : PESSIMISTIC (default)
+ <!-- Node locking scheme : PESSIMISTIC (default)
OPTIMISTIC
- -->
- <attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
+ -->
+ <attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
- <!-- Node locking isolation level : SERIALIZABLE
+ <!-- Node locking isolation level : SERIALIZABLE
REPEATABLE_READ (default)
READ_COMMITTED
READ_UNCOMMITTED
NONE
(ignored if NodeLockingScheme is OPTIMISTIC)
- -->
- <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+ -->
+ <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
- <!-- Valid modes are LOCAL
+ <!-- Valid modes are LOCAL
REPL_ASYNC
REPL_SYNC
INVALIDATION_ASYNC
INVALIDATION_SYNC
- -->
- <attribute name="CacheMode">LOCAL</attribute>
+ -->
+ <attribute name="CacheMode">LOCAL</attribute>
- <!-- Whether each interceptor should have an mbean
- registered to capture and display its statistics. -->
- <attribute name="UseInterceptorMbeans">true</attribute>
-
- <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
- cluster, in order to find each other -->
- <attribute name="ClusterName">JBoss-Cache-Cluster</attribute>
+ <!-- Whether each interceptor should have an mbean
+ registered to capture and display its statistics. -->
+ <attribute name="UseInterceptorMbeans">true</attribute>
+
+ <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
+ cluster, in order to find each other -->
+ <attribute name="ClusterName">JBoss-Cache-Cluster</attribute>
- <!-- Uncomment next three statements to enable JGroups multiplexer.
+ <!-- Uncomment next three statements to enable JGroups multiplexer.
This configuration is dependent on the JGroups multiplexer being
- registered in an MBean server such as JBossAS. -->
- <!--
- <depends>jgroups.mux:name=Multiplexer</depends>
- <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
- <attribute name="MultiplexerStack">udp</attribute>
- -->
-
- <!-- JGroups protocol stack properties. ClusterConfig isn't used if the
- multiplexer is enabled and successfully initialized. -->
- <attribute name="ClusterConfig">
- <config>
- <!-- UDP: if you have a multihomed machine,
+ registered in an MBean server such as JBossAS. -->
+ <!--
+ <depends>jgroups.mux:name=Multiplexer</depends>
+ <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
+ <attribute name="MultiplexerStack">udp</attribute>
+ -->
+
+ <!-- JGroups protocol stack properties. ClusterConfig isn't used if the
+ multiplexer is enabled and successfully initialized. -->
+ <attribute name="ClusterConfig">
+ <config>
+ <!-- UDP: if you have a multihomed machine,
set the bind_addr attribute to the appropriate NIC IP address
- -->
- <!-- UDP: On Windows machines, because of the media sense feature
+ -->
+ <!-- UDP: On Windows machines, because of the media sense feature
being broken with multicast (even after disabling media sense)
set the loopback attribute to true
- -->
- <UDP mcast_addr="228.1.2.3" mcast_port="45566" ip_ttl="64" ip_mcast="true"
+ -->
+ <UDP mcast_addr="228.1.2.3" mcast_port="45566" ip_ttl="64" ip_mcast="true"
mcast_send_buf_size="150000" mcast_recv_buf_size="80000" ucast_send_buf_size="150000"
- ucast_recv_buf_size="80000" loopback="false" />
- <PING timeout="2000" num_initial_members="3" up_thread="false" down_thread="false" />
- <MERGE2 min_interval="10000" max_interval="20000" />
- <FD shun="true" up_thread="true" down_thread="true" />
- <VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false" />
- <pbcast.NAKACK gc_lag="50" max_xmit_size="8192" retransmit_timeout="600,1200,2400,4800"
- up_thread="false" down_thread="false" />
- <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10" down_thread="false" />
- <pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false" />
- <FRAG frag_size="8192" down_thread="false" up_thread="false" />
- <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true"
- print_local_addr="true" />
- <pbcast.STATE_TRANSFER up_thread="false" down_thread="false" />
- </config>
- </attribute>
+ ucast_recv_buf_size="80000" loopback="false" />
+ <PING timeout="2000" num_initial_members="3" up_thread="false" down_thread="false" />
+ <MERGE2 min_interval="10000" max_interval="20000" />
+ <FD shun="true" up_thread="true" down_thread="true" />
+ <VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false" />
+ <pbcast.NAKACK gc_lag="50" max_xmit_size="8192" retransmit_timeout="600,1200,2400,4800"
+ up_thread="false" down_thread="false" />
+ <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10" down_thread="false" />
+ <pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false" />
+ <FRAG frag_size="8192" down_thread="false" up_thread="false" />
+ <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true"
+ print_local_addr="true" />
+ <pbcast.STATE_TRANSFER up_thread="false" down_thread="false" />
+ </config>
+ </attribute>
- <!-- The max amount of time (in milliseconds) we wait until the
+ <!-- The max amount of time (in milliseconds) we wait until the
initial state (ie. the contents of the cache) are retrieved from
existing members in a clustered environment
- -->
- <attribute name="InitialStateRetrievalTimeout">5000</attribute>
+ -->
+ <attribute name="InitialStateRetrievalTimeout">5000</attribute>
- <!-- Number of milliseconds to wait until all responses for a
+ <!-- Number of milliseconds to wait until all responses for a
synchronous call have been received.
- -->
- <attribute name="SyncReplTimeout">10000</attribute>
+ -->
+ <attribute name="SyncReplTimeout">10000</attribute>
- <!-- Max number of milliseconds to wait for a lock acquisition -->
- <attribute name="LockAcquisitionTimeout">15000</attribute>
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <attribute name="LockAcquisitionTimeout">15000</attribute>
- <!-- Name of the eviction policy class. -->
- <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+ <!-- Name of the eviction policy class. -->
+ <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
- <!-- Specific eviction policy configurations. This is LRU -->
- <attribute name="EvictionPolicyConfig">
- <config>
- <attribute name="wakeUpIntervalSeconds">5</attribute>
- <!-- Cache wide default -->
- <region name="/_default_">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLiveSeconds">1000</attribute>
- <!-- Maximum time an object is kept in cache regardless of idle time -->
- <attribute name="maxAgeSeconds">120</attribute>
- </region>
-
- <region name="/org/jboss/data">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLiveSeconds">1000</attribute>
- </region>
-
- <region name="/org/jboss/test/data">
- <attribute name="maxNodes">5</attribute>
- <attribute name="timeToLiveSeconds">4</attribute>
- </region>
- </config>
- </attribute>
-
- <!-- New 1.3.x cache loader config block -->
- <attribute name="CacheLoaderConfiguration">
- <config>
- <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
- <passivation>false</passivation>
- <preload>/a/b, /allTempObjects, /some/specific/fqn</preload>
- <shared>false</shared>
-
- <!-- we can now have multiple cache loaders, which get chained -->
- <cacheloader>
- <class>org.jboss.cache.loader.FileCacheLoader</class>
- <!-- same as the old CacheLoaderConfig attribute -->
- <properties>
+ <!-- Specific eviction policy configurations. This is LRU -->
+ <attribute name="EvictionPolicyConfig">
+ <config>
+ <attribute name="wakeUpIntervalSeconds">5</attribute>
+ <!-- Cache wide default -->
+ <region name="/_default_">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLiveSeconds">1000</attribute>
+ <!-- Maximum time an object is kept in cache regardless of idle time -->
+ <attribute name="maxAgeSeconds">120</attribute>
+ </region>
+
+ <region name="/org/jboss/data">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLiveSeconds">1000</attribute>
+ </region>
+
+ <region name="/org/jboss/test/data">
+ <attribute name="maxNodes">5</attribute>
+ <attribute name="timeToLiveSeconds">4</attribute>
+ </region>
+ </config>
+ </attribute>
+
+ <!-- New 1.3.x cache loader config block -->
+ <attribute name="CacheLoaderConfiguration">
+ <config>
+ <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
+ <passivation>false</passivation>
+ <preload>/a/b, /allTempObjects, /some/specific/fqn</preload>
+ <shared>false</shared>
+
+ <!-- we can now have multiple cache loaders, which get chained -->
+ <cacheloader>
+ <class>org.jboss.cache.loader.FileCacheLoader</class>
+ <!-- same as the old CacheLoaderConfig attribute -->
+ <properties>
location=/tmp/myFileStore
- </properties>
- <!-- whether the cache loader writes are asynchronous -->
- <async>false</async>
- <!-- only one cache loader in the chain may set fetchPersistentState to true.
- An exception is thrown if more than one cache loader sets this to true. -->
- <fetchPersistentState>true</fetchPersistentState>
- <!-- determines whether this cache loader ignores writes - defaults to false. -->
- <ignoreModifications>false</ignoreModifications>
- <!-- if set to true, purges the contents of this cache loader when the cache starts up.
- Defaults to false. -->
- <purgeOnStartup>false</purgeOnStartup>
- </cacheloader>
-
- <cacheloader>
- <class>org.jboss.cache.loader.JDBCCacheLoader</class>
- <!-- same as the old CacheLoaderConfig attribute -->
- <properties>
+ </properties>
+ <!-- whether the cache loader writes are asynchronous -->
+ <async>false</async>
+ <!-- only one cache loader in the chain may set fetchPersistentState to true.
+ An exception is thrown if more than one cache loader sets this to true. -->
+ <fetchPersistentState>true</fetchPersistentState>
+ <!-- determines whether this cache loader ignores writes - defaults to false. -->
+ <ignoreModifications>false</ignoreModifications>
+ <!-- if set to true, purges the contents of this cache loader when the cache starts up.
+ Defaults to false. -->
+ <purgeOnStartup>false</purgeOnStartup>
+ </cacheloader>
+
+ <cacheloader>
+ <class>org.jboss.cache.loader.JDBCCacheLoader</class>
+ <!-- same as the old CacheLoaderConfig attribute -->
+ <properties>
cache.jdbc.driver=com.mysql.jdbc.Driver
cache.jdbc.url=jdbc:mysql://localhost:3306/jbossdb
cache.jdbc.user=root
cache.jdbc.password=
- </properties>
- <!-- whether the cache loader writes are asynchronous -->
- <async>true</async>
- <!-- only one cache loader in the chain may set fetchPersistentState to true.
- An exception is thrown if more than one cache loader sets this to true. -->
- <fetchPersistentState>false</fetchPersistentState>
- <!-- determines whether this cache loader ignores writes - defaults to false. -->
- <ignoreModifications>true</ignoreModifications>
- <!-- if set to true, purges the contents of this cache loader when the cache starts up.
- Defaults to false. -->
- <purgeOnStartup>false</purgeOnStartup>
- </cacheloader>
+ </properties>
+ <!-- whether the cache loader writes are asynchronous -->
+ <async>true</async>
+ <!-- only one cache loader in the chain may set fetchPersistentState to true.
+ An exception is thrown if more than one cache loader sets this to true. -->
+ <fetchPersistentState>false</fetchPersistentState>
+ <!-- determines whether this cache loader ignores writes - defaults to false. -->
+ <ignoreModifications>true</ignoreModifications>
+ <!-- if set to true, purges the contents of this cache loader when the cache starts up.
+ Defaults to false. -->
+ <purgeOnStartup>false</purgeOnStartup>
+ </cacheloader>
- </config>
- </attribute>
+ </config>
+ </attribute>
- </mbean>
- </server> </programlisting>
+ </mbean>
+ </server> ]]></programlisting>
<para>The PropertyConfigurator.configure() method needs to have as
argument a filename which is located on the classpath; it will use be used
@@ -202,419 +208,9 @@
<para>We will switch to using an XMBean in a future release.</para>
</footnote>
</para>
- </section>
-
- <section>
- <title>
- Definition of XML attributes
- </title>
- <para>A list of definitions of each of the XML attributes used above:</para>
-
- <informaltable frame="all">
- <tgroup cols="2">
- <tbody>
- <row>
- <entry>
- <para>Name</para>
- </entry>
-
- <entry>
- <para>Description</para>
- </entry>
- </row>
- <row>
- <entry>
- <para>MarshallerClass</para>
- </entry>
-
- <entry>
- <para>An instance of org.jboss.cache.marshall.Marshaller used to serialize data to byte streams.
- Defaults to o.j.c.m.VersionAwareMarshaller if not specified.
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>BuddyReplicationConfig</para>
- </entry>
-
- <entry>
- <para>An XML element that contains detailed buddy replication
- configuration. See section above on Buddy Replication.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>CacheLoaderConfiguration</para>
- </entry>
-
- <entry>
- <para>An XML element that contains detailed cache loader
- configuration. See section above on Cache Loaders.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>CacheMode</para>
- </entry>
-
- <entry>
- <para>LOCAL, REPL_SYNC, REPL_ASYNC, INVALIDATION_SYNC or
- INVALIDATION_ASYNC
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>ClusterConfig</para>
- </entry>
-
- <entry>
- <para>The configuration of the underlying JGroups stack.
- Ignored if
- <literal>MultiplexerService</literal>
- and
- <literal>MultiplexerStack</literal>
- are used.
- See the various *-service.xml files in the source distribution
- <literal>etc/META-INF</literal>
- folder for examples.
- See the
- <ulink url="http://www.jgroups.org">JGroups documentation</ulink>
- or the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups">JGroups wiki page</ulink>
- for more information.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>ClusterName</para>
- </entry>
-
- <entry>
- <para>Name of cluster. Needs to be the same for all nodes in a
- cluster in order for them to communicate with each other.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>EvictionPolicyClass</para>
- </entry>
-
- <entry>
- <para>The name of a class implementing EvictionPolicy. Deprecated;
- it is preferable to configure the eviction policy class as
- part of the
- <literal>EvictionPolicyConfig</literal>
- .
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>EvictionPolicyConfig</para>
- </entry>
-
- <entry>
- <para>Configuration parameter for the specified eviction policy.
- Note that the content is provider specific.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>FetchInMemoryState (renamed from
- FetchStateOnStartup)
- </para>
- </entry>
-
- <entry>
- <para>Whether or not to acquire the initial in-memory state from
- existing members. Allows for hot/cold caches (true/false). Also
- see the fetchPersistentState element in
- CacheLoaderConfiguration.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>InactiveOnStartup</para>
- </entry>
-
- <entry>
- <para>Whether or not the entire tree is inactive upon startup,
- only responding to replication messages after
- <literal>activateRegion()</literal>
- is called to activate one or
- more parts of the tree. If true, property
- <literal>FetchInMemoryState</literal>
- is ignored. This property
- should only be set to true if
- <literal>UseRegionBasedMarshalling</literal>
- is also
- <literal>true</literal>
- .
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>InitialStateRetrievalTimeout</para>
- </entry>
-
- <entry>
- <para>Time in milliseconds to wait for initial state
- retrieval. This should be longer than
- <literal>LockAcquisitionTimeout</literal>
- as the node
- providing state may need to wait that long to acquire
- necessary read locks on the cache.
- </para>
- </entry>
- </row>
-
-
- <row>
- <entry>
- <para>IsolationLevel</para>
- </entry>
-
- <entry>
- <para>Node locking isolation level : SERIALIZABLE, REPEATABLE_READ
- (default), READ_COMMITTED, READ_UNCOMMITTED, and NONE. Note that this is ignored if
- NodeLockingScheme is OPTIMISTIC. Case doesn't matter. See documentation on Transactions and
- Concurrency for more details.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>LockAcquisitionTimeout</para>
- </entry>
-
- <entry>
- <para>Time in milliseconds to wait for a lock to be acquired. If
- a lock cannot be acquired an exception will be thrown.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>MultiplexerService</para>
- </entry>
-
- <entry>
- <para>The JMX object name of the service that defines the JGroups multiplexer.
- In JBoss AS 5 this service is normally defined in the jgroups-multiplexer.sar.
- If this attribute is defined, the cache will look up the multiplexer service
- in JMX and will use it to obtain a multiplexed JGroups channel. The configuration
- of the channel will be that associated with
- <literal>MultiplexerStack</literal>
- .
- The
- <literal>ClusterConfig</literal>
- attribute will be ignored.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>MultiplexerStack</para>
- </entry>
-
- <entry>
- <para>The name of the JGroups stack to be used with the TreeCache cluster.
- Stacks are defined in the configuration of the external
- <literal>MultiplexerService</literal>
- discussed above. In JBoss AS 5 this is normally done in the
- jgroups-multiplexer.sar\META-INF\multiplexer-stacks.xml file.
- The default stack is
- <literal>udp</literal>
- . This attribute is used in conjunction with
- <literal>MultiplexerService</literal>
- .
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>NodeLockingScheme</para>
- </entry>
-
- <entry>
- <para>May be PESSIMISTIC (default) or OPTIMISTIC. See documentation on Transactions and Concurrency
- for more details.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>ReplicationVersion</para>
- </entry>
- <entry>
- <para>Tells the cache to serialize cluster traffic
- in a format consistent with that used by the given release
- of JBoss Cache. Different JBoss Cache versions use different
- wire formats; setting this attribute tells a cache from a later
- release to serialize data using the format from an earlier
- release. This allows caches from different releases to
- interoperate. For example, a 1.2.4.SP2 cache could have this
- value set to "1.2.3", allowing it to interoperate with a 1.2.3
- cache. Valid values are a dot-separated release number, with
- any SP qualifer also separated by a dot, e.g. "1.2.3" or "1.2.4.SP2".
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>ReplQueueInterval</para>
- </entry>
-
- <entry>
- <para>Time in milliseconds for elements from the replication
- queue to be replicated.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>ReplQueueMaxElements</para>
- </entry>
-
- <entry>
- <para>Max number of elements in the replication queue until
- replication kicks in.
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>SyncCommitPhase</para>
- </entry>
-
- <entry>
- <para>This option is used to control the behaviour of the commit part of a 2-phase commit protocol,
- when
- using REPL_SYNC (does not apply to other cache modes). By default this is set to
- <literal>false</literal>
- . There is a performance penalty to enabling this, especially when running
- in a large cluster, but the upsides are greater cluster-wide data integrity. See the chapter on
- Clustered Caches for more information on this.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>SyncReplTimeout</para>
- </entry>
-
- <entry>
- <para>For synchronous replication: time in milliseconds to wait
- until replication acks have been received from all nodes in the
- cluster.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>SyncRollbackPhase</para>
- </entry>
-
- <entry>
- <para>This option is used to control the behaviour of the rollback part of a 2-phase commit
- protocol, when
- using REPL_SYNC (does not apply to other cache modes). By default this is set to
- <literal>false</literal>
- . There is a performance penalty to enabling this, especially when running
- in a large cluster, but the upsides are greater cluster-wide data integrity. See the chapter on
- Clustered Caches for more information on this.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>TransactionManagerLookupClass</para>
- </entry>
-
- <entry>
- <para>The fully qualified name of a class implementing
- TransactionManagerLookup. Default is
- JBossTransactionManagerLookup. There is also an option of
- DummyTransactionManagerLookup for example.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>UseInterceptorMbeans</para>
- </entry>
-
- <entry>
- <para>Specifies whether each interceptor should have an associated
- mbean registered. Interceptor mbeans are used to capture statistics
- and display them in JMX. This setting enables or disables all such interceptor
- mbeans. Default value is
- <emphasis>true</emphasis>
- .
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>UseRegionBasedMarshalling</para>
- </entry>
-
- <entry>
- <para>When unmarshalling replicated data, this option specifies whether or not to use
- different classloaders (for different cache regions). This defaults to
- <literal>false</literal>
- if unspecified.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>UseReplQueue</para>
- </entry>
-
- <entry>
- <para>For asynchronous replication: whether or not to use a
- replication queue (true/false).
- </para>
- </entry>
- </row>
-
- </tbody>
- </tgroup>
- </informaltable>
</section>
+
<section>
<title>Overriding options</title>
<para>
@@ -635,4 +231,5 @@
class for details on these options.
</para>
</section>
+
</chapter>
\ No newline at end of file
1.2 +21 -6 JBossCache/docs/JBossCache-UserGuide/en/modules/transactions.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: transactions.xml
===================================================================
RCS file: /cvsroot/jboss/JBossCache/docs/JBossCache-UserGuide/en/modules/transactions.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- transactions.xml 19 Jan 2007 17:01:00 -0000 1.1
+++ transactions.xml 22 Jan 2007 22:50:09 -0000 1.2
@@ -77,9 +77,11 @@
before Tx1 commits. In other words, if you have the following
sequence,
<programlisting>
+ <![CDATA[
Tx1 Tx2
W
R
+ ]]>
</programlisting>
using this isolation level will not Tx2 read operation.
@@ -95,10 +97,12 @@
can produce different results. For example, if you have the following
sequence,
<programlisting>
+ <![CDATA[
Tx1 Tx2
R
W
R
+ ]]>
</programlisting>
</para>
@@ -183,14 +187,16 @@
<title>Configuration</title>
Optimistic locking is enabled by using the NodeLockingScheme XML attribute, and setting it to "OPTIMISTIC":
<programlisting>
+ <![CDATA[
...
- <!--
+ <!--
Node locking scheme:
OPTIMISTIC
PESSIMISTIC (default)
- -->
- <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
+ -->
+ <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
...
+ ]]>
</programlisting>
</section>
</section>
@@ -254,7 +260,9 @@
is as follows:
</para>
- <programlisting>public class JBossTransactionManagerLookup implements TransactionManagerLookup {
+ <programlisting>
+ <![CDATA[
+ public class JBossTransactionManagerLookup implements TransactionManagerLookup {
public JBossTransactionManagerLookup() {}
@@ -263,6 +271,7 @@
return (TransactionManager)tmp;
}
}
+ ]]>
</programlisting>
<para>The implementation looks up the JBoss Transaction Manager from
@@ -324,7 +333,9 @@
outside an application server) fashion with dummy transactions:
</para>
- <programlisting>Properties prop = new Properties();
+ <programlisting>
+ <![CDATA[
+ Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
User Transaction tx=(UserTransaction)new InitialContext(prop).lookup("UserTransaction");
TreeCache tree = new TreeCache();
@@ -342,6 +353,7 @@
catch(Throwable ex) {
try { tx.rollback(); } catch(Throwable t) {}
}
+ ]]>
</programlisting>
<para>The first lines obtain a user transaction using the 'JEE way' via
@@ -349,7 +361,10 @@
</para>
<para>
- <programlisting>UserTransaction tx = new DummyUserTransaction(DummyTransactionManager.getInstance());
+ <programlisting>
+ <![CDATA[
+ UserTransaction tx = new DummyUserTransaction(DummyTransactionManager.getInstance());
+ ]]>
</programlisting>
</para>
1.2 +13 -9 JBossCache/docs/JBossCache-UserGuide/en/modules/preface.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: preface.xml
===================================================================
RCS file: /cvsroot/jboss/JBossCache/docs/JBossCache-UserGuide/en/modules/preface.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- preface.xml 22 Jan 2007 16:20:00 -0000 1.1
+++ preface.xml 22 Jan 2007 22:50:09 -0000 1.2
@@ -2,18 +2,22 @@
<title>Preface</title>
<para>
- This and its accompanying documents describe JBoss Cache's
- TreeCache, a tree-structured replicated, transactional cache. JBoss
- Cache's PojoCache, an "object-oriented" cache that is the AOP-enabled
- subclass of TreeCache, allowing for Plain Old Java Objects (POJOs) to be
- inserted and replicated transactionally in a cluster, is described
- separately in a similar user guide.
+ This is the official JBoss Cache user guide, and along with it's accompanying documents (an FAQ, a tutorial and a
+ whole set of documents on PojoCache) are all freely available on the JBoss Cache documentation site,
+ <ulink url="http://labs.jboss.com/jbosscache">http://labs.jboss.com/jbosscache</ulink>
+ .
+ </para>
+ <para>
+ when used, JBoss Cache refers to JBoss Cache Core, a tree-structured clustered, transactional cache.
+ Pojo Cache, also a part of the JBoss Cache distribution, is documented separately. (Pojo Cache is a cache that
+ deals with Plain Old Java Objects, complete with object relationships, with the ability to cluster such pojos
+ while maintaining their relationships. Please see the Pojo Cache documentation for more information around this.)
</para>
<para>
- The TreeCache is fully configurable. Aspects of the system such as
- replication mechanisms, transaction isolation levels, eviction policies,
- and transaction managers are all configurable. The TreeCache can be used
+ JBoss Cache is flexible, versatile and very configurable. Aspects of the cache such as replication mechanisms,
+ transaction isolation levels, eviction policies, and transaction managers are all configurable. JBoss Cache can be
+ used
in a standalone fashion - independent of JBoss Application Server or any
other application server. PojoCache on the other hand requires both
TreeCache and the JBossAOP standalone subsystem. PojoCache, documented
1.2 +152 -115 JBossCache/docs/JBossCache-UserGuide/en/modules/eviction_policies.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: eviction_policies.xml
===================================================================
RCS file: /cvsroot/jboss/JBossCache/docs/JBossCache-UserGuide/en/modules/eviction_policies.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- eviction_policies.xml 19 Jan 2007 17:01:00 -0000 1.1
+++ eviction_policies.xml 22 Jan 2007 22:50:09 -0000 1.2
@@ -60,7 +60,9 @@
</mediaobject>
</figure>
- <programlisting>public interface EvictionPolicy
+ <programlisting>
+ <![CDATA[
+ public interface EvictionPolicy
{
/**
* Evict a node form the underlying cache.
@@ -95,7 +97,7 @@
/**
* Get the associated EvictionAlgorithm used by the EvictionPolicy.
- * <p/>
+ * <p/>
* This relationship should be 1-1.
*
* @return An EvictionAlgorithm implementation.
@@ -150,9 +152,12 @@
boolean canIgnoreEvent(Fqn fqn, NodeEventType eventType);
}
+ ]]>
</programlisting>
- <programlisting>public interface EvictionAlgorithm
+ <programlisting>
+ <![CDATA[
+ public interface EvictionAlgorithm
{
/**
* Entry point for evictin algorithm. This is an api called by the EvictionTimerTask
@@ -177,15 +182,18 @@
EvictionQueue getEvictionQueue();
}
+ ]]>
</programlisting>
- <programlisting>public interface EvictionQueue
+ <programlisting>
+ <![CDATA[
+ public interface EvictionQueue
{
/**
* Get the first entry in the queue.
- * <p/>
+ * <p/>
* If there are no entries in queue, this method will return null.
- * <p/>
+ * <p/>
* The first node returned is expected to be the first node to evict.
*
* @return first NodeEntry in queue.
@@ -194,7 +202,7 @@
/**
* Retrieve a node entry by Fqn.
- * <p/>
+ * <p/>
* This will return null if the entry is not found.
*
* @param fqn Fqn of the node entry to retrieve.
@@ -214,7 +222,7 @@
/**
* Remove a NodeEntry from queue.
- * <p/>
+ * <p/>
* If the NodeEntry does not exist in the queue, this method will return normally.
*
* @param entry The NodeEntry to remove from queue.
@@ -241,9 +249,12 @@
public void clear();
}
+ ]]>
</programlisting>
- <programlisting>public interface EvictionConfiguration
+ <programlisting>
+ <![CDATA[
+ public interface EvictionConfiguration
{
public static final int WAKEUP_DEFAULT = 5;
@@ -261,19 +272,20 @@
/**
* Parse the XML configuration for the given specific eviction region.
- * <p/>
+ * <p/>
* The element parameter should contain the entire region block. An example
* of an entire Element of the region would be:
- * <p/>
- * <region name="abc">
- * <attribute name="maxNodes">10</attribute>
- * </region>
+ * <p/>
+ * <region name="abc">
+ * <attribute name="maxNodes">10</attribute>
+ * </region>
*
- * @param element DOM element for the region. <region name="abc"></region>
+ * @param element DOM element for the region. <region name="abc"></region>
* @throws ConfigureException
*/
public void parseXMLConfig(Element element) throws ConfigureException;
}
+ ]]>
</programlisting>
<para>
@@ -308,7 +320,9 @@
policy provider classes
</para>
- <programlisting>public abstract class BaseEvictionPolicy implements EvictionPolicy
+ <programlisting>
+ <![CDATA[
+ public abstract class BaseEvictionPolicy implements EvictionPolicy
{
protected static final Fqn ROOT = new Fqn("/");
@@ -378,9 +392,12 @@
}
}
+ ]]>
</programlisting>
- <programlisting>public abstract class BaseEvictionAlgorithm implements EvictionAlgorithm
+ <programlisting>
+ <![CDATA[
+ public abstract class BaseEvictionAlgorithm implements EvictionAlgorithm
{
private static final Log log = LogFactory.getLog(BaseEvictionAlgorithm.class);
@@ -419,9 +436,9 @@
/**
* Process the given region.
- * <p/>
+ * <p/>
* Eviction Processing encompasses the following:
- * <p/>
+ * <p/>
* - Add/Remove/Visit Nodes
* - Prune according to Eviction Algorithm
* - Empty/Retry the recycle queue of previously evicted but locked (during actual cache eviction) nodes.
@@ -458,7 +475,7 @@
/**
* Event processing for Evict/Add/Visiting of nodes.
- * <p/>
+ * <p/>
* - On AddEvents a new element is added into the eviction queue
* - On RemoveEvents, the removed element is removed from the eviction queue.
* - On VisitEvents, the visited node has its eviction statistics updated (idleTime, numberOfNodeVisists, etc..)
@@ -595,14 +612,14 @@
/**
* Remove a node from cache.
- * <p/>
+ * <p/>
* This method will remove the node from the eviction queue as well as
* evict the node from cache.
- * <p/>
+ * <p/>
* If a node cannot be removed from cache, this method will remove it from the eviction queue
* and place the element into the recycleQueue. Each node in the recycle queue will get retried until
* proper cache eviction has taken place.
- * <p/>
+ * <p/>
* Because EvictionQueues are collections, when iterating them from an iterator, use iterator.remove()
* to avoid ConcurrentModificationExceptions. Use the boolean parameter to indicate the calling context.
*
@@ -630,10 +647,10 @@
/**
* Visit a node in cache.
- * <p/>
+ * <p/>
* This method will update the numVisits and modifiedTimestamp properties of the Node.
* These properties are used as statistics to determine eviction (LRU, LFU, MRU, etc..)
- * <p/>
+ * <p/>
* *Note* that this method updates Node Entries by reference and does not put them back
* into the queue. For some sorted collections, a remove, and a re-add is required to
* maintain the sorted order of the elements.
@@ -658,7 +675,7 @@
/**
* Empty the Recycle Queue.
- * <p/>
+ * <p/>
* This method will go through the recycle queue and retry to evict the nodes from cache.
*
* @throws EvictionException
@@ -726,6 +743,7 @@
}
}
+ ]]>
</programlisting>
<para>
@@ -747,6 +765,7 @@
</itemizedlist>
<programlisting>
+ <![CDATA[
public abstract class BaseSortedEvictionAlgorithm extends BaseEvictionAlgorithm implements EvictionAlgorithm
{
private static final Log log = LogFactory.getLog(BaseSortedEvictionAlgorithm.class);
@@ -803,7 +822,7 @@
/**
* This method is called to resort the queue after add or visit events have occurred.
- * <p/>
+ * <p/>
* If the parameter is true, the queue needs to be resorted. If it is false, the queue does not
* need resorting.
*
@@ -823,6 +842,7 @@
}
}
+ ]]>
</programlisting>
<para>
@@ -841,13 +861,16 @@
</listitem>
</itemizedlist>
- <programlisting>public interface SortedEvictionQueue extends EvictionQueue
+ <programlisting>
+ <![CDATA[
+ public interface SortedEvictionQueue extends EvictionQueue
{
/**
* Provide contract to resort a sorted queue.
*/
public void resortEvictionQueue();
}
+ ]]>
</programlisting>
<para>
@@ -890,37 +913,39 @@
</para>
<programlisting>
- <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
- <!-- Specific eviction policy configurations. This is LRU -->
- <attribute name="EvictionPolicyConfig">
- <config>
- <attribute name="wakeUpIntervalSeconds">5</attribute>
- <!-- This defaults to 200000 if not specified -->
- <attribute name="eventQueueSize">100000</attribute>
- <!-- Cache wide default -->
- <region name="/_default_">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLiveSeconds">1000</attribute>
- </region>
- <region name="/org/jboss/data">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLiveSeconds">1000</attribute>
- </region>
- <region name="/org/jboss/test/data">
- <attribute name="maxNodes">5</attribute>
- <attribute name="timeToLiveSeconds">4</attribute>
- </region>
- <region name="/test/">
- <attribute name="maxNodes">10000</attribute>
- <attribute name="timeToLiveSeconds">5</attribute>
- </region>
- <region name="/maxAgeTest/">
- <attribute name="maxNodes">10000</attribute>
- <attribute name="timeToLiveSeconds">8</attribute>
- <attribute name="maxAgeSeconds">10</attribute>
- </region>
- </config>
- </attribute>
+ <![CDATA[
+ <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+ <!-- Specific eviction policy configurations. This is LRU -->
+ <attribute name="EvictionPolicyConfig">
+ <config>
+ <attribute name="wakeUpIntervalSeconds">5</attribute>
+ <!-- This defaults to 200000 if not specified -->
+ <attribute name="eventQueueSize">100000</attribute>
+ <!-- Cache wide default -->
+ <region name="/_default_">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLiveSeconds">1000</attribute>
+ </region>
+ <region name="/org/jboss/data">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLiveSeconds">1000</attribute>
+ </region>
+ <region name="/org/jboss/test/data">
+ <attribute name="maxNodes">5</attribute>
+ <attribute name="timeToLiveSeconds">4</attribute>
+ </region>
+ <region name="/test/">
+ <attribute name="maxNodes">10000</attribute>
+ <attribute name="timeToLiveSeconds">5</attribute>
+ </region>
+ <region name="/maxAgeTest/">
+ <attribute name="maxNodes">10000</attribute>
+ <attribute name="timeToLiveSeconds">8</attribute>
+ <attribute name="maxAgeSeconds">10</attribute>
+ </region>
+ </config>
+ </attribute>
+ ]]>
</programlisting>
<para>Here is an example of configuring a different eviction provider
@@ -928,33 +953,35 @@
</para>
<programlisting>
- <attribute name="EvictionPolicyConfig">
- <config>
- <!-- This defaults to 200000 if not specified -->
- <attribute name="eventQueueSize">100000</attribute>
- <attribute name="wakeUpIntervalSeconds">5</attribute>
- <!-- Cache wide default -->
- <region name="/_default_" policyClass="org.jboss.cache.eviction.LRUPolicy">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLiveSeconds">1000</attribute>
- </region>
- <region name="/org/jboss/data" policyClass="org.jboss.cache.eviction.LFUPolicy">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="minNodes">1000</attribute>
- </region>
- <region name="/org/jboss/test/data" policyClass="org.jboss.cache.eviction.FIFOPolicy">
- <attribute name="maxNodes">5</attribute>
- </region>
- <region name="/test/" policyClass="org.jboss.cache.eviction.MRUPolicy">
- <attribute name="maxNodes">10000</attribute>
- </region>
- <region name="/maxAgeTest/" policyClass="org.jboss.cache.eviction.LRUPolicy">
- <attribute name="maxNodes">10000</attribute>
- <attribute name="timeToLiveSeconds">8</attribute>
- <attribute name="maxAgeSeconds">10</attribute>
- </region>
- </config>
- </attribute>
+ <![CDATA[
+ <attribute name="EvictionPolicyConfig">
+ <config>
+ <!-- This defaults to 200000 if not specified -->
+ <attribute name="eventQueueSize">100000</attribute>
+ <attribute name="wakeUpIntervalSeconds">5</attribute>
+ <!-- Cache wide default -->
+ <region name="/_default_" policyClass="org.jboss.cache.eviction.LRUPolicy">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLiveSeconds">1000</attribute>
+ </region>
+ <region name="/org/jboss/data" policyClass="org.jboss.cache.eviction.LFUPolicy">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="minNodes">1000</attribute>
+ </region>
+ <region name="/org/jboss/test/data" policyClass="org.jboss.cache.eviction.FIFOPolicy">
+ <attribute name="maxNodes">5</attribute>
+ </region>
+ <region name="/test/" policyClass="org.jboss.cache.eviction.MRUPolicy">
+ <attribute name="maxNodes">10000</attribute>
+ </region>
+ <region name="/maxAgeTest/" policyClass="org.jboss.cache.eviction.LRUPolicy">
+ <attribute name="maxNodes">10000</attribute>
+ <attribute name="timeToLiveSeconds">8</attribute>
+ <attribute name="maxAgeSeconds">10</attribute>
+ </region>
+ </config>
+ </attribute>
+ ]]>
</programlisting>
<para>Lastly, an example of mixed mode. In this scenario the regions
@@ -964,31 +991,33 @@
</para>
<programlisting>
- <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
- <!-- Specific eviction policy configurations. This is LRU -->
- <attribute name="EvictionPolicyConfig">
- <config>
- <attribute name="wakeUpIntervalSeconds">5</attribute>
- <!-- This defaults to 200000 if not specified -->
- <attribute name="eventQueueSize">100000</attribute>
- <!-- Cache wide default -->
- <region name="/_default_">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLiveSeconds">1000</attribute>
- </region>
- <region name="/org/jboss/data" policyClass="org.jboss.cache.eviction.FIFOPolicy">
- <attribute name="maxNodes">5000</attribute>
- </region>
- <region name="/test/" policyClass="org.jboss.cache.eviction.MRUPolicy">
- <attribute name="maxNodes">10000</attribute>
- </region>
- <region name="/maxAgeTest/">
- <attribute name="maxNodes">10000</attribute>
- <attribute name="timeToLiveSeconds">8</attribute>
- <attribute name="maxAgeSeconds">10</attribute>
- </region>
- </config>
- </attribute>
+ <![CDATA[
+ <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+ <!-- Specific eviction policy configurations. This is LRU -->
+ <attribute name="EvictionPolicyConfig">
+ <config>
+ <attribute name="wakeUpIntervalSeconds">5</attribute>
+ <!-- This defaults to 200000 if not specified -->
+ <attribute name="eventQueueSize">100000</attribute>
+ <!-- Cache wide default -->
+ <region name="/_default_">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLiveSeconds">1000</attribute>
+ </region>
+ <region name="/org/jboss/data" policyClass="org.jboss.cache.eviction.FIFOPolicy">
+ <attribute name="maxNodes">5000</attribute>
+ </region>
+ <region name="/test/" policyClass="org.jboss.cache.eviction.MRUPolicy">
+ <attribute name="maxNodes">10000</attribute>
+ </region>
+ <region name="/maxAgeTest/">
+ <attribute name="maxNodes">10000</attribute>
+ <attribute name="timeToLiveSeconds">8</attribute>
+ <attribute name="maxAgeSeconds">10</attribute>
+ </region>
+ </config>
+ </attribute>
+ ]]>
</programlisting>
</section>
<section>
@@ -1001,6 +1030,7 @@
</para>
<programlisting>
+ <![CDATA[
// note this is just to show that a running TreeCache instance must be
// retrieved somehow. How it is implemented is up to the implementor.
TreeCache cache = getRunningTreeCacheInstance();
@@ -1011,18 +1041,20 @@
((LRUConfiguration)config).setMaxNodes(12345);
((LRUConfiguration)config).setTimeToLiveSeconds(500);
((LRUConfiguration)config).setMaxAgeSeconds(1000);
+ ]]>
</programlisting>
<para>Here is another example that shows how to insert a region at runtime:</para>
<programlisting>
+ <![CDATA[
// cache needs to be started first
cache_.start();
// region name is ignored here.
- String xml = "<region name="/dummy">" +
- "<attribute name="maxNodes">10000</attribute>" +
- "<attribute name="timeToLiveSeconds">4</attribute>" +
- "</region>";
+ String xml = "<region name="/dummy">" +
+ "<attribute name="maxNodes">10000</attribute>" +
+ "<attribute name="timeToLiveSeconds">4</attribute>" +
+ "</region>";
Element element = XmlHelper.stringToElement(xml);
RegionManager regionManager = cache_.getEvictionRegionManager();
@@ -1031,14 +1063,17 @@
Fqn fqn = new Fqn(ii);
// Create region will be added to the eviction process automatically
Region region = regionManager.createRegion(fqn, element);
+ ]]>
</programlisting>
<para>Afterwards, a cache put like the following will be evicted later:</para>
<programlisting>
+ <![CDATA[
Integer ii = new Integer(1);
Fqn rootfqn = new Fqn(ii);
Integer in = new Integer(3);
Fqn fqn = new Fqn(rootfqn, in);
cache_.put(fqn, in, in);
+ ]]>
</programlisting>
</section>
@@ -1402,6 +1437,7 @@
The following listing shows how the expiration date is indicated and how the
policy is applied:
<programlisting>
+ <![CDATA[
Cache cache;
Fqn fqn1 = Fqn.fromString("/node/1");
Long future = new Long(System.currentTimeMillis() + 2000);
@@ -1410,6 +1446,7 @@
Thread.sleep(5000);
// after 5 seconds, expiration completes
assertTrue(cache.get(fqn1) == null);
+ ]]>
</programlisting>
Note that the expiration time of nodes is only checked when the
region manager wakes up every
1.2 +40 -22 JBossCache/docs/JBossCache-UserGuide/en/modules/treecache_marshaller.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: treecache_marshaller.xml
===================================================================
RCS file: /cvsroot/jboss/JBossCache/docs/JBossCache-UserGuide/en/modules/treecache_marshaller.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- treecache_marshaller.xml 19 Jan 2007 17:01:00 -0000 1.1
+++ treecache_marshaller.xml 22 Jan 2007 22:50:09 -0000 1.2
@@ -38,6 +38,7 @@
</para>
<programlisting>
+ <![CDATA[
/**
* Sets whether marshalling uses scoped class loaders on a per region basis.
*
@@ -93,6 +94,7 @@
<code>false</code>
*/
void unregisterClassLoader(String fqn) throws RegionNotFoundException;
+ ]]>
</programlisting>
<para>Property
@@ -103,7 +105,11 @@
configuration file:
</para>
- <programlisting><attribute name="UseRegionBasedMarshalling">true</attribute></programlisting>
+ <programlisting>
+ <![CDATA[
+ <attribute name="UseRegionBasedMarshalling">true</attribute>
+ ]]>
+ </programlisting>
<para>Anytime after
<literal>UseRegionBasedMarshalling</literal>
@@ -212,11 +218,12 @@
</para>
<programlisting>
+ <![CDATA[
/**
* Sets whether the entire tree is inactive upon startup, only responding
* to replication messages after {@link #activateRegion(String)} is
* called to activate one or more parts of the tree.
- * <p>
+ * <p>
* This property is only relevant if {@link #getUseRegionBasedMarshalling()} is
*
<code>true</code>
@@ -229,7 +236,7 @@
* Gets whether the entire tree is inactive upon startup, only responding
* to replication messages after {@link #activateRegion(String)} is
* called to activate one or more parts of the tree.
- * <p>
+ * <p>
* This property is only relevant if {@link #getUseRegionBasedMarshalling()} is
*
<code>true</code>
@@ -243,8 +250,8 @@
<code>subtreeFqn</code>
and to begin accepting replication messages
* for that subtree.
- * <p>
- * <strong>NOTE:</strong> This method will cause the creation of a node
+ * <p>
+ * <strong>NOTE:</strong> This method will cause the creation of a node
* in the local tree at
<code>subtreeFqn</code>
whether or not that
@@ -288,6 +295,7 @@
<code>false</code>
*/
public void inactivateRegion(String subtreeFqn) throws RegionNameConflictException, CacheException;
+ ]]>
</programlisting>
<para>Property
@@ -299,7 +307,11 @@
configuration, typically in the cache's XML configuration file:
</para>
- <programlisting><attribute name="InactiveOnStartup">true</attribute></programlisting>
+ <programlisting>
+ <![CDATA[
+ <attribute name="InactiveOnStartup">true</attribute>
+ ]]>
+ </programlisting>
<para>When
<literal>InactiveOnStartup</literal>
@@ -373,25 +385,27 @@
</para>
<programlisting>
- <?xml version="1.0" encoding="UTF-8" ?>
- <server>
- <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" />
-
- <!-- ==================================================================== -->
- <!-- Defines TreeCache configuration -->
- <!-- ==================================================================== -->
- <mbean code="org.jboss.cache.TreeCache" name="com.xyz.cache:service=SharedCache">
+ <![CDATA[
+ <?xml version="1.0" encoding="UTF-8" ?>
+ <server>
+ <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" />
+
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
+ <mbean code="org.jboss.cache.TreeCache" name="com.xyz.cache:service=SharedCache">
.......
- <!-- Configure Marshalling -->
- <attribute name="getUseRegionBasedMarshalling">true</attribute>
- <attribute name="InactiveOnStartup">true</attribute>
+ <!-- Configure Marshalling -->
+ <attribute name="getUseRegionBasedMarshalling">true</attribute>
+ <attribute name="InactiveOnStartup">true</attribute>
........
- </mbean>
- </server>
+ </mbean>
+ </server>
+ ]]>
</programlisting>
<para>For the webapp, registering/unregistering the classloader and
@@ -404,6 +418,7 @@
</para>
<programlisting>
+ <![CDATA[
package example;
import javax.management.MalformedObjectNameException;
@@ -443,6 +458,7 @@
cache = (TreeCacheMBean) MBeanProxyExt.create(TreeCacheMBean.class, cacheServiceName_);
}
}
+ ]]>
</programlisting>
<para>The listener makes use of the JBoss utility class
@@ -479,6 +495,7 @@
</para>
<programlisting>
+ <![CDATA[
/**
* Fetch a portion of the state for this cache from secondary storage
* (disk, DB) and return it as a byte buffer.
@@ -508,19 +525,20 @@
* Sets the {@link RegionManager} this object should use to manage
* marshalling/unmarshalling of different regions using different
* classloaders.
- * <p>
- * <strong>NOTE:</strong> This method is only intended to be used
+ * <p>
+ * <strong>NOTE:</strong> This method is only intended to be used
* by the
<code>TreeCache</code>
instance this cache loader is
* associated with.
- * </p>
+ * </p>
*
* @param manager the region manager to use, or
<code>null</code>
.
*/
void setRegionManager(RegionManager manager);
+ ]]>
</programlisting>
<para>JBossCache currently comes with two implementations of
1.4 +281 -226 JBossCache/docs/JBossCache-UserGuide/en/modules/cache_loaders.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: cache_loaders.xml
===================================================================
RCS file: /cvsroot/jboss/JBossCache/docs/JBossCache-UserGuide/en/modules/cache_loaders.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- cache_loaders.xml 22 Jan 2007 12:10:20 -0000 1.3
+++ cache_loaders.xml 22 Jan 2007 22:50:09 -0000 1.4
@@ -42,7 +42,8 @@
org.jboss.cache.loader.CacheLoader as follows (edited for brevity):
</para>
- <programlisting>public interface CacheLoader extends Service {
+ <programlisting><![CDATA[
+ public interface CacheLoader extends Service {
/**
* Sets the configuration. Will be called before {@link #create()} and {@link #start()}
@@ -54,11 +55,11 @@
/**
- * Returns a list of children names, all names are <em>relative</em>. Returns null if the parent node
+ * Returns a list of children names, all names are <em>relative</em>. Returns null if the parent node
is not found.
* The returned set must not be modified, e.g. use Collections.unmodifiableSet(s) to return the result
* @param fqn The FQN of the parent
- * @return Set<String>. A list of children. Returns null if no children nodes are present, or the parent is
+ * @return Set<String>. A list of children. Returns null if no children nodes are present, or the parent is
* not present
*/
Set getChildrenNames(Fqn fqn) throws Exception;
@@ -78,7 +79,7 @@
* implementations should be checked for compliance with the behaviour expected.
*
* @param name
- * @return Map<Object,Object> of keys and values for the given node. Returns null if the node is not
+ * @return Map<Object,Object> of keys and values for the given node. Returns null if the node is not
* found. If the node is found but has no attributes, this method returns an empty Map.
* @throws Exception
*/
@@ -111,7 +112,7 @@
/**
* Inserts all modifications to the backend store. Overwrite whatever is already in
* the datastore.
- * @param modifications A List<Modification> of modifications
+ * @param modifications A List<Modification> of modifications
* @throws Exception
*/
void put(List modifications) throws Exception;
@@ -131,14 +132,14 @@
/**
* Prepare the modifications. For example, for a DB-based CacheLoader:
- * <ol>
- * <li>Create a local (JDBC) transaction
- * <li>Associate the local transaction with <code>tx</code> (tx is the key)
- * <li>Execute the coresponding SQL statements against the DB (statements derived from modifications)
- * </ol>
+ * <ol>
+ * <li>Create a local (JDBC) transaction
+ * <li>Associate the local transaction with <code>tx</code> (tx is the key)
+ * <li>Execute the coresponding SQL statements against the DB (statements derived from modifications)
+ * </ol>
* For non-transactional CacheLoader (e.g. file-based), this could be a null operation
* @param tx The transaction, just used as a hashmap key
- * @param modifications List<Modification>, a list of all modifications within the given transaction
+ * @param modifications List<Modification>, a list of all modifications within the given transaction
* @param one_phase Persist immediately and (for example) commit the local JDBC transaction as well. When true,
* we won't get a {@link #commit(Object)} or {@link #rollback(Object)} method call later
*/
@@ -146,9 +147,9 @@
/**
* Commit the transaction. A DB-based CacheLoader would look up the local JDBC transaction asociated
- * with <code>tx</code> and commit that transaction<br/>
+ * with <code>tx</code> and commit that transaction<br/>
* Non-transactional CacheLoaders could simply write the data that was previously saved transiently under the
- * given <code>tx</code> key, to (for example) a file system (note this only holds if the previous
+ * given <code>tx</code> key, to (for example) a file system (note this only holds if the previous
prepare() did
* not define one_phase=true
*/
@@ -156,7 +157,7 @@
/**
* Roll the transaction back. A DB-based CacheLoader would look up the local JDBC transaction asociated
- * with <code>tx</code> and roll back that transaction
+ * with <code>tx</code> and roll back that transaction
*/
void rollback(Object tx);
@@ -171,6 +172,7 @@
/** Store the given state in secondary storage. Overwrite whatever is currently in storage */
void storeEntireState(byte[] state) throws Exception;
}
+ ]]>
</programlisting>
<para>
@@ -189,7 +191,8 @@
also implement the subinterface org.jboss.cache.loader.ExtendedCacheLoader:
</para>
- <programlisting>public interface ExtendedCacheLoader extends CacheLoader
+ <programlisting><![CDATA[
+ public interface ExtendedCacheLoader extends CacheLoader
{
/**
* Fetch a portion of the state for this cache from secondary storage
@@ -245,6 +248,7 @@
void setRegionManager(RegionManager manager);
}
+ ]]>
</programlisting>
<para>
@@ -286,7 +290,9 @@
,
</para>
- <programlisting>public interface Service {
+ <programlisting>
+ <![CDATA[
+ public interface Service {
void create() throws Exception;
void start() throws Exception;
@@ -295,6 +301,7 @@
void destroy();
}
+ ]]>
</programlisting>
<para>
@@ -414,54 +421,57 @@
file:
</para>
- <programlisting> <!-- ==================================================================== -->
- <!-- Defines TreeCache configuration -->
- <!-- ==================================================================== -->
-
- <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
-
- <!-- New 1.3.x cache loader config block -->
- <attribute name="CacheLoaderConfiguration">
- <config>
- <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
- <passivation>false</passivation>
- <!-- comma delimited FQNs to preload -->
- <preload>/</preload>
- <!-- are the cache loaders shared in a cluster? -->
- <shared>false</shared>
-
- <!-- we can now have multiple cache loaders, which get chained -->
- <!-- the 'cacheloader' element may be repeated -->
- <cacheloader>
- <class>org.jboss.cache.loader.JDBCCacheLoader</class>
- <!-- same as the old CacheLoaderConfig attribute -->
- <properties>
+ <programlisting>
+ <![CDATA[
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
+
+ <!-- New 1.3.x cache loader config block -->
+ <attribute name="CacheLoaderConfiguration">
+ <config>
+ <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
+ <passivation>false</passivation>
+ <!-- comma delimited FQNs to preload -->
+ <preload>/</preload>
+ <!-- are the cache loaders shared in a cluster? -->
+ <shared>false</shared>
+
+ <!-- we can now have multiple cache loaders, which get chained -->
+ <!-- the 'cacheloader' element may be repeated -->
+ <cacheloader>
+ <class>org.jboss.cache.loader.JDBCCacheLoader</class>
+ <!-- same as the old CacheLoaderConfig attribute -->
+ <properties>
cache.jdbc.driver=com.mysql.jdbc.Driver
cache.jdbc.url=jdbc:mysql://localhost:3306/jbossdb
cache.jdbc.user=root
cache.jdbc.password=
- </properties>
- <!-- whether the cache loader writes are asynchronous -->
- <async>false</async>
- <!-- only one cache loader in the chain may set fetchPersistentState to true.
- An exception is thrown if more than one cache loader sets this to true. -->
- <fetchPersistentState>true</fetchPersistentState>
- <!-- determines whether this cache loader ignores writes - defaults to false. -->
- <ignoreModifications>false</ignoreModifications>
- <!-- if set to true, purges the contents of this cache loader when the cache starts up.
- Defaults to false. -->
- <purgeOnStartup>false</purgeOnStartup>
- <!-- defines the cache loader as a singleton store where only the coordinator of the
+ </properties>
+ <!-- whether the cache loader writes are asynchronous -->
+ <async>false</async>
+ <!-- only one cache loader in the chain may set fetchPersistentState to true.
+ An exception is thrown if more than one cache loader sets this to true. -->
+ <fetchPersistentState>true</fetchPersistentState>
+ <!-- determines whether this cache loader ignores writes - defaults to false. -->
+ <ignoreModifications>false</ignoreModifications>
+ <!-- if set to true, purges the contents of this cache loader when the cache starts up.
+ Defaults to false. -->
+ <purgeOnStartup>false</purgeOnStartup>
+ <!-- defines the cache loader as a singleton store where only the coordinator of the
cluster will store modifications. Setting pushStateWhenCoordinator to true enables a
newly elected coordinator to push the in-memory state to the underlying cache store.
- Both default to false. -->
- <singletonStore pushStateWhenCoordinator="false">false</singletonStore>
- </cacheloader>
+ Both default to false. -->
+ <singletonStore pushStateWhenCoordinator="false">false</singletonStore>
+ </cacheloader>
- </config>
- </attribute>
+ </config>
+ </attribute>
- </mbean>
+ </mbean>
+ ]]>
</programlisting>
<para>
@@ -476,22 +486,25 @@
</para>
<para>
- <programlisting> <!-- ==================================================================== -->
- <!-- Defines TreeCache configuration -->
- <!-- ==================================================================== -->
-
- <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
- <attribute name="CacheLoaderClass">org.jboss.cache.loader.bdbje.BdbjeCacheLoader</attribute>
- <!-- attribute name="CacheLoaderClass">org.jboss.cache.loader.FileCacheLoader</attribute -->
- <attribute name="CacheLoaderConfig" replace="false">
+ <programlisting>
+ <![CDATA[
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
+ <attribute name="CacheLoaderClass">org.jboss.cache.loader.bdbje.BdbjeCacheLoader</attribute>
+ <!-- attribute name="CacheLoaderClass">org.jboss.cache.loader.FileCacheLoader</attribute -->
+ <attribute name="CacheLoaderConfig" replace="false">
location=c:\\tmp\\bdbje
- </attribute>
- <attribute name="CacheLoaderShared">true</attribute>
- <attribute name="CacheLoaderPreload">/</attribute>
- <attribute name="CacheLoaderFetchTransientState">false</attribute>
- <attribute name="CacheLoaderFetchPersistentState">true</attribute>
- <attribute name="CacheLoaderAsynchronous">true</attribute>
- </mbean>
+ </attribute>
+ <attribute name="CacheLoaderShared">true</attribute>
+ <attribute name="CacheLoaderPreload">/</attribute>
+ <attribute name="CacheLoaderFetchTransientState">false</attribute>
+ <attribute name="CacheLoaderFetchPersistentState">true</attribute>
+ <attribute name="CacheLoaderAsynchronous">true</attribute>
+ </mbean>
+ ]]>
</programlisting>
</para>
@@ -514,7 +527,7 @@
<literal>FileCacheLoader</literal>
, which is a simple
filesystem-based implementation. The
- <literal><cacheloader><properties></literal>
+ <literal><![CDATA[<cacheloader><properties>]]></literal>
element
needs to contain a "location" property, which maps to a directory where
the file is located (e.g., "location=c:\\tmp"). By default, this cache
@@ -531,7 +544,7 @@
<literal>BdbjeCacheLoader</literal>
, which is a CacheLoader
implementation based on the Sleepycat DB Java Edition. The
- <literal><cacheloader><properties></literal>
+ <literal><![CDATA[<cacheloader><properties>]]></literal>
element needs
to contain a "location" property, which maps to a directory,where the
database file for Sleepycat resides (e.g., "location=c:\\tmp").
@@ -543,7 +556,7 @@
<literal>JDBCCacheLoader</literal>
, which is a CacheLoader
implementation using JDBC to access any relational database. The
- <literal><cacheloader><properties></literal>
+ <literal><![CDATA[<cacheloader><properties>]]></literal>
element
contains a number of properties needed to connect to the
database such as username, password, and connection URL. See the
@@ -1021,7 +1034,9 @@
cache:
</para>
- <programlisting>TreeCache firstLevel, secondLevel;
+ <programlisting>
+ <![CDATA[
+ TreeCache firstLevel, secondLevel;
LocalDelegatingCacheLoader cache_loader;
// create and configure firstLevel
@@ -1041,7 +1056,7 @@
// start firstLevel
firstLevel.startService();
-
+ ]]>
</programlisting>
<para>If you need to set up a hierarchy across VMs but within a
@@ -1058,33 +1073,37 @@
:
</para>
- <programlisting><!-- ==================================================================== -->
- <!-- Defines TreeCache configuration -->
- <!-- ==================================================================== -->
+ <programlisting>
+ <![CDATA[
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
- <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
+ <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
...
- <attribute name="CacheLoaderConfiguration">
- <config>
- <passivation>false</passivation>
- <preload>/some/stuff</preload>
- <cacheloader>
- <class>org.jboss.cache.loader.RpcDelegatingCacheLoader</class>
- <!-- whether the cache loader writes are asynchronous -->
- <async>false</async>
- <!-- only one cache loader in the chain may set fetchPersistentState to true.
- An exception is thrown if more than one cache loader sets this to true. -->
- <fetchPersistentState>false</fetchPersistentState>
- <!-- determines whether this cache loader ignores writes - defaults to false. -->
- <ignoreModifications>false</ignoreModifications>
- <!-- if set to true, purges the contents of this cache loader when the cache starts up.
- Defaults to false. -->
- <purgeOnStartup>false</purgeOnStartup>
- </cacheloader>
- </config>
- </attribute>
+ <attribute name="CacheLoaderConfiguration">
+ <config>
+ <passivation>false</passivation>
+ <preload>/some/stuff</preload>
+ <cacheloader>
+ <class>org.jboss.cache.loader.RpcDelegatingCacheLoader</class>
+ <!-- whether the cache loader writes are asynchronous -->
+ <async>false</async>
+ <!-- only one cache loader in the chain may set fetchPersistentState to true.
+ An exception is thrown if more than one cache loader sets this to true. -->
+ <fetchPersistentState>false</fetchPersistentState>
+ <!-- determines whether this cache loader ignores writes - defaults to false. -->
+ <ignoreModifications>false</ignoreModifications>
+ <!-- if set to true, purges the contents of this cache loader when the cache starts up.
+ Defaults to false. -->
+ <purgeOnStartup>false</purgeOnStartup>
+ </cacheloader>
+ </config>
+ </attribute>
...
- </mbean></programlisting>
+ </mbean>
+ ]]>
+ </programlisting>
<para>Note that currently (JBossCache 1.3.0) this cache loader is not
well supported, and has not been tested. We suggest to use
@@ -1123,20 +1142,24 @@
shown below:
</para>
- <programlisting><server>
-
- <classpath codebase="./lib" archives="jboss-cache.jar"/>
+ <programlisting>
+ <![CDATA[
+ <server>
+
+ <classpath codebase="./lib" archives="jboss-cache.jar"/>
+
+ <mbean code="org.jboss.cache.loader.tcp.TcpCacheServer" name="jboss.cache:service=TcpCacheServer">
+ <depends optional-attribute-name="Cache"
+ proxy-type="attribute">jboss.cache:service=TreeCache</depends>
+ <attribute name="BindAddress">${jboss.bind.address:localhost}</attribute>
+ <attribute name="Port">7500</attribute>
+ <attribute name="MBeanServerName"></attribute>
+ <!--<attribute name="CacheName">jboss.cache:service=TreeCache</attribute>-->
+ </mbean>
- <mbean code="org.jboss.cache.loader.tcp.TcpCacheServer" name="jboss.cache:service=TcpCacheServer">
- <depends optional-attribute-name="Cache"
- proxy-type="attribute">jboss.cache:service=TreeCache</depends>
- <attribute name="BindAddress">${jboss.bind.address:localhost}</attribute>
- <attribute name="Port">7500</attribute>
- <attribute name="MBeanServerName"></attribute>
- <!--<attribute name="CacheName">jboss.cache:service=TreeCache</attribute>-->
- </mbean>
-
- </server> </programlisting>
+ </server>
+ ]]>
+ </programlisting>
<para>The BindAddress and Port define where its server socket is
listening on, and an existing JBossCache MBean is injected into it
@@ -1153,17 +1176,21 @@
<para>The client side looks as follow:</para>
- <programlisting><attribute name="CacheLoaderConfiguration">
- <config>
- <cacheloader>
- <class>org.jboss.cache.loader.TcpDelegatingCacheLoader</class>
- <properties>
+ <programlisting>
+ <![CDATA[
+ <attribute name="CacheLoaderConfiguration">
+ <config>
+ <cacheloader>
+ <class>org.jboss.cache.loader.TcpDelegatingCacheLoader</class>
+ <properties>
host=localhost
port=7500
- </properties>
- </cacheloader>
- </config>
- </attribute></programlisting>
+ </properties>
+ </cacheloader>
+ </config>
+ </attribute>
+ ]]>
+ </programlisting>
<para>This means this instance of JBossCache will delegate all load
and store requests to the remote TcpCacheServer running at
@@ -1215,22 +1242,26 @@
shown below:
</para>
- <programlisting><server>
-
- <classpath codebase="./lib" archives="jboss-cache.jar"/>
-
- <mbean code="org.jboss.cache.loader.rmi.RmiCacheServer" name="jboss.cache:service=RmiCacheServer">
- <depends optional-attribute-name="Cache"
- proxy-type="attribute">jboss.cache:service=TreeCache</depends>
- <!-- the address and port of the RMI server. -->
- <attribute name="BindAddress">${jboss.bind.address:localhost}</attribute>
- <attribute name="Port">1098</attribute>
- <attribute name="BindName">MyRmiCacheServer</attribute>
- <attribute name="MBeanServerName"></attribute>
- <!--<attribute name="CacheName">jboss.cache:service=TreeCache</attribute>-->
- </mbean>
+ <programlisting>
+ <![CDATA[
+ <server>
+
+ <classpath codebase="./lib" archives="jboss-cache.jar"/>
+
+ <mbean code="org.jboss.cache.loader.rmi.RmiCacheServer" name="jboss.cache:service=RmiCacheServer">
+ <depends optional-attribute-name="Cache"
+ proxy-type="attribute">jboss.cache:service=TreeCache</depends>
+ <!-- the address and port of the RMI server. -->
+ <attribute name="BindAddress">${jboss.bind.address:localhost}</attribute>
+ <attribute name="Port">1098</attribute>
+ <attribute name="BindName">MyRmiCacheServer</attribute>
+ <attribute name="MBeanServerName"></attribute>
+ <!--<attribute name="CacheName">jboss.cache:service=TreeCache</attribute>-->
+ </mbean>
- </server> </programlisting>
+ </server>
+ ]]>
+ </programlisting>
<para>The BindAddress and Port should point to an already-running RMI server and the BindName is the name the
object is bound to in the RMI server. An existing JBossCache MBean is injected into it
@@ -1247,18 +1278,22 @@
<para>The client side looks as follow:</para>
- <programlisting><attribute name="CacheLoaderConfiguration">
- <config>
- <cacheloader>
- <class>org.jboss.cache.loader.RmiDelegatingCacheLoader</class>
- <properties>
+ <programlisting>
+ <![CDATA[
+ <attribute name="CacheLoaderConfiguration">
+ <config>
+ <cacheloader>
+ <class>org.jboss.cache.loader.RmiDelegatingCacheLoader</class>
+ <properties>
host=localhost
port=1098
name=MyRmiCacheServer
- </properties>
- </cacheloader>
- </config>
- </attribute></programlisting>
+ </properties>
+ </cacheloader>
+ </config>
+ </attribute>
+ ]]>
+ </programlisting>
<para>This means this instance of JBossCache will delegate all load
and store requests to the remote RmiCacheServer running as MyRmiCacheServer on an RMI server running on
@@ -1316,7 +1351,8 @@
<para>See
<ulink
- url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JDBCCacheLoader">http://wiki.jboss.org/wiki/Wiki.jsp?page=JDBCCacheLoader
+ url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JDBCCacheLoader">
+ http://wiki.jboss.org/wiki/Wiki.jsp?page=JDBCCacheLoader
</ulink>
for configuration tips with specific database systems.
</para>
@@ -1443,21 +1479,28 @@
<title>c3p0 connection pooling</title>
<para>JBoss Cache now implements JDBC connection pooling when running JBossCache standalone using
- the c3p0:JDBC DataSources/Resource Pools library. In order to enable it, just edit the following property:
+ the c3p0:JDBC DataSources/Resource Pools library. In order to enable it, just edit the following
+ property:
<itemizedlist>
- <listitem><emphasis>cache.jdbc.connection.factory</emphasis>- Connection factory class name.
+ <listitem>
+ <emphasis>cache.jdbc.connection.factory</emphasis>
+ - Connection factory class name.
If not set, it defaults to standard non pooled implementation. To enable c3p0 pooling, just set the
- connection factory class for c3p0. See example below.</listitem>
- </itemizedlist></para>
+ connection factory class for c3p0. See example below.
+ </listitem>
+ </itemizedlist>
+ </para>
<para>You can also set any c3p0 parameters in the same cache loader properties section but don't forget to
start the property name with 'c3p0.'. To find a list of available properties, please check the
c3p0 documentation for the c3p0 library version distributed in
- <ulink url="http://sourceforge.net/projects/c3p0">c3p0:JDBC DataSources/Resource Pools</ulink>.
+ <ulink url="http://sourceforge.net/projects/c3p0">c3p0:JDBC DataSources/Resource Pools</ulink>
+ .
Also, in order to provide quick and easy way to try out different pooling
parameters, any of these properties can be set via a System property overriding any values these
properties might have in the JBoss Cache XML configuration file, for example:
- <literal>-Dc3p0.maxPoolSize=20</literal>.
+ <literal>-Dc3p0.maxPoolSize=20</literal>
+ .
If a c3p0 property is not defined in either the configuration file or as a System property, default
value, as indicated in the c3p0 documentation, will apply.
</para>
@@ -1473,14 +1516,16 @@
</para>
<para>
- <programlisting><attribute name="CacheLoaderConfiguration">
- <config>
- <passivation>false</passivation>
- <preload>/some/stuff</preload>
- <cacheloader>
- <class>org.jboss.cache.loader.JDBCCacheLoader</class>
- <!-- same as the old CacheLoaderConfig attribute -->
- <properties>
+ <programlisting>
+ <![CDATA[
+ <attribute name="CacheLoaderConfiguration">
+ <config>
+ <passivation>false</passivation>
+ <preload>/some/stuff</preload>
+ <cacheloader>
+ <class>org.jboss.cache.loader.JDBCCacheLoader</class>
+ <!-- same as the old CacheLoaderConfig attribute -->
+ <properties>
cache.jdbc.table.name=jbosscache
cache.jdbc.table.create=true
cache.jdbc.table.drop=true
@@ -1494,60 +1539,68 @@
cache.jdbc.url=jdbc:oracle:thin:@localhost:1521:JBOSSDB
cache.jdbc.user=SCOTT
cache.jdbc.password=TIGER
- </properties>
- <!-- whether the cache loader writes are asynchronous -->
- <async>false</async>
- <!-- only one cache loader in the chain may set fetchPersistentState to true.
- An exception is thrown if more than one cache loader sets this to true. -->
- <fetchPersistentState>true</fetchPersistentState>
- <!-- determines whether this cache loader ignores writes - defaults to false. -->
- <ignoreModifications>false</ignoreModifications>
- <!-- if set to true, purges the contents of this cache loader when the cache starts up.
- Defaults to false. -->
- <purgeOnStartup>false</purgeOnStartup>
- </cacheloader>
- </config>
- </attribute></programlisting>
+ </properties>
+ <!-- whether the cache loader writes are asynchronous -->
+ <async>false</async>
+ <!-- only one cache loader in the chain may set fetchPersistentState to true.
+ An exception is thrown if more than one cache loader sets this to true. -->
+ <fetchPersistentState>true</fetchPersistentState>
+ <!-- determines whether this cache loader ignores writes - defaults to false. -->
+ <ignoreModifications>false</ignoreModifications>
+ <!-- if set to true, purges the contents of this cache loader when the cache starts up.
+ Defaults to false. -->
+ <purgeOnStartup>false</purgeOnStartup>
+ </cacheloader>
+ </config>
+ </attribute>
+ ]]>
+ </programlisting>
</para>
<para>As an alternative to configuring the entire JDBC connection,
the name of an existing data source can be given:
</para>
- <programlisting><attribute name="CacheLoaderConfiguration">
- <config>
- <passivation>false</passivation>
- <preload>/some/stuff</preload>
- <cacheloader>
- <class>org.jboss.cache.loader.JDBCCacheLoader</class>
- <!-- same as the old CacheLoaderConfig attribute -->
- <properties>
+ <programlisting>
+ <![CDATA[
+ <attribute name="CacheLoaderConfiguration">
+ <config>
+ <passivation>false</passivation>
+ <preload>/some/stuff</preload>
+ <cacheloader>
+ <class>org.jboss.cache.loader.JDBCCacheLoader</class>
+ <!-- same as the old CacheLoaderConfig attribute -->
+ <properties>
cache.jdbc.datasource=java:/DefaultDS
- </properties>
- <!-- whether the cache loader writes are asynchronous -->
- <async>false</async>
- <!-- only one cache loader in the chain may set fetchPersistentState to true.
- An exception is thrown if more than one cache loader sets this to true. -->
- <fetchPersistentState>true</fetchPersistentState>
- <!-- determines whether this cache loader ignores writes - defaults to false. -->
- <ignoreModifications>false</ignoreModifications>
- <!-- if set to true, purges the contents of this cache loader when the cache starts up.
- Defaults to false. -->
- <purgeOnStartup>false</purgeOnStartup>
- </cacheloader>
- </config>
- </attribute></programlisting>
+ </properties>
+ <!-- whether the cache loader writes are asynchronous -->
+ <async>false</async>
+ <!-- only one cache loader in the chain may set fetchPersistentState to true.
+ An exception is thrown if more than one cache loader sets this to true. -->
+ <fetchPersistentState>true</fetchPersistentState>
+ <!-- determines whether this cache loader ignores writes - defaults to false. -->
+ <ignoreModifications>false</ignoreModifications>
+ <!-- if set to true, purges the contents of this cache loader when the cache starts up.
+ Defaults to false. -->
+ <purgeOnStartup>false</purgeOnStartup>
+ </cacheloader>
+ </config>
+ </attribute>
+ ]]>
+ </programlisting>
<para>Cconfiguration example for a cache loader using c3p0 JDBC connection pooling:</para>
- <programlisting><attribute name="CacheLoaderConfiguration">
- <config>
- <passivation>false</passivation>
- <preload>/some/stuff</preload>
- <cacheloader>
- <class>org.jboss.cache.loader.JDBCCacheLoader</class>
- <!-- same as the old CacheLoaderConfig attribute -->
- <properties>
+ <programlisting>
+ <![CDATA[
+ <attribute name="CacheLoaderConfiguration">
+ <config>
+ <passivation>false</passivation>
+ <preload>/some/stuff</preload>
+ <cacheloader>
+ <class>org.jboss.cache.loader.JDBCCacheLoader</class>
+ <!-- same as the old CacheLoaderConfig attribute -->
+ <properties>
cache.jdbc.table.name=jbosscache
cache.jdbc.table.create=true
cache.jdbc.table.drop=true
@@ -1564,20 +1617,22 @@
cache.jdbc.connection.factory=org.jboss.cache.loader.C3p0ConnectionFactory
c3p0.maxPoolSize=20
c3p0.checkoutTimeout=5000
- </properties>
- <!-- whether the cache loader writes are asynchronous -->
- <async>false</async>
- <!-- only one cache loader in the chain may set fetchPersistentState to true.
- An exception is thrown if more than one cache loader sets this to true. -->
- <fetchPersistentState>true</fetchPersistentState>
- <!-- determines whether this cache loader ignores writes - defaults to false. -->
- <ignoreModifications>false</ignoreModifications>
- <!-- if set to true, purges the contents of this cache loader when the cache starts up.
- Defaults to false. -->
- <purgeOnStartup>false</purgeOnStartup>
- </cacheloader>
- </config>
- </attribute></programlisting>
+ </properties>
+ <!-- whether the cache loader writes are asynchronous -->
+ <async>false</async>
+ <!-- only one cache loader in the chain may set fetchPersistentState to true.
+ An exception is thrown if more than one cache loader sets this to true. -->
+ <fetchPersistentState>true</fetchPersistentState>
+ <!-- determines whether this cache loader ignores writes - defaults to false. -->
+ <ignoreModifications>false</ignoreModifications>
+ <!-- if set to true, purges the contents of this cache loader when the cache starts up.
+ Defaults to false. -->
+ <purgeOnStartup>false</purgeOnStartup>
+ </cacheloader>
+ </config>
+ </attribute>
+ ]]>
+ </programlisting>
</section>
</section>
1.1 date: 2007/01/22 22:50:09; author: msurtani; state: Exp;JBossCache/docs/JBossCache-UserGuide/en/modules/deployment.xml
Index: deployment.xml
===================================================================
<chapter id="deployment">
<title>Deploying JBoss Cache</title>
<section>
<title>Standalone Use</title>
<para>TODO</para>
</section>
<section>
<title>Via JNDI</title>
<para>TODO</para>
</section>
<section>
<title>Via JMX (JBoss AS 4.x)</title>
<para>If JBoss Cache is run in JBoss AS then JBoss Cache can be deployed as an
MBean. The steps below illustrate how to do this. We do not deploy JBoss Cache as a
Service Archive (SAR), but as a JAR (
<literal>jboss-cache.jar</literal>
in the lib directory) and
an XML file defining the MBean. Of course, JBoss Cache can also be
deployed as a SAR, or even as part of a WAR, EJB or EAR.
</para>
<para>First, the
<literal>jboss-cache.jar</literal>
file has to be copied to the /lib
directory and JBoss AS has to be restarted. Then a regular JBoss Cache
configuration file in XML format has to be copied to the /deploy
directory. The XML file format is the same as discussed in
the Configuration chapter.
</para>
<para>In order to be used from a client such as a servlet in the Tomcat web
container inside the same JBoss container, JMX can be used:
</para>
<programlisting>
<![CDATA[
MBeanServer server=MBeanServerLocator.locateJBoss();
TreeCacheMBean cache;
cache=(TreeCacheMBean)MBeanProxyExt.create(TreeCacheMBean.class, "jboss.cache:service=TreeCache", server);
cache.put("/a/b/c", null);
]]>
</programlisting>
<para>The MBeanServerLocator class is a helper to find the (only) JBoss
MBean server inside the current VM. The static create() method creates a
dynamic proxy to the given interface and uses JMX to dynamically dispatch
methods invoked against the generated interface. The name used to look up
the MBean is the same as defined in the configuration file.
</para>
<section>
<title>Running as an MBean</title>
<para>If JBoss Cache is run inside of JBoss AS (as an MBean), we can bind it
into JNDI using JrmpProxyFactory, just like any other MBean. Below is an
example of how to do this:
<programlisting>
<![CDATA[
<mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
name="mydomain:service=proxyFactory,type=jrmp,target=factory">
<attribute
name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
<attribute
name="TargetName">jboss.cache:service=TreeCache</attribute>
<attribute name="JndiName">MyCache</attribute> <attribute
name="InvokeTargetMethod">true</attribute> <attribute
name="ExportedInterface">org.jboss.cache.TreeCacheMBean</attribute>
<attribute name="ClientInterceptors"> <iterceptors>
<interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
<interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</iterceptors> </attribute>
<depends>jboss:service=invoker,type=jrmp</depends>
<depends>jboss.cache:service=TreeCache</depends>
</mbean>
]]>
</programlisting>
</para>
<para>The
<literal>InvokerName</literal>
attribute needs to point to a
valid JBoss invoker MBean.
<literal>TargetName</literal>
is the JMX name
of the MBean that needs to be bound into JNDI.
<literal>JndiName</literal>
is the name under which the MBean will be
bound, and
<literal>ExportedInterface</literal>
is the interface name of
the MBean.
</para>
</section>
</section>
<section>
<title>Via JBoss Microcontainer (JBoss AS 5.x)</title>
<para>TODO</para>
</section>
<section>
<title>Runtime Management Information</title>
<para>JBoss Cache includes JMX MBeans to expose cache functionality and provide statistics that can be
used to analyze cache operations. JBoss Cache can also broadcast cache events as MBean notifications for
handling
via JMX monitoring tools.
</para>
<section>
<title>JBoss Cache MBeans</title>
<para>JBoss Cache provides an MBean that allows JMX access to a cache instance. This MBean is accessible from
an
MBean
server through the service name specified in the cache instance's configuration. For example, the Tomcat
clustering cache instance
is accessible through the service named "jboss.cache:service=TomcatClusteringCache." This MBean can be used
to
perform
most cache operations via JMX.
</para>
<para>JBoss Cache also provides MBeans for each interceptor configured in the cache's interceptor stack. These
MBeans
are used to capture and expose statistics related to cache operations. They are hierarchically associated
with
the
cache's primary MBean and have service names that reflect this relationship. For example, a replication
interceptor MBean
for the TomcatClusteringCache instance will be accessible through the service named
"jboss.cache:service=TomcatClusteringCache,treecache-interceptor=ReplicationInterceptor."
</para>
</section>
<section>
<title>JBoss Cache Statistics</title>
<para>JBoss Cache captures statistics in its interceptors and exposes the statistics through interceptor
MBeans.
Cache interceptor
MBeans are enabled by default; these MBeans can be disabled for a specific cache instance through the
<emphasis>UseInterceptorMbeans</emphasis>
attribute. See the Configuration chapter for further details on configuration of this
attribute.
</para>
<para>Each interceptor's MBean provides an attribute that can be used to disable maintenance of statistics for
that interceptor.
Note that the majority of the statistics are provided by the CacheMgmtInterceptor MBean so this interceptor
is
the most significant
in this regard. If you want to disable all statistics for performance reasons, you should utilize the
<emphasis>UseInterceptorMbeans</emphasis>
configuration setting as this will prevent the CacheMgmtInterceptor from being included in the cache's
interceptor stack when the
cache is started.
</para>
<para>Each interceptor provides the following common operations and attributes.</para>
<itemizedlist>
<listitem>dumpStatistics - returns a Map containing the interceptor's attributes and values.</listitem>
<listitem>resetStatistics - resets all statistics maintained by the interceptor.</listitem>
<listitem>setStatisticsEnabled(boolean) - allows statistics to be disabled for a specific interceptor.
</listitem>
</itemizedlist>
<para>See the section in the
<link
linkend="jmx_reference.statistics">JMX Reference chapter
</link>
pertaining to the statistics that are made available via JMX.
</para>
</section>
<section>
<title>Receiving Cache Notifications</title>
<para>JBoss Cache users can register a listener to receive cache events as described in the Eviction Policies
chapter.
Users can alternatively utilize the cache's management information infrastructure to receive these events
via
JMX
notifications. Cache events are accessible as notifications by registering a NotificationListener for the
CacheMgmtInterceptor
MBean. This functionality is only available if cache statistics are enabled as described in the previous
section.
</para>
<para>See the section in the
<link linkend="jmx_reference.notifications">JMX Reference chapter</link>
pertaining to JMX notifications
for a list of notifications that can be received through the
<literal>CacheMgmtInterceptor</literal>
MBean.
</para>
<para>The following is an example of how to programmatically receive cache notifications when running in a
JBoss
application server
environment. In this example, the client uses a filter to specify which events are of interest.
</para>
<programlisting>
<![CDATA[
MyListener listener = new MyListener();
NotificationFilterSupport filter = null;
// get reference to MBean server
Context ic = new InitialContext();
MBeanServerConnection server = (MBeanServerConnection)ic.lookup("jmx/invoker/RMIAdaptor");
// get reference to CacheMgmtInterceptor MBean
String cache_service = "jboss.cache:service=TomcatClusteringCache";
String mgmt_service = cache_service + ",treecache-interceptor=CacheMgmtInterceptor";
ObjectName mgmt_name = new ObjectName(mgmt_service);
// configure a filter to only receive node created and removed events
filter = new NotificationFilterSupport();
filter.disableAllTypes();
filter.enableType(CacheMgmtInterceptor.NOTIF_NODE_CREATED);
filter.enableType(CacheMgmtInterceptor.NOTIF_NODE_REMOVED);
// register the listener with a filter
// leave the filter null to receive all cache events
server.addNotificationListener(mgmt_name, listener, filter, null);
// ...
// on completion of processing, unregister the listener
server.removeNotificationListener(mgmt_name, listener, filter, null);
]]>
</programlisting>
<para>The following is the simple notification listener implementation used in the previous example.</para>
<programlisting>
<![CDATA[
private class MyListener implements NotificationListener, Serializable {
public void handleNotification(Notification notification, Object handback) {
String message = notification.getMessage();
String type = notification.getType();
Object userData = notification.getUserData();
System.out.println(type + ": "+message);
if (userData == null) {
System.out.println("notification data is null");
}
else if (userData instanceof String) {
System.out.println("notification data: "+(String)userData);
}
else if (userData instanceof Object[]) {
Object[] ud = (Object[])userData;
for (int i = 0; i > ud.length; i++) {
System.out.println("notification data: "+ud[i].toString());
}
}
else {
System.out.println("notification data class: " + userData.getClass().getName());
}
}
}
]]>
</programlisting>
<para>Note: the JBoss Cache management implementation only listens to cache events after a client registers to
receive MBean notifications. As soon as no clients are registered for notifications, the MBean will remove
itself
as a cache listener.
</para>
</section>
<section>
<title>Accessing Cache MBeans in a Standalone Environment</title>
<para>JBoss Cache MBeans are readily accessed when running cache instances in an application server that
provides
an MBean server interface such as JBoss JMX Console. Refer to server documentation for instructions on how
to
access
MBeans running in a server's MBean container.
</para>
<para>JBoss Cache MBeans are also accessible when running in a non-server environment if the JVM is JDK 5.0 or
later.
When running a standalone cache in a JDK 5 environment, you can access the cache's MBeans as follows.
</para>
<para>
<orderedlist>
<listitem>Set the system property
<emphasis>-Dcom.sun.management.jmxremote</emphasis>
when starting the JVM
where the cache will run.
</listitem>
<listitem>Once the JVM is running, start the JDK 5
<emphasis>jconsole</emphasis>
utility, located in the JDK's /bin directory.
</listitem>
<listitem>When the utility loads, you will be able to select your JVM and connect to it. The JBoss Cache
MBeans will be
available on the MBeans panel.
</listitem>
</orderedlist>
</para>
<para>Note: The
<emphasis>jconsole</emphasis>
utility will automatically register as a listener for cache notifications when connected
to a JVM running JBoss Cache instances.
</para>
<para>The following figure shows cache interceptor MBeans in
<emphasis>jconsole</emphasis>
. Cache statistics are displayed
for the CacheMgmt interceptor:
</para>
<figure>
<title>CacheMgmtInterceptor MBean</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/CacheMgmtInterceptor.png"/>
</imageobject>
</mediaobject>
</figure>
</section>
</section>
</chapter>
1.1 date: 2007/01/22 22:50:09; author: msurtani; state: Exp;JBossCache/docs/JBossCache-UserGuide/en/modules/configuration_reference.xml
Index: configuration_reference.xml
===================================================================
<chapter id="configuration_reference">
<title>
Definition of XML attributes
</title>
<para>A list of definitions of each of the XML attributes used above:</para>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row>
<entry>
<para>Name</para>
</entry>
<entry>
<para>Description</para>
</entry>
</row>
<row>
<entry>
<para>MarshallerClass</para>
</entry>
<entry>
<para>An instance of org.jboss.cache.marshall.Marshaller used to serialize data to byte streams.
Defaults to o.j.c.m.VersionAwareMarshaller if not specified.
</para>
</entry>
</row>
<row>
<entry>
<para>BuddyReplicationConfig</para>
</entry>
<entry>
<para>An XML element that contains detailed buddy replication
configuration. See section above on Buddy Replication.
</para>
</entry>
</row>
<row>
<entry>
<para>CacheLoaderConfiguration</para>
</entry>
<entry>
<para>An XML element that contains detailed cache loader
configuration. See section above on Cache Loaders.
</para>
</entry>
</row>
<row>
<entry>
<para>CacheMode</para>
</entry>
<entry>
<para>LOCAL, REPL_SYNC, REPL_ASYNC, INVALIDATION_SYNC or
INVALIDATION_ASYNC
</para>
</entry>
</row>
<row>
<entry>
<para>ClusterConfig</para>
</entry>
<entry>
<para>The configuration of the underlying JGroups stack.
Ignored if
<literal>MultiplexerService</literal>
and
<literal>MultiplexerStack</literal>
are used.
See the various *-service.xml files in the source distribution
<literal>etc/META-INF</literal>
folder for examples.
See the
<ulink url="http://www.jgroups.org">JGroups documentation</ulink>
or the
<ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups">JGroups wiki page</ulink>
for more information.
</para>
</entry>
</row>
<row>
<entry>
<para>ClusterName</para>
</entry>
<entry>
<para>Name of cluster. Needs to be the same for all nodes in a
cluster in order for them to communicate with each other.
</para>
</entry>
</row>
<row>
<entry>
<para>EvictionPolicyClass</para>
</entry>
<entry>
<para>The name of a class implementing EvictionPolicy. Deprecated;
it is preferable to configure the eviction policy class as
part of the
<literal>EvictionPolicyConfig</literal>
.
</para>
</entry>
</row>
<row>
<entry>
<para>EvictionPolicyConfig</para>
</entry>
<entry>
<para>Configuration parameter for the specified eviction policy.
Note that the content is provider specific.
</para>
</entry>
</row>
<row>
<entry>
<para>FetchInMemoryState (renamed from
FetchStateOnStartup)
</para>
</entry>
<entry>
<para>Whether or not to acquire the initial in-memory state from
existing members. Allows for hot/cold caches (true/false). Also
see the fetchPersistentState element in
CacheLoaderConfiguration.
</para>
</entry>
</row>
<row>
<entry>
<para>InactiveOnStartup</para>
</entry>
<entry>
<para>Whether or not the entire tree is inactive upon startup,
only responding to replication messages after
<literal>activateRegion()</literal>
is called to activate one or
more parts of the tree. If true, property
<literal>FetchInMemoryState</literal>
is ignored. This property
should only be set to true if
<literal>UseRegionBasedMarshalling</literal>
is also
<literal>true</literal>
.
</para>
</entry>
</row>
<row>
<entry>
<para>InitialStateRetrievalTimeout</para>
</entry>
<entry>
<para>Time in milliseconds to wait for initial state
retrieval. This should be longer than
<literal>LockAcquisitionTimeout</literal>
as the node
providing state may need to wait that long to acquire
necessary read locks on the cache.
</para>
</entry>
</row>
<row>
<entry>
<para>IsolationLevel</para>
</entry>
<entry>
<para>Node locking isolation level : SERIALIZABLE, REPEATABLE_READ
(default), READ_COMMITTED, READ_UNCOMMITTED, and NONE. Note that this is ignored if
NodeLockingScheme is OPTIMISTIC. Case doesn't matter. See documentation on Transactions and
Concurrency for more details.
</para>
</entry>
</row>
<row>
<entry>
<para>LockAcquisitionTimeout</para>
</entry>
<entry>
<para>Time in milliseconds to wait for a lock to be acquired. If
a lock cannot be acquired an exception will be thrown.
</para>
</entry>
</row>
<row>
<entry>
<para>MultiplexerService</para>
</entry>
<entry>
<para>The JMX object name of the service that defines the JGroups multiplexer.
In JBoss AS 5 this service is normally defined in the jgroups-multiplexer.sar.
If this attribute is defined, the cache will look up the multiplexer service
in JMX and will use it to obtain a multiplexed JGroups channel. The configuration
of the channel will be that associated with
<literal>MultiplexerStack</literal>
.
The
<literal>ClusterConfig</literal>
attribute will be ignored.
</para>
</entry>
</row>
<row>
<entry>
<para>MultiplexerStack</para>
</entry>
<entry>
<para>The name of the JGroups stack to be used with the TreeCache cluster.
Stacks are defined in the configuration of the external
<literal>MultiplexerService</literal>
discussed above. In JBoss AS 5 this is normally done in the
jgroups-multiplexer.sar\META-INF\multiplexer-stacks.xml file.
The default stack is
<literal>udp</literal>
. This attribute is used in conjunction with
<literal>MultiplexerService</literal>
.
</para>
</entry>
</row>
<row>
<entry>
<para>NodeLockingScheme</para>
</entry>
<entry>
<para>May be PESSIMISTIC (default) or OPTIMISTIC. See documentation on Transactions and Concurrency
for more details.
</para>
</entry>
</row>
<row>
<entry>
<para>ReplicationVersion</para>
</entry>
<entry>
<para>Tells the cache to serialize cluster traffic
in a format consistent with that used by the given release
of JBoss Cache. Different JBoss Cache versions use different
wire formats; setting this attribute tells a cache from a later
release to serialize data using the format from an earlier
release. This allows caches from different releases to
interoperate. For example, a 1.2.4.SP2 cache could have this
value set to "1.2.3", allowing it to interoperate with a 1.2.3
cache. Valid values are a dot-separated release number, with
any SP qualifer also separated by a dot, e.g. "1.2.3" or "1.2.4.SP2".
</para>
</entry>
</row>
<row>
<entry>
<para>ReplQueueInterval</para>
</entry>
<entry>
<para>Time in milliseconds for elements from the replication
queue to be replicated.
</para>
</entry>
</row>
<row>
<entry>
<para>ReplQueueMaxElements</para>
</entry>
<entry>
<para>Max number of elements in the replication queue until
replication kicks in.
</para>
</entry>
</row>
<row>
<entry>
<para>SyncCommitPhase</para>
</entry>
<entry>
<para>This option is used to control the behaviour of the commit part of a 2-phase commit protocol,
when
using REPL_SYNC (does not apply to other cache modes). By default this is set to
<literal>false</literal>
. There is a performance penalty to enabling this, especially when running
in a large cluster, but the upsides are greater cluster-wide data integrity. See the chapter on
Clustered Caches for more information on this.
</para>
</entry>
</row>
<row>
<entry>
<para>SyncReplTimeout</para>
</entry>
<entry>
<para>For synchronous replication: time in milliseconds to wait
until replication acks have been received from all nodes in the
cluster.
</para>
</entry>
</row>
<row>
<entry>
<para>SyncRollbackPhase</para>
</entry>
<entry>
<para>This option is used to control the behaviour of the rollback part of a 2-phase commit
protocol, when
using REPL_SYNC (does not apply to other cache modes). By default this is set to
<literal>false</literal>
. There is a performance penalty to enabling this, especially when running
in a large cluster, but the upsides are greater cluster-wide data integrity. See the chapter on
Clustered Caches for more information on this.
</para>
</entry>
</row>
<row>
<entry>
<para>TransactionManagerLookupClass</para>
</entry>
<entry>
<para>The fully qualified name of a class implementing
TransactionManagerLookup. Default is
JBossTransactionManagerLookup. There is also an option of
DummyTransactionManagerLookup for example.
</para>
</entry>
</row>
<row>
<entry>
<para>UseInterceptorMbeans</para>
</entry>
<entry>
<para>Specifies whether each interceptor should have an associated
mbean registered. Interceptor mbeans are used to capture statistics
and display them in JMX. This setting enables or disables all such interceptor
mbeans. Default value is
<emphasis>true</emphasis>
.
</para>
</entry>
</row>
<row>
<entry>
<para>UseRegionBasedMarshalling</para>
</entry>
<entry>
<para>When unmarshalling replicated data, this option specifies whether or not to use
different classloaders (for different cache regions). This defaults to
<literal>false</literal>
if unspecified.
</para>
</entry>
</row>
<row>
<entry>
<para>UseReplQueue</para>
</entry>
<entry>
<para>For asynchronous replication: whether or not to use a
replication queue (true/false).
</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</chapter>
1.1 date: 2007/01/22 22:50:09; author: msurtani; state: Exp;JBossCache/docs/JBossCache-UserGuide/en/modules/jmx_reference.xml
Index: jmx_reference.xml
===================================================================
<chapter id="jmx_reference">
<title>JMX References</title>
<section id="jmx_reference.statistics">
<title>JBoss Cache Statistics</title>
<para>
The following table describes the statistics currently available and may be collected via JMX.
</para>
<table>
<title>JBoss Cache Management Statistics</title>
<tgroup cols="4">
<colspec colnum="1" colwidth="2*"/>
<colspec colnum="2" colwidth="2*"/>
<colspec colnum="3" colwidth="1*"/>
<colspec colnum="4" colwidth="3*"/>
<thead>
<row>
<entry>MBean Name</entry>
<entry>Attribute</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>ActivationInterceptor</entry>
<entry>Activations</entry>
<entry>long</entry>
<entry>Number of passivated nodes that have been activated.</entry>
</row>
<row>
<entry>CacheLoaderInterceptor</entry>
<entry>CacheLoaderLoads</entry>
<entry>long</entry>
<entry>Number of nodes loaded through a cache loader.</entry>
</row>
<row>
<entry>CacheLoaderInterceptor</entry>
<entry>CacheLoaderMisses</entry>
<entry>long</entry>
<entry>Number of unsuccessful attempts to load a node through a cache loader.</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>Hits</entry>
<entry>long</entry>
<entry>Number of successful attribute retrievals.</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>Misses</entry>
<entry>long</entry>
<entry>Number of unsuccessful attribute retrievals.</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>Stores</entry>
<entry>long</entry>
<entry>Number of attribute store operations.</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>Evictions</entry>
<entry>long</entry>
<entry>Number of node evictions.</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>NumberOfAttributes</entry>
<entry>int</entry>
<entry>Number of attributes currently cached.</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>NumberOfNodes</entry>
<entry>int</entry>
<entry>Number of nodes currently cached.</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>ElapsedTime</entry>
<entry>long</entry>
<entry>Number of seconds that the cache has been running.</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>TimeSinceReset</entry>
<entry>long</entry>
<entry>Number of seconds since the cache statistics have been reset.</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>AverageReadTime</entry>
<entry>long</entry>
<entry>Average time in milliseconds to retrieve a cache attribute, including unsuccessful
attribute retrievals.
</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>AverageWriteTime</entry>
<entry>long</entry>
<entry>Average time in milliseconds to write a cache attribute.</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>HitMissRatio</entry>
<entry>double</entry>
<entry>Ratio of hits to hits and misses. A hit is a get attribute operation that results in an object
being
returned to the client. The retrieval may be from a cache loader if the entry isn't in the local
cache.
</entry>
</row>
<row>
<entry>CacheMgmtInterceptor</entry>
<entry>ReadWriteRatio</entry>
<entry>double</entry>
<entry>Ratio of read operations to write operations. This is the ratio of cache hits and misses to
cache stores.
</entry>
</row>
<row>
<entry>CacheStoreInterceptor</entry>
<entry>CacheLoaderStores</entry>
<entry>long</entry>
<entry>Number of nodes written to the cache loader.</entry>
</row>
<row>
<entry>InvalidationInterceptor</entry>
<entry>Invalidations</entry>
<entry>long</entry>
<entry>Number of cached nodes that have been invalidated.</entry>
</row>
<row>
<entry>PassivationInterceptor</entry>
<entry>Passivations</entry>
<entry>long</entry>
<entry>Number of cached nodes that have been passivated.</entry>
</row>
<row>
<entry>TxInterceptor</entry>
<entry>Prepares</entry>
<entry>long</entry>
<entry>Number of transaction prepare operations performed by this interceptor.</entry>
</row>
<row>
<entry>TxInterceptor</entry>
<entry>Commits</entry>
<entry>long</entry>
<entry>Number of transaction commit operations performed by this interceptor.</entry>
</row>
<row>
<entry>TxInterceptor</entry>
<entry>Rollbacks</entry>
<entry>long</entry>
<entry>Number of transaction rollbacks operations performed by this interceptor.</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="jmx_reference.notifications">
<title>JMX MBean Notifications</title>
<para>The following table depicts the JMX notifications available for JBoss Cache as well as the cache events to
which they correspond. These are the notifications that can be received through the
<literal>CacheMgmtInterceptor</literal>
MBean.
Each notification represents a single event published by JBoss Cache and provides user data corresponding to
the parameters of the event.
</para>
<table>
<title>JBoss Cache MBean Notifications</title>
<tgroup cols="3">
<thead>
<row>
<entry>Notification Type</entry>
<entry>Notification Data</entry>
<entry>TreeCacheListener Event</entry>
</row>
</thead>
<tbody>
<row>
<entry>org.jboss.cache.CacheStarted</entry>
<entry>String : cache service name</entry>
<entry>cacheStarted</entry>
</row>
<row>
<entry>org.jboss.cache.CacheStopped</entry>
<entry>String : cache service name</entry>
<entry>cacheStopped</entry>
</row>
<row>
<entry>org.jboss.cache.NodeCreated</entry>
<entry>String : fqn</entry>
<entry>NodeCreated</entry>
</row>
<row>
<entry>org.jboss.cache.NodeEvicted</entry>
<entry>String : fqn</entry>
<entry>NodeEvicted</entry>
</row>
<row>
<entry>org.jboss.cache.NodeLoaded</entry>
<entry>String : fqn</entry>
<entry>NodeLoaded</entry>
</row>
<row>
<entry>org.jboss.cache.NodeModifed</entry>
<entry>String : fqn</entry>
<entry>NodeModifed</entry>
</row>
<row>
<entry>org.jboss.cache.NodeRemoved</entry>
<entry>String : fqn</entry>
<entry>NodeRemoved</entry>
</row>
<row>
<entry>org.jboss.cache.NodeVisited</entry>
<entry>String : fqn</entry>
<entry>NodeVisited</entry>
</row>
<row>
<entry>org.jboss.cache.ViewChange</entry>
<entry>String : view</entry>
<entry>ViewChange</entry>
</row>
<row>
<entry>org.jboss.cache.NodeActivate</entry>
<entrytbl cols="1">
<tbody>
<row>
<entry rowsep="0">Object[0]=String: fqn</entry>
</row>
<row>
<entry>Object[1]=Boolean: pre</entry>
</row>
</tbody>
</entrytbl>
<entry>NodeActivate</entry>
</row>
<row>
<entry>org.jboss.cache.NodeEvict</entry>
<entrytbl cols="1">
<tbody>
<row>
<entry rowsep="0">Object[0]=String: fqn</entry>
</row>
<row>
<entry>Object[1]=Boolean: pre</entry>
</row>
</tbody>
</entrytbl>
<entry>NodeEvict</entry>
</row>
<row>
<entry>org.jboss.cache.NodeModify</entry>
<entrytbl cols="1">
<tbody>
<row>
<entry rowsep="0">Object[0]=String: fqn</entry>
</row>
<row>
<entry rowsep="0">Object[1]=Boolean: pre</entry>
</row>
<row>
<entry>Object[2]=Boolean: isLocal</entry>
</row>
</tbody>
</entrytbl>
<entry>NodeModify</entry>
</row>
<row>
<entry>org.jboss.cache.NodePassivate</entry>
<entrytbl cols="1">
<tbody>
<row>
<entry rowsep="0">Object[0]=String: fqn</entry>
</row>
<row>
<entry>Object[1]=Boolean: pre</entry>
</row>
</tbody>
</entrytbl>
<entry>NodePassivate</entry>
</row>
<row>
<entry>org.jboss.cache.NodeRemove</entry>
<entrytbl cols="1">
<tbody>
<row>
<entry rowsep="0">Object[0]=String: fqn</entry>
</row>
<row>
<entry rowsep="0">Object[1]=Boolean: pre</entry>
</row>
<row>
<entry>Object[2]=Boolean: isLocal</entry>
</row>
</tbody>
</entrytbl>
<entry>NodeRemove</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</chapter>
More information about the jboss-cvs-commits
mailing list