/** * Compete the configuration after its creation and configuration be {@link CacheManagerAware} implementor. * * @param mapConfig * The target {@link CacheConfig} to configure. */ protected void postConfigure(final CacheConfig<?, ?> mapConfig) { if (CacheResource.isStatisticEnabled()) { // When a policy is defined, assume JMX is enabled mapConfig.setStatisticsEnabled(true); } }
private static CacheConfig createCacheConfig(String cacheName) { return (CacheConfig) new CacheConfig() .setEvictionConfig(createEvictionConfig()) .setInMemoryFormat(InMemoryFormat.NATIVE) .setName(cacheName) .setStatisticsEnabled(true); }
cacheConfig.setStatisticsEnabled(Boolean.valueOf(properties.getProperty(JCACHE_STATISTICS_PROPERTY_KEY))); cacheConfig.setStatisticsEnabled(Boolean.valueOf(properties.getProperty(JCACHE_MANAGEMENT_PROPERTY_KEY)));
@Override public void setStatisticsEnabled(CacheConfig cacheConfig, String cacheNameWithPrefix, boolean enabled) { cacheConfig = cacheConfig != null ? cacheConfig : configs.get(cacheNameWithPrefix); if (cacheConfig != null) { String cacheManagerName = cacheConfig.getUriString(); cacheConfig.setStatisticsEnabled(enabled); if (enabled) { CacheStatisticsImpl cacheStatistics = createCacheStatIfAbsent(cacheNameWithPrefix); CacheStatisticsMXBeanImpl mxBean = new CacheStatisticsMXBeanImpl(cacheStatistics); MXBeanUtil.registerCacheObject(mxBean, cacheManagerName, cacheConfig.getName(), true); } else { MXBeanUtil.unregisterCacheObject(cacheManagerName, cacheConfig.getName(), true); deleteCacheStat(cacheNameWithPrefix); } } }
cacheConfig.setStatisticsEnabled(Boolean.valueOf(properties.getProperty(JCACHE_STATISTICS_PROPERTY_KEY))); cacheConfig.setStatisticsEnabled(Boolean.valueOf(properties.getProperty(JCACHE_MANAGEMENT_PROPERTY_KEY)));
@Override public void setStatisticsEnabled(CacheConfig cacheConfig, String cacheNameWithPrefix, boolean enabled) { cacheConfig = cacheConfig != null ? cacheConfig : configs.get(cacheNameWithPrefix); if (cacheConfig != null) { String cacheManagerName = cacheConfig.getUriString(); cacheConfig.setStatisticsEnabled(enabled); if (enabled) { CacheStatisticsImpl cacheStatistics = createCacheStatIfAbsent(cacheNameWithPrefix); CacheStatisticsMXBeanImpl mxBean = new CacheStatisticsMXBeanImpl(cacheStatistics); MXBeanUtil.registerCacheObject(mxBean, cacheManagerName, cacheConfig.getName(), true); } else { MXBeanUtil.unregisterCacheObject(cacheManagerName, cacheConfig.getName(), true); deleteCacheStat(cacheNameWithPrefix); } } }
target.setQuorumName(getQuorumName()); target.setReadThrough(isReadThrough()); target.setStatisticsEnabled(isStatisticsEnabled()); target.setStoreByValue(isStoreByValue()); target.setUriString(getUriString());
config.setStoreByValue(in.readBoolean()); config.setManagementEnabled(in.readBoolean()); config.setStatisticsEnabled(in.readBoolean()); config.getHotRestartConfig().setEnabled(in.readBoolean()); config.getHotRestartConfig().setFsync(in.readBoolean());
config.setStoreByValue(in.readBoolean()); config.setManagementEnabled(in.readBoolean()); config.setStatisticsEnabled(in.readBoolean()); config.getHotRestartConfig().setEnabled(in.readBoolean()); config.getHotRestartConfig().setFsync(in.readBoolean());
target.setQuorumName(getQuorumName()); target.setReadThrough(isReadThrough()); target.setStatisticsEnabled(isStatisticsEnabled()); target.setStoreByValue(isStoreByValue()); target.setUriString(getUriString());