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

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

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

Cache.tryRemoveImmediately介绍

[英]This shouldn't be necessary once we got rid of this stupid locking layer!
[中]一旦我们摆脱了这个愚蠢的锁定层,这就不必要了!

代码示例

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

if (element != null) {
  if (isExpired(element)) {
    tryRemoveImmediately(key, true);
    expired.add(key);
  } else {

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

/**
 * Gets an element from the cache, without updating Element statistics. Cache statistics are
 * not updated.
 * <p>
 * Listeners are not called.
 *
 * @param key a serializable value
 * @return the element, or null, if it does not exist.
 * @throws IllegalStateException if the cache is not {@link Status#STATUS_ALIVE}
 * @see #isExpired
 * @since 1.2
 */
public final Element getQuiet(Object key) throws IllegalStateException, CacheException {
  checkStatus();
  Element element = compoundStore.getQuiet(key);
  if (element == null) {
    return null;
  } else if (isExpired(element)) {
    tryRemoveImmediately(key, false);
    return null;
  } else {
    return element;
  }
}

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

return null;
} else if (isExpired(element)) {
  tryRemoveImmediately(key, true);
  getObserver.end(GetOutcome.MISS_EXPIRED);
  return null;

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

private Element elementStatsHelper(Object key, boolean quiet, boolean notifyListeners, Element element) {
  if (element != null) {
    if (isExpired(element)) {
      tryRemoveImmediately(key, notifyListeners);
      element = null;
    } else if (!(quiet || skipUpdateAccessStatistics(element))) {
      element.updateAccessStatistics();
    }
  }
  return element;
}

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

if (element != null) {
  if (isExpired(element)) {
    tryRemoveImmediately(key, true);
    expired.add(key);
  } else {

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

if (element != null) {
  if (isExpired(element)) {
    tryRemoveImmediately(key, true);
    expired.add(key);
  } else {

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

/**
 * Gets an element from the cache, without updating Element statistics. Cache statistics are
 * not updated.
 * <p>
 * Listeners are not called.
 *
 * @param key a serializable value
 * @return the element, or null, if it does not exist.
 * @throws IllegalStateException if the cache is not {@link Status#STATUS_ALIVE}
 * @see #isExpired
 * @since 1.2
 */
public final Element getQuiet(Object key) throws IllegalStateException, CacheException {
  checkStatus();
  Element element = compoundStore.getQuiet(key);
  if (element == null) {
    return null;
  } else if (isExpired(element)) {
    tryRemoveImmediately(key, false);
    return null;
  } else {
    return element;
  }
}

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

/**
 * Gets an element from the cache, without updating Element statistics. Cache statistics are
 * not updated.
 * <p/>
 * Listeners are not called.
 *
 * @param key a serializable value
 * @return the element, or null, if it does not exist.
 * @throws IllegalStateException if the cache is not {@link Status#STATUS_ALIVE}
 * @see #isExpired
 * @since 1.2
 */
public final Element getQuiet(Object key) throws IllegalStateException, CacheException {
  checkStatus();
  Element element = compoundStore.getQuiet(key);
  if (element == null) {
    return null;
  } else if (isExpired(element)) {
    tryRemoveImmediately(key, false);
    return null;
  } else {
    return element;
  }
}

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

tryRemoveImmediately(key, true);
  element = null;
} else {

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

tryRemoveImmediately(key, true);
  element = null;
} else {

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

return null;
} else if (isExpired(element)) {
  tryRemoveImmediately(key, true);
  getObserver.end(GetOutcome.MISS_EXPIRED);
  return null;

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

return null;
} else if (isExpired(element)) {
  tryRemoveImmediately(key, true);
  getObserver.end(GetOutcome.MISS_EXPIRED);
  return null;

相关文章

微信公众号

最新文章

更多

Cache类方法