net.sf.ehcache.Ehcache.setSampledStatisticsEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(231)

本文整理了Java中net.sf.ehcache.Ehcache.setSampledStatisticsEnabled()方法的一些代码示例,展示了Ehcache.setSampledStatisticsEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ehcache.setSampledStatisticsEnabled()方法的具体详情如下:
包路径:net.sf.ehcache.Ehcache
类名称:Ehcache
方法名:setSampledStatisticsEnabled

Ehcache.setSampledStatisticsEnabled介绍

[英]Enable/disable sampled statistics collection. Enabling sampled statistics also enables the normal statistics collection if its not already enabled. Disabling sampled statistics does not have any effect on normal statistics.
[中]启用/禁用采样统计信息采集。启用采样统计信息还可以启用正常统计信息收集(如果尚未启用)。禁用采样统计信息不会对正常统计信息产生任何影响。

代码示例

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setSampledStatisticsEnabled(boolean enableStatistics) {
  5. underlyingCache.setSampledStatisticsEnabled(enableStatistics);
  6. }

代码示例来源:origin: com.madgag/mini-git-server-server

  1. public void setSampledStatisticsEnabled(boolean enableStatistics) {
  2. self.setSampledStatisticsEnabled(enableStatistics);
  3. }

代码示例来源:origin: rtyley/mini-git-server

  1. public void setSampledStatisticsEnabled(boolean enableStatistics) {
  2. self.setSampledStatisticsEnabled(enableStatistics);
  3. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setSampledStatisticsEnabled(boolean arg0) {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. this.cache.setSampledStatisticsEnabled(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void enableSampledStatistics() {
  5. if (!cache.isSampledStatisticsEnabled()) {
  6. try {
  7. cache.setSampledStatisticsEnabled(true);
  8. } catch (RuntimeException e) {
  9. throw Utils.newPlainException(e);
  10. }
  11. }
  12. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void disableSampledStatistics() {
  5. if (cache.isSampledStatisticsEnabled()) {
  6. try {
  7. cache.setSampledStatisticsEnabled(false);
  8. } catch (RuntimeException e) {
  9. throw Utils.newPlainException(e);
  10. }
  11. }
  12. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void enableStatistics() {
  5. if (!cache.isStatisticsEnabled()) {
  6. try {
  7. cache.setSampledStatisticsEnabled(true);
  8. cache.setStatisticsEnabled(true);
  9. } catch (RuntimeException e) {
  10. throw Utils.newPlainException(e);
  11. }
  12. }
  13. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void disableStatistics() {
  5. if (cache.isStatisticsEnabled()) {
  6. try {
  7. cache.setSampledStatisticsEnabled(false);
  8. cache.setStatisticsEnabled(false);
  9. } catch (RuntimeException e) {
  10. throw Utils.newPlainException(e);
  11. }
  12. }
  13. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. private void registerCacheMBean(Ehcache cache) throws InstanceAlreadyExistsException, MBeanRegistrationException,
  2. NotCompliantMBeanException {
  3. // enable sampled stats
  4. if (cache.isStatisticsEnabled()) {
  5. cache.setSampledStatisticsEnabled(true);
  6. }
  7. SampledCache terracottaCacheMBean = new SampledCache(cache);
  8. try {
  9. ObjectName cacheObjectName = SampledEhcacheMBeans.getCacheObjectName(clientUUID, registeredCacheManagerName,
  10. terracottaCacheMBean.getImmutableCacheName());
  11. mBeanServer.registerMBean(terracottaCacheMBean,
  12. cacheObjectName);
  13. mbeans.put(cacheObjectName, terracottaCacheMBean);
  14. } catch (MalformedObjectNameException e) {
  15. throw new MBeanRegistrationException(e);
  16. }
  17. }

代码示例来源:origin: sakaiproject/sakai

  1. rawCache.setSampledStatisticsEnabled(true);

相关文章

Ehcache类方法