[jbosscache-commits] JBoss Cache SVN: r7003 - in core/trunk/src/main: java/org/jboss/cache and 5 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Oct 22 23:18:45 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-10-22 23:18:45 -0400 (Wed, 22 Oct 2008)
New Revision: 7003

Modified:
   core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml
   core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml
   core/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml
   core/trunk/src/main/docbook/userguide/en/modules/jmx_reference.xml
   core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
   core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
   core/trunk/src/main/java/org/jboss/cache/RegionImpl.java
   core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java
   core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java
   core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java
   core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/LockContainer.java
   core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/OwnableReentrantLockContainer.java
   core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/ReentrantLockContainer.java
Log:
- Updated docs
- Exposed more JMX information


Modified: core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml
===================================================================
--- core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml	2008-10-23 03:18:45 UTC (rev 7003)
@@ -535,6 +535,16 @@
       }
    }
          ]]></programlisting>
+      <section>
+         <title>Synchronous and Asynchronous Notifications</title>
+         <para>
+            By default, all notifications are synchronous, in that they happen on the thread of the caller which generated
+            the event.  As such, it is good practise to ensure cache listener implementations don't hold up the thread in
+            long-running tasks.  Alternatively, you could set the <literal>CacheListener.sync()</literal> attribute to
+            <literal>false</literal>, in which case you will not be notified in the caller's thread.  See the
+            <link linkend="element.listeners">configuration reference</link> on tuning this thread pool.
+         </para>
+      </section>
    </section>
 
    <section>

Modified: core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml
===================================================================
--- core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml	2008-10-23 03:18:45 UTC (rev 7003)
@@ -335,7 +335,6 @@
                   <entry> - </entry>
                   <entry>urn:jboss:jbosscache-core:config:3.0</entry>
                   <entry>urn:jboss:jbosscache-core:config:3.0</entry>
-                  <entry>No</entry>
                   <entry>Defines the XML namespace for all configuration entries.</entry>
                </row>
                <row>
@@ -343,7 +342,6 @@
                   <entry> - </entry>
                   <entry>http://www.w3.org/2001/XMLSchema-instance</entry>
                   <entry>http://www.w3.org/2001/XMLSchema-instance</entry>
-                  <entry>No</entry>
                   <entry>Defines the XML schema instance for the configuration.</entry>
                </row>
             </tbody>

Modified: core/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml
===================================================================
--- core/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml	2008-10-23 03:18:45 UTC (rev 7003)
@@ -178,8 +178,8 @@
    ...
    <eviction wakeUpInterval="500" eventQueueSize="100000">
       <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
-         <attribute name="maxNodes">5000</attribute>
-         <attribute name="timeToLive">1000</attribute>
+         <property name="maxNodes" value="5000" />
+         <property name="timeToLive" value="1000" />
       </default>
    </eviction>
    ...

Modified: core/trunk/src/main/docbook/userguide/en/modules/jmx_reference.xml
===================================================================
--- core/trunk/src/main/docbook/userguide/en/modules/jmx_reference.xml	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/docbook/userguide/en/modules/jmx_reference.xml	2008-10-23 03:18:45 UTC (rev 7003)
@@ -3,158 +3,238 @@
    <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.
+         There is a whole wealth of information being gathered and exposed on to JMX for monitoring the cache.  Some
+         of these are detailed below:
       </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*"/>
+         <title>JBoss Cache JMX MBeans</title>
+         <tgroup cols="3">
             <thead>
                <row>
-                  <entry>MBean Name</entry>
-                  <entry>Attribute</entry>
-                  <entry>Type</entry>
+                  <entry>MBean</entry>
+                  <entry>Attribute/Operation Name</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>
+                  <entry>DataContainerImpl</entry>
+                  <entry>getNumberOfAttributes()</entry>
+                  <entry>Returns the number of attributes in all nodes in the data container</entry>
                </row>
                <row>
-                  <entry>CacheLoaderInterceptor</entry>
-                  <entry>CacheLoaderLoads</entry>
-                  <entry>long</entry>
-                  <entry>Number of nodes loaded through a cache loader.</entry>
+                  <entry></entry>
+                  <entry>getNumberOfNodes()</entry>
+                  <entry>Returns the number of nodes in the data container</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>
+                  <entry></entry>
+                  <entry>printDetails()</entry>
+                  <entry>Prints details of the data container</entry>
                </row>
+
                <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>Hits</entry>
-                  <entry>long</entry>
-                  <entry>Number of successful attribute retrievals.</entry>
+                  <entry>RPCManagerImpl</entry>
+                  <entry>localAddressString</entry>
+                  <entry>String representation of the local address</entry>
                </row>
                <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>Misses</entry>
-                  <entry>long</entry>
-                  <entry>Number of unsuccessful attribute retrievals.</entry>
+                  <entry></entry>
+                  <entry>membersString</entry>
+                  <entry>String representation of the cluster view</entry>
                </row>
                <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>Stores</entry>
-                  <entry>long</entry>
-                  <entry>Number of attribute store operations.</entry>
+                  <entry></entry>
+                  <entry>statisticsEnabled</entry>
+                  <entry>Whether RPC statistics are being gathered</entry>
                </row>
                <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>Evictions</entry>
-                  <entry>long</entry>
-                  <entry>Number of node evictions.</entry>
+                  <entry></entry>
+                  <entry>replicationCount</entry>
+                  <entry>Number of successful replications</entry>
                </row>
                <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>NumberOfAttributes</entry>
-                  <entry>int</entry>
-                  <entry>Number of attributes currently cached.</entry>
+                  <entry></entry>
+                  <entry>replicationFailures</entry>
+                  <entry>Number of failed replications</entry>
                </row>
                <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>NumberOfNodes</entry>
-                  <entry>int</entry>
-                  <entry>Number of nodes currently cached.</entry>
+                  <entry></entry>
+                  <entry>successRatio</entry>
+                  <entry>RPC call success ratio</entry>
                </row>
+
                <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>ElapsedTime</entry>
-                  <entry>long</entry>
-                  <entry>Number of seconds that the cache has been running.</entry>
+                  <entry>RegionManagerImpl</entry>
+                  <entry>dumpRegions()</entry>
+                  <entry>Dumps a String representation of all registered regions, including eviction regions depicting their event queue sizes</entry>
                </row>
                <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>TimeSinceReset</entry>
-                  <entry>long</entry>
-                  <entry>Number of seconds since the cache statistics have been reset.</entry>
+                  <entry></entry>
+                  <entry>numRegions</entry>
+                  <entry>Number of registered regions</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>
+                  <entry>BuddyManager</entry>
+                  <entry>buddyGroup</entry>
+                  <entry>A String representation of the cache's buddy group</entry>
                </row>
                <row>
-                  <entry>CacheMgmtInterceptor</entry>
-                  <entry>AverageWriteTime</entry>
-                  <entry>long</entry>
-                  <entry>Average time in milliseconds to write a cache attribute.</entry>
+                  <entry></entry>
+                  <entry>buddyGroupsIParticipateIn</entry>
+                  <entry>String representations of all buddy groups the cache participates in</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>
+                  <entry>TransactionTable</entry>
+                  <entry>numberOfRegisteredTransactions</entry>
+                  <entry>The number of registered, ongoing transactions</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>
+                  <entry></entry>
+                  <entry>transactionMap</entry>
+                  <entry>A String representation of all currently registered transactions mapped to internal GlobalTransaction instances</entry>
                </row>
+
                <row>
-                  <entry>CacheStoreInterceptor</entry>
-                  <entry>CacheLoaderStores</entry>
-                  <entry>long</entry>
-                  <entry>Number of nodes written to the cache loader.</entry>
+                  <entry>MVCCLockManager</entry>
+                  <entry>concurrencyLevel</entry>
+                  <entry>The configured concurrency level</entry>
                </row>
                <row>
-                  <entry>InvalidationInterceptor</entry>
-                  <entry>Invalidations</entry>
-                  <entry>long</entry>
-                  <entry>Number of cached nodes that have been invalidated.</entry>
+                  <entry></entry>
+                  <entry>numberOfLocksAvailable</entry>
+                  <entry>Number of locks in the shared lock pool that are not used</entry>
                </row>
                <row>
-                  <entry>PassivationInterceptor</entry>
-                  <entry>Passivations</entry>
-                  <entry>long</entry>
-                  <entry>Number of cached nodes that have been passivated.</entry>
+                  <entry></entry>
+                  <entry>numberOfLocksHeld</entry>
+                  <entry>Number of locks in the shared lock pool that are in use</entry>
                </row>
                <row>
-                  <entry>TxInterceptor</entry>
-                  <entry>Prepares</entry>
-                  <entry>long</entry>
-                  <entry>Number of transaction prepare operations performed by this interceptor.</entry>
+                  <entry></entry>
+                  <entry>testHashing(String fqn)</entry>
+                  <entry>Tests the spreading of locks across Fqns. For a given (String based) Fqn, this method returns the index in the lock array that it maps to.</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>
+                                <entry>ActivationInterceptor</entry>
+                                <entry>Activations</entry>
+                                <entry>Number of passivated nodes that have been activated.</entry>
+                             </row>
+                             <row>
+                                <entry>CacheLoaderInterceptor</entry>
+                                <entry>CacheLoaderLoads</entry>
+                                <entry>Number of nodes loaded through a cache loader.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>CacheLoaderMisses</entry>
+                                <entry>Number of unsuccessful attempts to load a node through a cache loader.</entry>
+                             </row>
+                             <row>
+                                <entry>CacheMgmtInterceptor</entry>
+                                <entry>Hits</entry>
+                                <entry>Number of successful attribute retrievals.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>Misses</entry>
+                                <entry>Number of unsuccessful attribute retrievals.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>Stores</entry>
+                                <entry>Number of attribute store operations.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>Evictions</entry>
+                                <entry>Number of node evictions.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>NumberOfAttributes</entry>
+                                <entry>Number of attributes currently cached.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>NumberOfNodes</entry>
+                                <entry>Number of nodes currently cached.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>ElapsedTime</entry>
+                                <entry>Number of seconds that the cache has been running.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>TimeSinceReset</entry>
+                                <entry>Number of seconds since the cache statistics have been reset.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>AverageReadTime</entry>
+                                <entry>Average time in milliseconds to retrieve a cache attribute, including unsuccessful
+                                   attribute retrievals.
+                                </entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>AverageWriteTime</entry>
+                                <entry>Average time in milliseconds to write a cache attribute.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>HitMissRatio</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></entry>
+                                <entry>ReadWriteRatio</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>Number of nodes written to the cache loader.</entry>
+                             </row>
+                             <row>
+                                <entry>InvalidationInterceptor</entry>
+                                <entry>Invalidations</entry>
+                                <entry>Number of cached nodes that have been invalidated.</entry>
+                             </row>
+                             <row>
+                                <entry>PassivationInterceptor</entry>
+                                <entry>Passivations</entry>
+                                <entry>Number of cached nodes that have been passivated.</entry>
+                             </row>
+                             <row>
+                                <entry>TxInterceptor</entry>
+                                <entry>Prepares</entry>
+                                <entry>Number of transaction prepare operations performed by this interceptor.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>Commits</entry>
+                                <entry>Number of transaction commit operations performed by this interceptor.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>Rollbacks</entry>
+                                <entry>Number of transaction rollbacks operations performed by this interceptor.</entry>
+                             </row>
+                             <row>
+                                <entry></entry>
+                                <entry>numberOfSyncsRegistered</entry>
+                                <entry>Number of synchronizations registered with the transaction manager pending completion and removal.</entry>
+                             </row>
+
+
             </tbody>
          </tgroup>
       </table>
@@ -182,125 +262,64 @@
             <tbody>
                <row>
                   <entry>org.jboss.cache.CacheStarted</entry>
-                  <entry>String : cache service name</entry>
-                  <entry>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>
+                  <entry>String: cache service name</entry>
+                  <entry>@CacheStopped</entry>
                </row>
                <row>
                   <entry>org.jboss.cache.NodeCreated</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeCreated</entry>
+                  <entry>String: fqn, boolean: isPre, boolean: isOriginLocal</entry>
+                  <entry>@NodeCreated</entry>
                </row>
                <row>
                   <entry>org.jboss.cache.NodeEvicted</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeEvicted</entry>
+                  <entry>String: fqn, boolean: isPre, boolean: isOriginLocal</entry>
+                  <entry>@NodeEvicted</entry>
                </row>
                <row>
                   <entry>org.jboss.cache.NodeLoaded</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeLoaded</entry>
+                  <entry>String: fqn, boolean: isPre</entry>
+                  <entry>@NodeLoaded</entry>
                </row>
                <row>
                   <entry>org.jboss.cache.NodeModifed</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeModifed</entry>
+                  <entry>String: fqn, boolean: isPre, boolean: isOriginLocal</entry>
+                  <entry>@NodeModifed</entry>
                </row>
                <row>
                   <entry>org.jboss.cache.NodeRemoved</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeRemoved</entry>
+                  <entry>String: fqn, boolean: isPre, boolean: isOriginLocal</entry>
+                  <entry>@NodeRemoved</entry>
                </row>
                <row>
                   <entry>org.jboss.cache.NodeVisited</entry>
-                  <entry>String : fqn</entry>
-                  <entry>NodeVisited</entry>
+                  <entry>String: fqn, boolean: isPre</entry>
+                  <entry>@NodeVisited</entry>
                </row>
                <row>
-                  <entry>org.jboss.cache.ViewChange</entry>
-                  <entry>String : view</entry>
-                  <entry>ViewChange</entry>
+                  <entry>org.jboss.cache.ViewChanged</entry>
+                  <entry>String: view</entry>
+                  <entry>@ViewChanged</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>
+                  <entry>org.jboss.cache.NodeActivated</entry>
+                  <entry>String: fqn</entry>
+                  <entry>@NodeActivated</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>
+                  <entry>org.jboss.cache.NodeMoved</entry>
+                  <entry>String: fromFqn, String: toFqn, boolean: isPre</entry>
+                  <entry>@NodeMoved</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>
+                  <entry>org.jboss.cache.NodePassivated</entry>
+                  <entry>String: fqn</entry>
+                  <entry>@NodePassivated</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>

Modified: core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java	2008-10-23 03:18:45 UTC (rev 7003)
@@ -1,24 +1,24 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.cache;
 
 import org.apache.commons.logging.Log;
@@ -30,6 +30,7 @@
 import org.jboss.cache.factories.annotations.NonVolatile;
 import org.jboss.cache.factories.annotations.Start;
 import org.jboss.cache.factories.annotations.Stop;
+import org.jboss.cache.jmx.annotations.ManagedOperation;
 import org.jboss.cache.lock.LockManager;
 import org.jboss.cache.marshall.NodeData;
 
@@ -420,6 +421,7 @@
       return num;
    }
 
+   @ManagedOperation(description = "Returns the number of nodes in the data container")
    public int getNumberOfNodes()
    {
       if (!usingMvcc) return numNodes(root) - 1;
@@ -460,6 +462,7 @@
     *
     * @return details
     */
+   @ManagedOperation(description = "Prints details of the data container")
    public String printDetails()
    {
       StringBuilder sb = new StringBuilder();
@@ -520,6 +523,7 @@
       return count;
    }
 
+   @ManagedOperation(description = "Returns the number of attributes in all nodes in the data container")
    public int getNumberOfAttributes()
    {
       return usingMvcc ? numAttributesMvcc(rootInternal) : numAttributes(root);

Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java	2008-10-23 03:18:45 UTC (rev 7003)
@@ -594,11 +594,25 @@
 
    // ------------ START: Informational methods ------------
 
+   @ManagedAttribute (description = "Local address")
+   public String getLocalAddressString()
+   {
+      Address address = getLocalAddress();      
+      return address == null ? "null" : address.toString();
+   }
+
    public Address getLocalAddress()
    {
       return channel != null ? channel.getLocalAddress() : null;
    }
 
+   @ManagedAttribute (description = "Cluster view")
+   public String getMembersString()
+   {
+      List l = getMembers();
+      return l == null ? "null" : l.toString();
+   }
+
    public List<Address> getMembers()
    {
       if (isInLocalMode) return null;
@@ -782,7 +796,7 @@
       this.statisticsEnabled = statisticsEnabled;
    }
 
-   @ManagedAttribute
+   @ManagedAttribute(description = "RPC call success ratio")
    public String getSuccessRatio()
    {
       if (replicationCount == 0 || !statisticsEnabled)

Modified: core/trunk/src/main/java/org/jboss/cache/RegionImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RegionImpl.java	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/java/org/jboss/cache/RegionImpl.java	2008-10-23 03:18:45 UTC (rev 7003)
@@ -175,6 +175,7 @@
             "; status=" + status +
             "; eviction=" + (evictionAlgorithm != null) +
             "; timerThreadRegistered=" + (evictionAlgorithm != null && regionManager.getEvictionTimerTask().isRegionRegisteredForProcessing(this)) +
+            "; evictionQueueSize=" + (evictionAlgorithm == null ? "-1" : evictionEventQueue.size()) +
             '}';
    }
 

Modified: core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java	2008-10-23 03:18:45 UTC (rev 7003)
@@ -36,6 +36,8 @@
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.factories.annotations.Start;
 import org.jboss.cache.factories.annotations.Stop;
+import org.jboss.cache.jmx.annotations.ManagedAttribute;
+import org.jboss.cache.jmx.annotations.ManagedOperation;
 import org.jboss.cache.lock.LockManager;
 import org.jboss.cache.util.concurrent.locks.LockContainer;
 import org.jboss.cache.util.concurrent.locks.ReentrantLockContainer;
@@ -698,6 +700,7 @@
       }
    }
 
+   @ManagedOperation(description = "A String representation of all registered regions")
    public String dumpRegions()
    {
       StringBuilder sb = new StringBuilder();
@@ -743,4 +746,10 @@
    {
       evictionTimerTask.stop();
    }
+
+   @ManagedAttribute(name="numRegions", description = "A count of all regions")
+   public int getNumRegions()
+   {
+      return regionsRegistry.size();
+   }
 }

Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java	2008-10-23 03:18:45 UTC (rev 7003)
@@ -48,6 +48,7 @@
 import org.jboss.cache.factories.annotations.Start;
 import org.jboss.cache.factories.annotations.Stop;
 import org.jboss.cache.io.ExposedByteArrayOutputStream;
+import org.jboss.cache.jmx.annotations.ManagedAttribute;
 import org.jboss.cache.lock.TimeoutException;
 import org.jboss.cache.notifications.Notifier;
 import org.jboss.cache.notifications.annotation.CacheListener;
@@ -1300,4 +1301,16 @@
          }
       }
    }
+
+   @ManagedAttribute(description = "A String representation of the cache's buddy group")
+   public String getBuddyGroup()
+   {
+      return buddyGroup.toString();
+   }
+
+   @ManagedAttribute(description = "A String representation of buddy groups the cache participates in")
+   public String getBuddyGroupsIParticipateIn()
+   {
+      return buddyGroupsIParticipateIn.toString();
+   }
 }
\ No newline at end of file

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java	2008-10-23 03:18:45 UTC (rev 7003)
@@ -1148,4 +1148,10 @@
    {
       return rollbacks;
    }
+
+   @ManagedAttribute(name = "numberOfSyncsRegistered", writable = false, description = "number of transaction synchronizations currently registered")
+   public int getNumberOfSyncsRegistered()
+   {
+      return transactions.size();
+   }
 }
\ No newline at end of file

Modified: core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java	2008-10-23 03:18:45 UTC (rev 7003)
@@ -33,6 +33,8 @@
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.factories.annotations.Start;
 import org.jboss.cache.invocation.InvocationContextContainer;
+import org.jboss.cache.jmx.annotations.ManagedAttribute;
+import org.jboss.cache.jmx.annotations.ManagedOperation;
 import static org.jboss.cache.lock.LockType.READ;
 import org.jboss.cache.util.concurrent.locks.LockContainer;
 import org.jboss.cache.util.concurrent.locks.OwnableReentrantLock;
@@ -302,4 +304,28 @@
    {
       return lockContainer.toString();
    }
+
+   @ManagedAttribute(name = "concurrency level", writable = false, description = "The concurrency level that the MVCC Lock Manager has been configured with.")
+   public int getConcurrencyLevel()
+   {
+      return configuration.getConcurrencyLevel();
+   }
+
+   @ManagedAttribute(name = "locks held", writable = false, description = "The number of exclusive locks that are held.")
+   public int getNumberOfLocksHeld()
+   {
+      return lockContainer.getNumLocksHeld();
+   }
+
+   @ManagedAttribute(name = "locks held", writable = false, description = "The number of exclusive locks that are available.")
+   public int getNumberOfLocksAvailable()
+   {
+      return lockContainer.size() - lockContainer.getNumLocksHeld();
+   }
+
+   @ManagedOperation(description = "Tests the spreading of locks across Fqns. For a given (String based) Fqn, this method returns the index in the lock array that it maps to.")
+   public int testHashing(String fqn)
+   {
+      return lockContainer.hashToIndex(Fqn.fromString(fqn));
+   }
 }

Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java	2008-10-23 03:18:45 UTC (rev 7003)
@@ -29,6 +29,7 @@
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.factories.annotations.NonVolatile;
 import org.jboss.cache.factories.context.ContextFactory;
+import org.jboss.cache.jmx.annotations.ManagedAttribute;
 import org.jgroups.Address;
 
 import javax.transaction.Status;
@@ -423,4 +424,16 @@
       }
       return gtx;
    }
+
+   @ManagedAttribute(name="numberOfRegisteredTransactions", description = "Number of registered transactions")
+   public int getNumberOfRegisteredTransactions()
+   {
+      return tx2gtxMap.size();
+   }
+
+   @ManagedAttribute(name="transactionMap", description = "A String representation of the transaction map")
+   public String getTransactionMap()
+   {
+      return tx2gtxMap.toString();
+   }
 }

Modified: core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/LockContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/LockContainer.java	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/LockContainer.java	2008-10-23 03:18:45 UTC (rev 7003)
@@ -111,4 +111,6 @@
     * Clears all locks held and re-initialises stripes.
     */
    public abstract void reset();
+
+   public abstract int size();
 }

Modified: core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/OwnableReentrantLockContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/OwnableReentrantLockContainer.java	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/OwnableReentrantLockContainer.java	2008-10-23 03:18:45 UTC (rev 7003)
@@ -93,4 +93,9 @@
    {
       initLocks(sharedLocks.length);
    }
+
+   public int size()
+   {
+      return sharedLocks.length;
+   }
 }

Modified: core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/ReentrantLockContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/ReentrantLockContainer.java	2008-10-23 01:10:13 UTC (rev 7002)
+++ core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/ReentrantLockContainer.java	2008-10-23 03:18:45 UTC (rev 7003)
@@ -89,4 +89,9 @@
    {
       initLocks(sharedLocks.length);
    }
+
+   public int size()
+   {
+      return sharedLocks.length;
+   }
 }




More information about the jbosscache-commits mailing list