本文整理了Java中net.sf.ehcache.Cache.isExpired()
方法的一些代码示例,展示了Cache.isExpired()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cache.isExpired()
方法的具体详情如下:
包路径:net.sf.ehcache.Cache
类名称:Cache
方法名:isExpired
[英]Checks whether this cache element has expired.
The element is expired if:
代码示例来源:origin: net.sf.ehcache/ehcache
Element element = entry.getValue();
if (element != null) {
if (isExpired(element)) {
tryRemoveImmediately(key, true);
expired.add(key);
代码示例来源: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
getObserver.end(GetOutcome.MISS_NOT_FOUND);
return null;
} else if (isExpired(element)) {
tryRemoveImmediately(key, true);
getObserver.end(GetOutcome.MISS_EXPIRED);
代码示例来源: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
Element element = entry.getValue();
if (element != null) {
if (isExpired(element)) {
tryRemoveImmediately(key, true);
expired.add(key);
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
Element element = entry.getValue();
if (element != null) {
if (isExpired(element)) {
tryRemoveImmediately(key, true);
expired.add(key);
代码示例来源: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
Element element = entry.getValue();
if (element != null) {
if (isExpired(element)) {
if (LOG.isDebugEnabled()) {
LOG.debug(configuration.getName() + " cache hit, but element expired");
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
if (isExpired(element)) {
if (LOG.isDebugEnabled()) {
LOG.debug(configuration.getName() + " cache hit, but element expired");
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
getObserver.end(GetOutcome.MISS_NOT_FOUND);
return null;
} else if (isExpired(element)) {
tryRemoveImmediately(key, true);
getObserver.end(GetOutcome.MISS_EXPIRED);
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
getObserver.end(GetOutcome.MISS_NOT_FOUND);
return null;
} else if (isExpired(element)) {
tryRemoveImmediately(key, true);
getObserver.end(GetOutcome.MISS_EXPIRED);
内容来源于网络,如有侵权,请联系作者删除!