本文整理汇总了Java中javax.cache.management.CacheStatisticsMXBean类的典型用法代码示例。如果您正苦于以下问题:Java CacheStatisticsMXBean类的具体用法?Java CacheStatisticsMXBean怎么用?Java CacheStatisticsMXBean使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CacheStatisticsMXBean类属于javax.cache.management包,在下文中一共展示了CacheStatisticsMXBean类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: registerCacheObject
import javax.cache.management.CacheStatisticsMXBean; //导入依赖的package包/类
/**
* @param mxbean MXBean.
* @param name Cache name.
* @param beanType Bean type.
*/
private void registerCacheObject(Object mxbean, String name, String beanType) {
MBeanServer mBeanSrv = ignite.configuration().getMBeanServer();
ObjectName registeredObjName = getObjectName(name, beanType);
try {
if (mBeanSrv.queryNames(registeredObjName, null).isEmpty()) {
IgniteStandardMXBean bean = beanType.equals(CACHE_CONFIGURATION)
? new IgniteStandardMXBean((CacheMXBean)mxbean, CacheMXBean.class)
: new IgniteStandardMXBean((CacheStatisticsMXBean)mxbean, CacheStatisticsMXBean.class);
mBeanSrv.registerMBean(bean, registeredObjName);
}
}
catch (Exception e) {
throw new CacheException("Failed to register MBean: " + registeredObjName, e);
}
}
开发者ID:apache,项目名称:ignite,代码行数:24,代码来源:CacheManager.java
示例2: Ex4Service
import javax.cache.management.CacheStatisticsMXBean; //导入依赖的package包/类
public Ex4Service() throws URISyntaxException {
CachingProvider cachingProvider = Caching.getCachingProvider("org.ehcache.jsr107.EhcacheCachingProvider");
CacheManager cacheManager = cachingProvider.getCacheManager(
getClass().getResource("/ehcache-ex4.xml").toURI(),
getClass().getClassLoader());
cache = cacheManager.getCache("someCache4", Long.class, Person.class);
try {
MBeanServer beanServer = ManagementFactory.getPlatformMBeanServer();
ObjectName objectName = new ObjectName("javax.cache:type=CacheStatistics,CacheManager="
+ getClass().getResource("/ehcache-ex4.xml")
.toURI()
.toString()
.replace(":", ".") + ",Cache=someCache4");
cacheStatisticsMXBean = MBeanServerInvocationHandler.newProxyInstance(beanServer, objectName, CacheStatisticsMXBean.class, false);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
开发者ID:aurbroszniowski,项目名称:DevoxxFr2017,代码行数:21,代码来源:Ex4Service.java
示例3: retrieveStatsNames
import javax.cache.management.CacheStatisticsMXBean; //导入依赖的package包/类
private List<String> retrieveStatsNames() {
Class<?> c = CacheStatisticsMXBean.class;
return Arrays.stream(c.getMethods())
.filter(method -> method.getName().startsWith("get"))
.map(method -> method.getName().substring(3))
.collect(Collectors.toList());
}
开发者ID:Dualion,项目名称:jhipster-ng-admin,代码行数:8,代码来源:JCacheGaugeSet.java
示例4: registerStatistics
import javax.cache.management.CacheStatisticsMXBean; //导入依赖的package包/类
/**
* Register the {@link CacheStatisticsMXBean} for the given cache.
*
* @param cache the cache for which to register statistics
* @param mxBean the statistics MXBean
*/
public static void registerStatistics(CouchbaseCache<?, ?> cache, CacheStatisticsMXBean mxBean) {
registerBean(cache, mxBean, ManagementType.Statistics);
}
开发者ID:couchbaselabs,项目名称:couchbase-java-cache,代码行数:10,代码来源:ManagementUtil.java
注:本文中的javax.cache.management.CacheStatisticsMXBean类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论