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

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

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

Cache.putIfAbsent介绍

暂无

代码示例

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

/**
 * {@inheritDoc}
 */
public Element putIfAbsent(Element element) throws NullPointerException {
  return putIfAbsent(element, false);
}

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

/**
 * {@inheritDoc}
 */
public Element putIfAbsent(Element element) throws NullPointerException {
  return putIfAbsent(element, false);
}

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

/**
 * {@inheritDoc}
 */
public Element putIfAbsent(Element element) throws NullPointerException {
  return putIfAbsent(element, false);
}

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

/**
 * {@inheritDoc}
 */
public Element putIfAbsent(Element element) throws NullPointerException {
  return putIfAbsent(element, false);
}

代码示例来源:origin: org.hibernate.ogm/hibernate-ogm-ehcache

public Element putIfAbsent(Element element) {
  return delegate.putIfAbsent( element );
}

代码示例来源:origin: fr.inria.eventcloud/eventcloud-core

@Override
public boolean markAsDelivered(NotificationId notificationId,
                SubscriptionId subscriptionId) {
  Element existing =
      this.cache.putIfAbsent(new Element(
          notificationId, subscriptionId));
  return existing == null;
}

代码示例来源:origin: justlive1/oxygen

@Override
public Object putIfAbsent(String key, Object value) {
 Element element = new Element(key, value);
 element = cache.putIfAbsent(element);
 return element == null ? null : element.getObjectValue();
}

代码示例来源:origin: actiontech/dble

@Override
public void putIfAbsent(Object key, Object value) {
  Element el = new Element(key, value);
  if (enCache.putIfAbsent(el) == null) {
    cacheStatistics.incPutTimes();
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug(name + " add cache ,key:" + key + " value:" + value);
    }
  }
}

代码示例来源:origin: justlive1/oxygen

@Override
public Object putIfAbsent(String key, Object value, long duration, TimeUnit unit) {
 Element element = new Element(key, value);
 element.setTimeToLive((int) unit.toSeconds(duration));
 element = cache.putIfAbsent(element);
 return element == null ? null : element.getObjectValue();
}

代码示例来源:origin: ww20081120/framework

@Override
public ValueWrapper putIfAbsent(Object key, Object value) {
  Element existingElement = getCache(CacheConstant.DEFAULT_CACHE_DIR).putIfAbsent(new Element(key, value));
  return toWrapper(existingElement);
}

代码示例来源:origin: org.dd4t/dd4t-caching

Element newElement = new Element(dependencyKey, cacheElement);
newElement.setTimeToLive(cacheDependencyTTL);
Element oldElement = dependencyCache.putIfAbsent(newElement);
if (oldElement != null) {
  ConcurrentSkipListSet<String> oldCacheSet = ((CacheElement<ConcurrentSkipListSet<String>>) oldElement

代码示例来源:origin: org.dd4t/dd4t-caching

currentElement = new Element(key, new CacheElementImpl<T>(null));
setExpired(currentElement, 0);
Element oldElement = cache.putIfAbsent(currentElement);
if (oldElement != null) {
  currentElement = oldElement;

代码示例来源:origin: apache/oozie

WaitingActions waitingActions = new WaitingActions();
element = new Element(missingKey, waitingActions);
Element exists = missingCache.putIfAbsent(element);
if (exists != null) {
  newlyAdded = false;

代码示例来源:origin: org.apache.oozie/oozie-core

WaitingActions waitingActions = new WaitingActions();
element = new Element(missingKey, waitingActions);
Element exists = missingCache.putIfAbsent(element);
if (exists != null) {
  newlyAdded = false;

相关文章

Cache类方法