本文整理了Java中net.sf.ehcache.Ehcache.putIfAbsent()
方法的一些代码示例,展示了Ehcache.putIfAbsent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ehcache.putIfAbsent()
方法的具体详情如下:
包路径:net.sf.ehcache.Ehcache
类名称:Ehcache
方法名:putIfAbsent
[英]Put an element in the cache if no element is currently mapped to the elements key.
[中]如果当前没有元素映射到元素键,则将元素放入缓存。
代码示例来源:origin: spring-projects/spring-framework
@Override
@Nullable
public ValueWrapper putIfAbsent(Object key, @Nullable Object value) {
Element existingElement = this.cache.putIfAbsent(new Element(key, value));
return toValueWrapper(existingElement);
}
代码示例来源:origin: AxonFramework/AxonFramework
@Override
public <K, V> boolean putIfAbsent(K key, V value) {
return ehCache.putIfAbsent(new Element(key, value)) == null;
}
代码示例来源:origin: apache/kylin
@Override
public ValueWrapper putIfAbsent(Object key, Object value) {
Element existingElement = this.cache.putIfAbsent(new Element(key, value));
return (existingElement != null ? new SimpleValueWrapper(existingElement.getObjectValue()) : null);
}
代码示例来源:origin: org.springframework/spring-context-support
@Override
@Nullable
public ValueWrapper putIfAbsent(Object key, @Nullable Object value) {
Element existingElement = this.cache.putIfAbsent(new Element(key, value));
return toValueWrapper(existingElement);
}
代码示例来源:origin: net.sf.ehcache/ehcache
@Override
public Element put() {
return underlyingCache.putIfAbsent(element);
}
});
代码示例来源:origin: net.sf.ehcache/ehcache
@Override
public Element putIfAbsent(final Element element, final boolean doNotNotifyCacheReplicators) throws NullPointerException {
return underlyingCache.putIfAbsent(element, doNotNotifyCacheReplicators);
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
public Element putIfAbsent(Element element) throws NullPointerException {
return underlyingCache.putIfAbsent(element);
}
代码示例来源:origin: net.sf.ehcache/ehcache
@Override
public Element put() {
return underlyingCache.putIfAbsent(element, doNotNotifyCacheReplicators);
}
});
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
public Element putIfAbsent(Element arg0) throws NullPointerException {
// THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
Thread t = Thread.currentThread();
ClassLoader prev = t.getContextClassLoader();
t.setContextClassLoader(this.classLoader);
try {
return this.cache.putIfAbsent(arg0);
} finally {
t.setContextClassLoader(prev);
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
public Element putIfAbsent(Element arg0, boolean arg1) throws NullPointerException {
// THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
Thread t = Thread.currentThread();
ClassLoader prev = t.getContextClassLoader();
t.setContextClassLoader(this.classLoader);
try {
return this.cache.putIfAbsent(arg0, arg1);
} finally {
t.setContextClassLoader(prev);
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
final Element ersatz = new Element(key, REFRESH_VALUE);
if (supportCache.putIfAbsent(ersatz) == null) {
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
@Override
public Element put() {
return underlyingCache.putIfAbsent(element, doNotNotifyCacheReplicators);
}
});
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* {@inheritDoc}
*/
public Element putIfAbsent(Element element) throws NullPointerException {
return underlyingCache.putIfAbsent(element);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* {@inheritDoc}
*/
public Element putIfAbsent(final Element element, final boolean doNotNotifyCacheReplicators) throws NullPointerException {
return underlyingCache.putIfAbsent(element, doNotNotifyCacheReplicators);
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
@Override
public Element put() {
return underlyingCache.putIfAbsent(element, doNotNotifyCacheReplicators);
}
});
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
@Override
public Element put() {
return underlyingCache.putIfAbsent(element);
}
});
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
@Override
public Element put() {
return underlyingCache.putIfAbsent(element, doNotNotifyCacheReplicators);
}
});
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* {@inheritDoc}
*/
public Element putIfAbsent(Element element) throws NullPointerException {
return underlyingCache.putIfAbsent(element);
}
代码示例来源:origin: io.dropwizard.metrics/metrics-ehcache
@Override
public Element putIfAbsent(Element element) throws NullPointerException {
final Timer.Context ctx = putTimer.time();
try {
return underlyingCache.putIfAbsent(element);
} finally {
ctx.stop();
}
}
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public ValueWrapper putIfAbsent(Object key, Object value) {
Element existingElement = this.cache.putIfAbsent(new Element(key, value));
return toValueWrapper(existingElement);
}
内容来源于网络,如有侵权,请联系作者删除!