com.alachisoft.ncache.jsr107.NCacheMXBean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ncache-professional-client Show documentation
Show all versions of ncache-professional-client Show documentation
NCache Professional client for java.
package com.alachisoft.ncache.jsr107;
import com.alachisoft.ncache.common.caching.statistics.monitoring.CacheMonitor;
public class NCacheMXBean {
protected NCacheCache jCache;
private String name;
/**
* @param cache
* @param name
*/
public NCacheMXBean(NCacheCache cache, String name) {
this.jCache = cache;
this.name = name;
}
private String sanitize(String string) {
return string == null ? "" : string.replaceAll(",|:|=|\n", ".");
}
String getObjectName() {
String cacheManagerName = sanitize(jCache.getCacheManager().getURI().toString());
String cacheName = sanitize(jCache.getName());
return "javax.cache:type=Cache" + name + ",CacheManager="
+ cacheManagerName + ",Cache=" + cacheName;
}
CacheMonitor getTayzGrid() {
return (CacheMonitor) jCache.unwrap(CacheMonitor.class);
}
}