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

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

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

Ehcache.putQuiet介绍

[英]Put an element in the cache, without updating statistics, or updating listeners. This is meant to be used in conjunction with #getQuiet
[中]将元素放入缓存中,而不更新统计信息或侦听器。这意味着要与#getQuiet一起使用

代码示例

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

@Override
  public Void put() {
    underlyingCache.putQuiet(element);
    return null;
  }
});

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

/**
 * {@inheritDoc}
 */
public void putQuiet(Element element) throws IllegalArgumentException, IllegalStateException, CacheException {
  underlyingCache.putQuiet(element);
}

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

/**
* {@inheritDoc}
*/
public void putQuiet(Element arg0) throws IllegalArgumentException, IllegalStateException, CacheException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.putQuiet(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

backingCache.putQuiet(replacementElement);
} else {
  backingCache.put(replacementElement);

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

@Override
  public Void put() {
    underlyingCache.putQuiet(element);
    return null;
  }
});

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

@Override
  public Void put() {
    underlyingCache.putQuiet(element);
    return null;
  }
});

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

/**
 * {@inheritDoc}
 */
public void putQuiet(Element element) throws IllegalArgumentException, IllegalStateException, CacheException {
  underlyingCache.putQuiet(element);
}

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

/**
 * {@inheritDoc}
 */
public void putQuiet(Element element) throws IllegalArgumentException, IllegalStateException, CacheException {
  underlyingCache.putQuiet(element);
}

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

/**
 * {@inheritDoc}
 */
public void putQuiet(Element element) throws IllegalArgumentException, IllegalStateException, CacheException {
  underlyingCache.putQuiet(element);
}

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

@Override
  public Void put() {
    underlyingCache.putQuiet(element);
    return null;
  }
});

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

/**
 * Put an element in the cache, without updating statistics, or updating listeners. This is meant to be used in conjunction with
 * {@link #getQuiet}
 * 
 * @param element
 *            An object. If Serializable it can fully participate in replication and the DiskStore.
 * @throws IllegalStateException
 *             if the cache is not {@link net.sf.ehcache.Status#STATUS_ALIVE}
 * @throws IllegalArgumentException
 *             if the element is null
 */
public void putQuiet(Element element) throws IllegalArgumentException, IllegalStateException, CacheException {
  cache.putQuiet(element);
}

代码示例来源:origin: com.github.albfernandez.richfaces/richfaces-core

public void put(Object key, Object value, Date expired) {
    int ttl = 0;
    Boolean eternal = null;

    if (expired != null) {
      eternal = Boolean.FALSE;
      ttl = (int) (expired.getTime() - System.currentTimeMillis()) / 1000;
    }

    Element element = new Element(key, value, eternal, 0, ttl);

    cache.putQuiet(element);
  }
}

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

/**
* {@inheritDoc}
*/
public void putQuiet(Element arg0) throws IllegalArgumentException, IllegalStateException, CacheException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.putQuiet(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
* {@inheritDoc}
*/
public void putQuiet(Element arg0) throws IllegalArgumentException, IllegalStateException, CacheException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.putQuiet(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
* {@inheritDoc}
*/
public void putQuiet(Element arg0) throws IllegalArgumentException, IllegalStateException, CacheException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.putQuiet(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

public void putQuiet(Element element) throws IllegalArgumentException,
  IllegalStateException, CacheException {
 self().putQuiet(element);
}

代码示例来源:origin: rtyley/mini-git-server

public void putQuiet(Element element) throws IllegalArgumentException,
  IllegalStateException, CacheException {
 self().putQuiet(element);
}

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

backingCache.putQuiet(replacementElement);
} else {
  backingCache.put(replacementElement);

代码示例来源:origin: org.ehcache/jcache

private boolean removeAndWriteIfNeeded(final K key) {
  if (cfg.isWriteThrough()) {
    ehcache.acquireWriteLockOnKey(key);
    final Element previous = ehcache.getQuiet(key);
    try {
      return ehcache.removeWithWriter(key);
    } catch (RuntimeException e) {
      if(previous != null) {
        ehcache.putQuiet(previous);
      }
      throw new CacheWriterException(e);
    }
  } else {
    if (ehcache.isKeyInCache(key)) {
      return ehcache.remove(key);
    }
    return false;
  }
}

代码示例来源:origin: ehcache/ehcache-jcache

private boolean removeAndWriteIfNeeded(final K key) {
  if (cfg.isWriteThrough()) {
    ehcache.acquireWriteLockOnKey(key);
    final Element previous = ehcache.getQuiet(key);
    try {
      return ehcache.removeWithWriter(key);
    } catch (RuntimeException e) {
      if(previous != null) {
        ehcache.putQuiet(previous);
      }
      throw new CacheWriterException(e);
    }
  } else {
    if (ehcache.isKeyInCache(key)) {
      return ehcache.remove(key);
    }
    return false;
  }
}

相关文章

Ehcache类方法