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

x33g5p2x  于2022-01-18 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(159)

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

Cache.setDisabled介绍

[英]Disables or enables this cache. This call overrides the previous value of disabled, even if the net.sf.ehcache.disabled system property is set
[中]禁用或启用此缓存。即使设置了net.sf.ehcache.disabled系统属性,此调用也会覆盖先前的禁用值

代码示例

代码示例来源:origin: net.sf.ehcache/ehcache

/**
 * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#setRegionCachesEnabled(boolean)
 */
public void setRegionCachesEnabled(final boolean flag) {
  for (String name : this.cacheManager.getCacheNames()) {
    Cache cache = this.cacheManager.getCache(name);
    if (cache != null) {
      cache.setDisabled(!flag);
    }
  }
  sendNotification(CACHE_ENABLED, flag);
}

代码示例来源:origin: net.sf.ehcache/ehcache

/**
 * {@inheritDoc}
 */
public void setRegionCacheEnabled(String region, boolean enabled) {
  Cache cache = this.cacheManager.getCache(region);
  if (cache != null) {
    cache.setDisabled(!enabled);
  }
  sendNotification(CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region);
}

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

/**
 * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#setRegionCachesEnabled(boolean)
 */
public void setRegionCachesEnabled(final boolean flag) {
  for (String name : this.cacheManager.getCacheNames()) {
    Cache cache = this.cacheManager.getCache(name);
    if (cache != null) {
      cache.setDisabled(!flag);
    }
  }
  sendNotification(CACHE_ENABLED, flag);
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

/**
 * {@inheritDoc}
 */
public void setRegionCacheEnabled(String region, boolean enabled) {
  Cache cache = this.cacheManager.getCache(region);
  if (cache != null) {
    cache.setDisabled(!enabled);
  }
  sendNotification(CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region);
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

/**
 * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#setRegionCachesEnabled(boolean)
 */
public void setRegionCachesEnabled(final boolean flag) {
  for (String name : this.cacheManager.getCacheNames()) {
    Cache cache = this.cacheManager.getCache(name);
    if (cache != null) {
      cache.setDisabled(!flag);
    }
  }
  sendNotification(CACHE_ENABLED, flag);
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
 * {@inheritDoc}
 */
public void setRegionCacheEnabled(String region, boolean enabled) {
  Cache cache = this.cacheManager.getCache(region);
  if (cache != null) {
    cache.setDisabled(!enabled);
  }
  sendNotification(CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region);
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
 * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#setRegionCachesEnabled(boolean)
 */
public void setRegionCachesEnabled(final boolean flag) {
  for (String name : this.cacheManager.getCacheNames()) {
    Cache cache = this.cacheManager.getCache(name);
    if (cache != null) {
      cache.setDisabled(!flag);
    }
  }
  sendNotification(CACHE_ENABLED, flag);
}

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

/**
 * {@inheritDoc}
 */
public void setRegionCacheEnabled(String region, boolean enabled) {
  Cache cache = this.cacheManager.getCache(region);
  if (cache != null) {
    cache.setDisabled(!enabled);
  }
  sendNotification(CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region);
}

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

/**
 * Create a raw Cache object based on the configuration of this FactoryBean.
 */
protected Cache createCache() {
  // Only call EHCache 1.6 constructor if actually necessary (for compatibility with EHCache 1.3+)
  Cache cache = (!this.clearOnFlush) ?
      new Cache(this.cacheName, this.maxElementsInMemory, this.memoryStoreEvictionPolicy,
          this.overflowToDisk, null, this.eternal, this.timeToLive, this.timeToIdle,
          this.diskPersistent, this.diskExpiryThreadIntervalSeconds, null,
          this.bootstrapCacheLoader, this.maxElementsOnDisk, this.diskSpoolBufferSize,
          this.clearOnFlush) :
      new Cache(this.cacheName, this.maxElementsInMemory, this.memoryStoreEvictionPolicy,
          this.overflowToDisk, null, this.eternal, this.timeToLive, this.timeToIdle,
          this.diskPersistent, this.diskExpiryThreadIntervalSeconds, null,
          this.bootstrapCacheLoader, this.maxElementsOnDisk, this.diskSpoolBufferSize);
  if (this.cacheEventListeners != null) {
    for (CacheEventListener listener : this.cacheEventListeners) {
      cache.getCacheEventNotificationService().registerListener(listener);
    }
  }
  if (this.disabled) {
    cache.setDisabled(true);
  }
  net.sf.ehcache.config.CacheConfiguration config = cache.getCacheConfiguration();
  config.setMaxEntriesLocalHeap(maxElementsInMemory);
  return cache;
}

相关文章

Cache类方法