[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/jmx ...
Brian Stansberry
brian.stansberry at jboss.com
Sun Nov 5 00:09:40 EST 2006
User: bstansberry
Date: 06/11/05 00:09:40
Modified: src-50/org/jboss/cache/pojo/jmx JmxUtil.java
Log:
Change default ObjectName
Handle cases where underlying cache isn't configured to use default ObjectName
Revision Changes Path
1.2 +18 -3 JBossCache/src-50/org/jboss/cache/pojo/jmx/JmxUtil.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: JmxUtil.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/jmx/JmxUtil.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- JmxUtil.java 25 Sep 2006 05:50:52 -0000 1.1
+++ JmxUtil.java 5 Nov 2006 05:09:40 -0000 1.2
@@ -16,11 +16,13 @@
* Various JMX related utilities
*
* @author Ben Wang
- * @version $Id: JmxUtil.java,v 1.1 2006/09/25 05:50:52 bwang Exp $
+ * @version $Id: JmxUtil.java,v 1.2 2006/11/05 05:09:40 bstansberry Exp $
*/
public class JmxUtil extends org.jboss.cache.jmx.JmxUtil
{
- public static final String PC_PREFIX = "jboss.pojocache:service=";
+ public static final String POJO_CACHE_DOMAIN = "jboss.pojocache";
+ public static final String PC_PREFIX = POJO_CACHE_DOMAIN + ":service=PojoCache,clusterName=";
+ public static final String PC_SUFFIX = ",type=PojoCache";
/*
*/
@@ -45,7 +47,20 @@
{
// get the cache's registration name
String tmpName = getCacheObjectName((CacheSPI)cache.getCache());
- String newName = tmpName.replaceFirst(PREFIX, PC_PREFIX);
+ String newName = null;
+ if (tmpName.startsWith(PREFIX))
+ {
+ newName = tmpName.replaceFirst(PREFIX, PC_PREFIX);
+ }
+ else if (tmpName.startsWith(JBOSS_CACHE_DOMAIN))
+ {
+ newName = tmpName.replaceFirst(JBOSS_CACHE_DOMAIN, POJO_CACHE_DOMAIN);
+ }
+ else
+ {
+ newName = tmpName + PC_SUFFIX;
+ }
+
return newName;
}
More information about the jboss-cvs-commits
mailing list