From jbosscache-commits at lists.jboss.org Wed Oct 22 23:18:45 2008 Content-Type: multipart/mixed; boundary="===============8570951707652680989==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r7003 - in core/trunk/src/main: java/org/jboss/cache and 5 other directories. Date: Wed, 22 Oct 2008 23:18:45 -0400 Message-ID: --===============8570951707652680989== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: manik.surtani(a)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.j= ava 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.ja= va core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/LockConta= iner.java core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/OwnableRe= entrantLockContainer.java core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/Reentrant= LockContainer.java Log: - Updated docs - Exposed more JMX information Modified: core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 @@ } } ]]> +
+ Synchronous and Asynchronous Notifications + + By default, all notifications are synchronous, in that they ha= ppen on the thread of the caller which generated + the event. As such, it is good practise to ensure cache liste= ner implementations don't hold up the thread in + long-running tasks. Alternatively, you could set the CacheListener.sync() attribute to + false, in which case you will not be notifi= ed in the caller's thread. See the + configuration reference on tuning this thread pool. + +
=
Modified: core/trunk/src/main/docbook/userguide/en/modules/configuration_re= ference.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/main/docbook/userguide/en/modules/configuration_referenc= e.xml 2008-10-23 01:10:13 UTC (rev 7002) +++ core/trunk/src/main/docbook/userguide/en/modules/configuration_referenc= e.xml 2008-10-23 03:18:45 UTC (rev 7003) @@ -335,7 +335,6 @@ - urn:jboss:jbosscache-core:config:3.0 urn:jboss:jbosscache-core:config:3.0 - No Defines the XML namespace for all configuration e= ntries. @@ -343,7 +342,6 @@ - http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance - No Defines the XML schema instance for the configura= tion. Modified: core/trunk/src/main/docbook/userguide/en/modules/eviction_policie= s.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 @@ ... - 5000 - 1000 + + ... Modified: core/trunk/src/main/docbook/userguide/en/modules/jmx_reference.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 @@
JBoss Cache Statistics - 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: - JBoss Cache Management Statistics - - - - - + JBoss Cache JMX MBeans + - MBean Name - Attribute - Type + MBean + Attribute/Operation Name Description - ActivationInterceptor - Activations - long - Number of passivated nodes that have been activat= ed. + DataContainerImpl + getNumberOfAttributes() + Returns the number of attributes in all nodes in = the data container - CacheLoaderInterceptor - CacheLoaderLoads - long - Number of nodes loaded through a cache loader. + + getNumberOfNodes() + Returns the number of nodes in the data container= - CacheLoaderInterceptor - CacheLoaderMisses - long - Number of unsuccessful attempts to load a node th= rough a cache loader. + + printDetails() + Prints details of the data container + - CacheMgmtInterceptor - Hits - long - Number of successful attribute retrievals. + RPCManagerImpl + localAddressString + String representation of the local address - CacheMgmtInterceptor - Misses - long - Number of unsuccessful attribute retrievals. + + membersString + String representation of the cluster view - CacheMgmtInterceptor - Stores - long - Number of attribute store operations. + + statisticsEnabled + Whether RPC statistics are being gathered - CacheMgmtInterceptor - Evictions - long - Number of node evictions. + + replicationCount + Number of successful replications - CacheMgmtInterceptor - NumberOfAttributes - int - Number of attributes currently cached. + + replicationFailures + Number of failed replications - CacheMgmtInterceptor - NumberOfNodes - int - Number of nodes currently cached. + + successRatio + RPC call success ratio + - CacheMgmtInterceptor - ElapsedTime - long - Number of seconds that the cache has been running= . + RegionManagerImpl + dumpRegions() + Dumps a String representation of all registered r= egions, including eviction regions depicting their event queue sizes - CacheMgmtInterceptor - TimeSinceReset - long - Number of seconds since the cache statistics have= been reset. + + numRegions + Number of registered regions - CacheMgmtInterceptor - AverageReadTime - long - Average time in milliseconds to retrieve a cache = attribute, including unsuccessful - attribute retrievals. - + BuddyManager + buddyGroup + A String representation of the cache's buddy grou= p - CacheMgmtInterceptor - AverageWriteTime - long - Average time in milliseconds to write a cache att= ribute. + + buddyGroupsIParticipateIn + String representations of all buddy groups the ca= che participates in - CacheMgmtInterceptor - HitMissRatio - double - 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 c= ache loader if the entry isn't in the local - cache. - + TransactionTable + numberOfRegisteredTransactions + The number of registered, ongoing transactions - CacheMgmtInterceptor - ReadWriteRatio - double - Ratio of read operations to write operations. Thi= s is the ratio of cache hits and misses to - cache stores. - + + transactionMap + A String representation of all currently register= ed transactions mapped to internal GlobalTransaction instances + - CacheStoreInterceptor - CacheLoaderStores - long - Number of nodes written to the cache loader. + MVCCLockManager + concurrencyLevel + The configured concurrency level - InvalidationInterceptor - Invalidations - long - Number of cached nodes that have been invalidated= . + + numberOfLocksAvailable + Number of locks in the shared lock pool that are = not used - PassivationInterceptor - Passivations - long - Number of cached nodes that have been passivated.= + + numberOfLocksHeld + Number of locks in the shared lock pool that are = in use - TxInterceptor - Prepares - long - Number of transaction prepare operations performe= d by this interceptor. + + testHashing(String fqn) + Tests the spreading of locks across Fqns. For a g= iven (String based) Fqn, this method returns the index in the lock array th= at it maps to. - TxInterceptor - Commits - long - Number of transaction commit operations performed= by this interceptor. - - - TxInterceptor - Rollbacks - long - Number of transaction rollbacks operations perfor= med by this interceptor. - + ActivationInterceptor + Activations + Number of passivated nodes that hav= e been activated. + + + CacheLoaderInterceptor + CacheLoaderLoads + Number of nodes loaded through a ca= che loader. + + + + CacheLoaderMisses + Number of unsuccessful attempts to = load a node through a cache loader. + + + CacheMgmtInterceptor + Hits + Number of successful attribute retr= ievals. + + + + Misses + Number of unsuccessful attribute re= trievals. + + + + Stores + Number of attribute store operation= s. + + + + Evictions + Number of node evictions. + + + + NumberOfAttributes + Number of attributes currently cach= ed. + + + + NumberOfNodes + Number of nodes currently cached. + + + + ElapsedTime + Number of seconds that the cache ha= s been running. + + + + TimeSinceReset + Number of seconds since the cache s= tatistics have been reset. + + + + AverageReadTime + Average time in milliseconds to ret= rieve a cache attribute, including unsuccessful + attribute retrievals. + + + + + AverageWriteTime + Average time in milliseconds to wri= te a cache attribute. + + + + HitMissRatio + 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 m= ay be from a cache loader if the entry isn't in the local + cache. + + + + + ReadWriteRatio + Ratio of read operations to write o= perations. This is the ratio of cache hits and misses to + cache stores. + + + + CacheStoreInterceptor + CacheLoaderStores + Number of nodes written to the cach= e loader. + + + InvalidationInterceptor + Invalidations + Number of cached nodes that have be= en invalidated. + + + PassivationInterceptor + Passivations + Number of cached nodes that have be= en passivated. + + + TxInterceptor + Prepares + Number of transaction prepare opera= tions performed by this interceptor. + + + + Commits + Number of transaction commit operat= ions performed by this interceptor. + + + + Rollbacks + Number of transaction rollbacks ope= rations performed by this interceptor. + + + + numberOfSyncsRegistered + Number of synchronizations register= ed with the transaction manager pending completion and removal. + + +
@@ -182,125 +262,64 @@ org.jboss.cache.CacheStarted - String : cache service name - cacheStarted + String: cache service name + @CacheStarted org.jboss.cache.CacheStopped - String : cache service name - cacheStopped + String: cache service name + @CacheStopped org.jboss.cache.NodeCreated - String : fqn - NodeCreated + String: fqn, boolean: isPre, boolean: isOriginLoc= al + @NodeCreated org.jboss.cache.NodeEvicted - String : fqn - NodeEvicted + String: fqn, boolean: isPre, boolean: isOriginLoc= al + @NodeEvicted org.jboss.cache.NodeLoaded - String : fqn - NodeLoaded + String: fqn, boolean: isPre + @NodeLoaded org.jboss.cache.NodeModifed - String : fqn - NodeModifed + String: fqn, boolean: isPre, boolean: isOriginLoc= al + @NodeModifed org.jboss.cache.NodeRemoved - String : fqn - NodeRemoved + String: fqn, boolean: isPre, boolean: isOriginLoc= al + @NodeRemoved org.jboss.cache.NodeVisited - String : fqn - NodeVisited + String: fqn, boolean: isPre + @NodeVisited - org.jboss.cache.ViewChange - String : view - ViewChange + org.jboss.cache.ViewChanged + String: view + @ViewChanged - org.jboss.cache.NodeActivate - - - - Object[0]=3DString: fqn - - - Object[1]=3DBoolean: pre - - - - NodeActivate + org.jboss.cache.NodeActivated + String: fqn + @NodeActivated - org.jboss.cache.NodeEvict - - - - Object[0]=3DString: fqn - - - Object[1]=3DBoolean: pre - - - - NodeEvict + org.jboss.cache.NodeMoved + String: fromFqn, String: toFqn, boolean: isPre + @NodeMoved - org.jboss.cache.NodeModify - - - - Object[0]=3DString: fqn - - - Object[1]=3DBoolean: pre - - - Object[2]=3DBoolean: isLocal - - - - NodeModify + org.jboss.cache.NodePassivated + String: fqn + @NodePassivated - - org.jboss.cache.NodePassivate - - - - Object[0]=3DString: fqn - - - Object[1]=3DBoolean: pre - - - - NodePassivate - - - org.jboss.cache.NodeRemove - - - - Object[0]=3DString: fqn - - - Object[1]=3DBoolean: pre - - - Object[2]=3DBoolean: isLocal - - - - NodeRemove - Modified: core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 contribut= ors - * 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 contribut= ors + * 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 =3D "Returns the number of nodes in the d= ata container") public int getNumberOfNodes() { if (!usingMvcc) return numNodes(root) - 1; @@ -460,6 +462,7 @@ * * @return details */ + @ManagedOperation(description =3D "Prints details of the data container= ") public String printDetails() { StringBuilder sb =3D new StringBuilder(); @@ -520,6 +523,7 @@ return count; } = + @ManagedOperation(description =3D "Returns the number of attributes in = all nodes in the data container") public int getNumberOfAttributes() { return usingMvcc ? numAttributesMvcc(rootInternal) : numAttributes(r= oot); Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 =3D "Local address") + public String getLocalAddressString() + { + Address address =3D getLocalAddress(); = + return address =3D=3D null ? "null" : address.toString(); + } + public Address getLocalAddress() { return channel !=3D null ? channel.getLocalAddress() : null; } = + @ManagedAttribute (description =3D "Cluster view") + public String getMembersString() + { + List l =3D getMembers(); + return l =3D=3D null ? "null" : l.toString(); + } + public List
getMembers() { if (isInLocalMode) return null; @@ -782,7 +796,7 @@ this.statisticsEnabled =3D statisticsEnabled; } = - @ManagedAttribute + @ManagedAttribute(description =3D "RPC call success ratio") public String getSuccessRatio() { if (replicationCount =3D=3D 0 || !statisticsEnabled) Modified: core/trunk/src/main/java/org/jboss/cache/RegionImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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=3D" + status + "; eviction=3D" + (evictionAlgorithm !=3D null) + "; timerThreadRegistered=3D" + (evictionAlgorithm !=3D null &&= regionManager.getEvictionTimerTask().isRegionRegisteredForProcessing(this)= ) + + "; evictionQueueSize=3D" + (evictionAlgorithm =3D=3D null ? "-= 1" : evictionEventQueue.size()) + '}'; } = Modified: core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 =3D "A String representation of all regis= tered regions") public String dumpRegions() { StringBuilder sb =3D new StringBuilder(); @@ -743,4 +746,10 @@ { evictionTimerTask.stop(); } + + @ManagedAttribute(name=3D"numRegions", description =3D "A count of all = regions") + public int getNumRegions() + { + return regionsRegistry.size(); + } } Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyMa= nager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 =3D "A String representation of the cache= 's buddy group") + public String getBuddyGroup() + { + return buddyGroup.toString(); + } + + @ManagedAttribute(description =3D "A String representation of buddy gro= ups 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/TxIntercept= or.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.jav= a 2008-10-23 01:10:13 UTC (rev 7002) +++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.jav= a 2008-10-23 03:18:45 UTC (rev 7003) @@ -1148,4 +1148,10 @@ { return rollbacks; } + + @ManagedAttribute(name =3D "numberOfSyncsRegistered", writable =3D fals= e, description =3D "number of transaction synchronizations currently regist= ered") + public int getNumberOfSyncsRegistered() + { + return transactions.size(); + } } \ No newline at end of file Modified: core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 =3D "concurrency level", writable =3D false, des= cription =3D "The concurrency level that the MVCC Lock Manager has been con= figured with.") + public int getConcurrencyLevel() + { + return configuration.getConcurrencyLevel(); + } + + @ManagedAttribute(name =3D "locks held", writable =3D false, descriptio= n =3D "The number of exclusive locks that are held.") + public int getNumberOfLocksHeld() + { + return lockContainer.getNumLocksHeld(); + } + + @ManagedAttribute(name =3D "locks held", writable =3D false, descriptio= n =3D "The number of exclusive locks that are available.") + public int getNumberOfLocksAvailable() + { + return lockContainer.size() - lockContainer.getNumLocksHeld(); + } + + @ManagedOperation(description =3D "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/TransactionT= able.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.j= ava 2008-10-23 01:10:13 UTC (rev 7002) +++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.j= ava 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=3D"numberOfRegisteredTransactions", description = =3D "Number of registered transactions") + public int getNumberOfRegisteredTransactions() + { + return tx2gtxMap.size(); + } + + @ManagedAttribute(name=3D"transactionMap", description =3D "A String re= presentation of the transaction map") + public String getTransactionMap() + { + return tx2gtxMap.toString(); + } } Modified: core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/Lo= ckContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/LockCont= ainer.java 2008-10-23 01:10:13 UTC (rev 7002) +++ core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/LockCont= ainer.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/Ow= nableReentrantLockContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/OwnableR= eentrantLockContainer.java 2008-10-23 01:10:13 UTC (rev 7002) +++ core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/OwnableR= eentrantLockContainer.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/Re= entrantLockContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/Reentran= tLockContainer.java 2008-10-23 01:10:13 UTC (rev 7002) +++ core/trunk/src/main/java/org/jboss/cache/util/concurrent/locks/Reentran= tLockContainer.java 2008-10-23 03:18:45 UTC (rev 7003) @@ -89,4 +89,9 @@ { initLocks(sharedLocks.length); } + + public int size() + { + return sharedLocks.length; + } } --===============8570951707652680989==--