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

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

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

Ehcache.getQuiet介绍

[英]Gets an element from the cache, without updating Element statistics. Cache statistics are still updated.
[中]从缓存中获取元素,而不更新元素统计信息。缓存统计信息仍在更新中。

代码示例

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

  1. /**
  2. * Gets an element from the cache, without updating Element statistics. Cache statistics are
  3. * still updated.
  4. *
  5. * @param key a serializable value
  6. * @return the element, or null, if it does not exist.
  7. */
  8. public Element getQuiet(Serializable key) throws RemoteException {
  9. return cache.getQuiet(key);
  10. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Element getQuiet(Serializable key) throws IllegalStateException, CacheException {
  5. return underlyingCache.getQuiet(key);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Element getQuiet(Object key) throws IllegalStateException, CacheException {
  5. return underlyingCache.getQuiet(key);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Element getQuiet(Serializable arg0) throws 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. return this.cache.getQuiet(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Element getQuiet(Object arg0) throws 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. return this.cache.getQuiet(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * Gets a list of elements from the cache, for a list of keys, without updating Element statistics. Time to
  3. * idle lifetimes are therefore not affected.
  4. * <p>
  5. * Cache statistics are still updated.
  6. * <p>
  7. * Callers should ideally first call this method with a small list of keys to gauge the size of a typical Element.
  8. * Then a calculation can be made of the right number to request each time so as to optimise network performance and
  9. * not cause an OutOfMemory error on this Cache.
  10. *
  11. * @param keys a list of serializable values which represent keys
  12. * @return a list of Elements. If an element was not found or null, it will not be in the list.
  13. */
  14. public List getElements(List keys) throws RemoteException {
  15. if (keys == null) {
  16. return new ArrayList();
  17. }
  18. List elements = new ArrayList();
  19. for (int i = 0; i < keys.size(); i++) {
  20. Serializable key = (Serializable) keys.get(i);
  21. Element element = cache.getQuiet(key);
  22. if (element != null) {
  23. elements.add(element);
  24. }
  25. }
  26. return elements;
  27. }

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

  1. /**
  2. * Element can never be null. Add a null guard just in case.
  3. * @param key
  4. */
  5. protected void update(final Object key) {
  6. try {
  7. Ehcache backingCache = getCache();
  8. final Element element = backingCache.getQuiet(key);
  9. if (element == null) {
  10. if (LOG.isDebugEnabled()) {
  11. LOG.debug(getName() + ": entry with key " + key + " has been removed - skipping it");
  12. }
  13. return;
  14. }
  15. refreshElement(element, backingCache);
  16. } catch (final Exception e) {
  17. // Collect the exception and keep going.
  18. // Throw the exception once all the entries have been refreshed
  19. // If the refresh fails, keep the old element. It will simply become staler.
  20. LOG.warn(getName() + "Could not refresh element " + key, e);
  21. }
  22. }

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

  1. Element quickTest = underlyingCache.getQuiet(key);
  2. if (quickTest == null || checkForRefresh(quickTest, accessTime, refreshAheadConfig.getTimeToRefreshMillis())) {
  3. final Element ersatz = new Element(key, REFRESH_VALUE);

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

  1. final Element element = backingCache.getQuiet(key);

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

  1. try {
  2. Ehcache backingCache = getCache();
  3. Element element = backingCache.getQuiet(key);
  4. if (element != null) {
  5. return refreshElement(element, backingCache, quiet);

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

  1. /**
  2. * Gets an element from the cache, without updating Element statistics. Cache statistics are
  3. * still updated.
  4. *
  5. * @param key a serializable value
  6. * @return the element, or null, if it does not exist.
  7. */
  8. public Element getQuiet(Serializable key) throws RemoteException {
  9. return cache.getQuiet(key);
  10. }

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

  1. /**
  2. * Gets an element from the cache, without updating Element statistics. Cache statistics are
  3. * still updated.
  4. *
  5. * @param key a serializable value
  6. * @return the element, or null, if it does not exist.
  7. */
  8. public Element getQuiet(Serializable key) throws RemoteException {
  9. return cache.getQuiet(key);
  10. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Element getQuiet(Object key) throws IllegalStateException, CacheException {
  5. return underlyingCache.getQuiet(key);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Element getQuiet(Object key) throws IllegalStateException, CacheException {
  5. return underlyingCache.getQuiet(key);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Element getQuiet(Serializable key) throws IllegalStateException, CacheException {
  5. return underlyingCache.getQuiet(key);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Element getQuiet(Serializable key) throws IllegalStateException, CacheException {
  5. return underlyingCache.getQuiet(key);
  6. }

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

  1. /**
  2. * Gets an element from the cache, without updating Element statistics. Cache statistics are
  3. * still updated.
  4. *
  5. * @param key a serializable value
  6. * @return the element, or null, if it does not exist.
  7. */
  8. public Element getQuiet(Serializable key) throws RemoteException {
  9. return cache.getQuiet(key);
  10. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Element getQuiet(Object key) throws IllegalStateException, CacheException {
  5. return underlyingCache.getQuiet(key);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Element getQuiet(Serializable key) throws IllegalStateException, CacheException {
  5. return underlyingCache.getQuiet(key);
  6. }

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

  1. public Element getQuiet(Serializable key) throws IllegalStateException,
  2. CacheException {
  3. return self().getQuiet(key);
  4. }

相关文章

Ehcache类方法