Author: manik.surtani(a)jboss.com
Date: 2009-01-21 11:45:43 -0500 (Wed, 21 Jan 2009)
New Revision: 7565
Modified:
core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java
core/branches/flat/src/test/java/org/horizon/manager/CacheManagerComponentRegistryTest.java
Log:
Fixed JMX stuff
Modified: core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java 2009-01-21
16:17:36 UTC (rev 7564)
+++
core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java 2009-01-21
16:45:43 UTC (rev 7565)
@@ -54,7 +54,7 @@
private static final Log log = LogFactory.getLog(JmxRegistrationManager.class);
- private static final String GENERAL_PREFIX =
System.getProperty("jbosscache.jmx.prefix",
"jboss.cache:service=JBossCache");
+ private static final String GENERAL_PREFIX =
System.getProperty("horizon.jmx.prefix", "horizon:service=Horizon");
/**
* default ObjectName for clusterd caches. Cluster name should pe appended.
@@ -176,12 +176,12 @@
return;
}
if
(cacheSpi.getConfiguration().getCacheMode().equals(Configuration.CacheMode.LOCAL)) {
- objectNameBase = LOCAL_CACHE_PREFIX + System.currentTimeMillis();
+ objectNameBase = LOCAL_CACHE_PREFIX + ",instance=" +
Integer.toHexString(System.identityHashCode(cacheSpi));
} else //the cache is clustered
{
- // TODO: make sure we append the cache name as well somewhere here, since > 1
cache will be attached to the same channel.
- //objectNameBase = REPLICATED_CACHE_PREFIX +
cacheSpi.getConfiguration().getGlobalConfiguration().getClusterName();
+ objectNameBase = REPLICATED_CACHE_PREFIX +
cacheSpi.getConfiguration().getGlobalConfiguration().getClusterName();
}
+ objectNameBase = objectNameBase + ",cacheName=" + cacheSpi.getName();
}
public String getObjectName(String resourceName) {
Modified:
core/branches/flat/src/test/java/org/horizon/manager/CacheManagerComponentRegistryTest.java
===================================================================
---
core/branches/flat/src/test/java/org/horizon/manager/CacheManagerComponentRegistryTest.java 2009-01-21
16:17:36 UTC (rev 7564)
+++
core/branches/flat/src/test/java/org/horizon/manager/CacheManagerComponentRegistryTest.java 2009-01-21
16:45:43 UTC (rev 7565)
@@ -58,6 +58,7 @@
public void testForceUnsharedComponents() throws CacheNameExistsException,
NamedCacheNotFoundException {
CacheLoaderConfig clc = new CacheLoaderConfig();
+ // TODO change this to use a dummy in memory cache loader instead!!
FileCacheLoaderConfig fc = new FileCacheLoaderConfig();
fc.setLocation("/tmp");
clc.addIndividualCacheLoaderConfig(fc);
@@ -66,7 +67,7 @@
defaultCfg.setCacheMode(Configuration.CacheMode.REPL_SYNC);
defaultCfg.setCacheLoaderConfig(clc);
// cache manager with default configuration
- cm = new DefaultCacheManager(defaultCfg);
+ cm = new DefaultCacheManager(GlobalConfiguration.getClusteredDefault(),
defaultCfg);
// default cache with no overrides
Cache c = cm.getCache();