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

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

本文整理了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

  1. @Override
  2. public Void put() {
  3. underlyingCache.putQuiet(element);
  4. return null;
  5. }
  6. });

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void putQuiet(Element element) throws IllegalArgumentException, IllegalStateException, CacheException {
  5. underlyingCache.putQuiet(element);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void putQuiet(Element arg0) throws IllegalArgumentException, IllegalStateException, CacheException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. this.cache.putQuiet(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. backingCache.putQuiet(replacementElement);
  2. } else {
  3. backingCache.put(replacementElement);

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

  1. @Override
  2. public Void put() {
  3. underlyingCache.putQuiet(element);
  4. return null;
  5. }
  6. });

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

  1. @Override
  2. public Void put() {
  3. underlyingCache.putQuiet(element);
  4. return null;
  5. }
  6. });

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void putQuiet(Element element) throws IllegalArgumentException, IllegalStateException, CacheException {
  5. underlyingCache.putQuiet(element);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void putQuiet(Element element) throws IllegalArgumentException, IllegalStateException, CacheException {
  5. underlyingCache.putQuiet(element);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void putQuiet(Element element) throws IllegalArgumentException, IllegalStateException, CacheException {
  5. underlyingCache.putQuiet(element);
  6. }

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

  1. @Override
  2. public Void put() {
  3. underlyingCache.putQuiet(element);
  4. return null;
  5. }
  6. });

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

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

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

  1. public void put(Object key, Object value, Date expired) {
  2. int ttl = 0;
  3. Boolean eternal = null;
  4. if (expired != null) {
  5. eternal = Boolean.FALSE;
  6. ttl = (int) (expired.getTime() - System.currentTimeMillis()) / 1000;
  7. }
  8. Element element = new Element(key, value, eternal, 0, ttl);
  9. cache.putQuiet(element);
  10. }
  11. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void putQuiet(Element arg0) throws IllegalArgumentException, IllegalStateException, CacheException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. this.cache.putQuiet(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void putQuiet(Element arg0) throws IllegalArgumentException, IllegalStateException, CacheException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. this.cache.putQuiet(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void putQuiet(Element arg0) throws IllegalArgumentException, IllegalStateException, CacheException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. this.cache.putQuiet(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

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

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

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

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

  1. backingCache.putQuiet(replacementElement);
  2. } else {
  3. backingCache.put(replacementElement);

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

  1. private boolean removeAndWriteIfNeeded(final K key) {
  2. if (cfg.isWriteThrough()) {
  3. ehcache.acquireWriteLockOnKey(key);
  4. final Element previous = ehcache.getQuiet(key);
  5. try {
  6. return ehcache.removeWithWriter(key);
  7. } catch (RuntimeException e) {
  8. if(previous != null) {
  9. ehcache.putQuiet(previous);
  10. }
  11. throw new CacheWriterException(e);
  12. }
  13. } else {
  14. if (ehcache.isKeyInCache(key)) {
  15. return ehcache.remove(key);
  16. }
  17. return false;
  18. }
  19. }

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

  1. private boolean removeAndWriteIfNeeded(final K key) {
  2. if (cfg.isWriteThrough()) {
  3. ehcache.acquireWriteLockOnKey(key);
  4. final Element previous = ehcache.getQuiet(key);
  5. try {
  6. return ehcache.removeWithWriter(key);
  7. } catch (RuntimeException e) {
  8. if(previous != null) {
  9. ehcache.putQuiet(previous);
  10. }
  11. throw new CacheWriterException(e);
  12. }
  13. } else {
  14. if (ehcache.isKeyInCache(key)) {
  15. return ehcache.remove(key);
  16. }
  17. return false;
  18. }
  19. }

相关文章

Ehcache类方法