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

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

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

Ehcache.isDisabled介绍

[英]Whether this cache is disabled. "Disabled" means:

  1. bootstrap is disabled
  2. puts are discarded
  3. putQuites are discarded
    In all other respects the cache continues as it is.

You can disable and enable a cache programmatically through the #setDisabled(boolean) method.
[中]是否禁用此缓存。“残疾”是指:
1.已禁用引导
1.放弃看跌期权
1.腐败被丢弃
在所有其他方面,缓存都会保持原样。
您可以通过#setDisabled(boolean)方法以编程方式禁用和启用缓存。

代码示例

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

/**
 * {@inheritDoc}
 */
public boolean isDisabled() {
  return underlyingCache.isDisabled();
}

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

/**
 * {@inheritDoc}
 */
@Override
public boolean isEnabled() {
  return !cache.isDisabled();
}

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

/**
* {@inheritDoc}
*/
public boolean isDisabled() {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.isDisabled();
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
 * {@inheritDoc}
 */
public boolean isEnabled() throws CacheException {
  for (String cacheName : getCacheNames()) {
    Ehcache cache = cacheManager.getEhcache(cacheName);
    if (cache != null && cache.isDisabled()) {
      return false;
    }
  }
  return true;
}

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

/**
 * {@inheritDoc}
 */
public boolean isDisabled() {
  return underlyingCache.isDisabled();
}

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

/**
 * {@inheritDoc}
 */
public boolean isDisabled() {
  return underlyingCache.isDisabled();
}

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

/**
 * {@inheritDoc}
 */
@Override
public boolean isEnabled() {
  return !cache.isDisabled();
}

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

/**
 * {@inheritDoc}
 */
public boolean isEnabled() {
  return !cache.isDisabled();
}

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

/**
 * {@inheritDoc}
 */
public boolean isDisabled() {
  return underlyingCache.isDisabled();
}

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

/**
 * {@inheritDoc}
 */
@Override
public boolean isEnabled() {
  return !cache.isDisabled();
}

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

/**
* {@inheritDoc}
*/
public boolean isDisabled() {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.isDisabled();
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
* {@inheritDoc}
*/
public boolean isDisabled() {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.isDisabled();
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
* {@inheritDoc}
*/
public boolean isDisabled() {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.isDisabled();
  } finally {
    t.setContextClassLoader(prev);
  }
}

代码示例来源:origin: org.terracotta/h2lc-test

public CacheEntry<T> assertCacheIsEnabled() {
 Assert.assertFalse(getBackingEhcache().isDisabled());
 return this;
}

代码示例来源:origin: org.terracotta/h2lc-test

public CacheEntry<T> assertCacheIsDisabled() {
 Assert.assertTrue(getBackingEhcache().isDisabled());
 return this;
}

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

public boolean isDisabled() {
 return self().isDisabled();
}

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

/**
 * {@inheritDoc}
 */
public boolean isEnabled() throws CacheException {
  for (String cacheName : getCacheNames()) {
    Ehcache cache = cacheManager.getEhcache(cacheName);
    if (cache != null && cache.isDisabled()) {
      return false;
    }
  }
  return true;
}

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

/**
 * {@inheritDoc}
 */
public boolean isEnabled() throws CacheException {
  for (String cacheName : getCacheNames()) {
    Ehcache cache = cacheManager.getEhcache(cacheName);
    if (cache != null && cache.isDisabled()) {
      return false;
    }
  }
  return true;
}

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

/**
 * {@inheritDoc}
 */
public boolean isEnabled() throws CacheException {
  for (String cacheName : getCacheNames()) {
    Ehcache cache = cacheManager.getEhcache(cacheName);
    if (cache != null && cache.isDisabled()) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: org.pageseeder.bastille/pso-bastille

/**
 * Get the time to live for a page, in milliseconds
 *
 * @param cache The cache instance
 * @return time to live in milliseconds
 */
private static long computeTimeToLiveMilliseconds(Ehcache cache) {
 if (cache.isDisabled()) return -1;
 else {
  CacheConfiguration config = cache.getCacheConfiguration();
  if (config.isEternal()) return ONE_YEAR_IN_MILLISECONDS;
  else return config.getTimeToLiveSeconds() * MILLISECONDS_PER_SECOND;
 }
}

相关文章

微信公众号

最新文章

更多

Ehcache类方法