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

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

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

Ehcache.getAllWithLoader介绍

[英]The getAll method will return, from the cache, a Map of the objects associated with the Collection of keys in argument "keys". If the objects are not in the cache, the associated cache loader will be called. If no loader is associated with an object, a null is returned. If a problem is encountered during the retrieving or loading of the objects, an exception will be thrown. If the "arg" argument is set, the arg object will be passed to the CacheLoader.loadAll method. The cache will not dereference the object. If no "arg" value is provided a null will be passed to the loadAll method. The storing of null values in the cache is permitted, however, the get method will not distinguish returning a null stored in the cache and not finding the object in the cache. In both cases a null is returned.

Note. If the getAll exceeds the maximum cache size, the returned map will necessarily be less than the number specified.

Because this method may take a long time to complete, it is not synchronized. The underlying cache operations are synchronized.

The constructs package provides similar functionality using the decorator net.sf.ehcache.constructs.blocking.SelfPopulatingCache
[中]getAll方法将从缓存返回与参数“keys”中的键集合关联的对象的映射。如果对象不在缓存中,将调用关联的缓存加载程序。如果没有加载程序与对象关联,则返回null。如果在检索或加载对象期间遇到问题,将引发异常。如果设置了“arg”参数,则arg对象将传递给CacheLoader。loadAll方法。缓存不会取消对对象的引用。如果未提供“arg”值,则会将null传递给loadAll方法。允许在缓存中存储null值,但是,get方法不会区分返回缓存中存储的null和在缓存中找不到对象。在这两种情况下都返回null。
笔记如果getAll超过最大缓存大小,则返回的映射必然小于指定的数字。
由于此方法可能需要很长时间才能完成,因此不同步。底层缓存操作是同步的。
constructs包使用decorator net提供类似的功能。旧金山。ehcache。构造。舞台调度。自填充缓存

代码示例

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

/**
 * {@inheritDoc}
 */
public Map getAllWithLoader(Collection keys, Object loaderArgument) throws CacheException {
  return underlyingCache.getAllWithLoader(keys, loaderArgument);
}

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

/**
* {@inheritDoc}
*/
public Map getAllWithLoader(Collection arg0, Object arg1) throws CacheException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.getAllWithLoader(arg0, arg1);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
 * {@inheritDoc}
 */
public Map getAllWithLoader(Collection keys, Object loaderArgument) throws CacheException {
  return underlyingCache.getAllWithLoader(keys, loaderArgument);
}

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

/**
 * {@inheritDoc}
 */
public Map getAllWithLoader(Collection keys, Object loaderArgument) throws CacheException {
  return underlyingCache.getAllWithLoader(keys, loaderArgument);
}

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

/**
 * {@inheritDoc}
 */
public Map getAllWithLoader(Collection keys, Object loaderArgument) throws CacheException {
  return underlyingCache.getAllWithLoader(keys, loaderArgument);
}

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

/**
* {@inheritDoc}
*/
public Map getAllWithLoader(Collection arg0, Object arg1) throws CacheException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.getAllWithLoader(arg0, arg1);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
* {@inheritDoc}
*/
public Map getAllWithLoader(Collection arg0, Object arg1) throws CacheException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.getAllWithLoader(arg0, arg1);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
* {@inheritDoc}
*/
public Map getAllWithLoader(Collection arg0, Object arg1) throws CacheException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.getAllWithLoader(arg0, arg1);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

@SuppressWarnings("unchecked")
public Map getAllWithLoader(Collection keys, Object loaderArgument)
  throws CacheException {
 return self().getAllWithLoader(keys, loaderArgument);
}

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

@SuppressWarnings("unchecked")
public Map getAllWithLoader(Collection keys, Object loaderArgument)
  throws CacheException {
 return self().getAllWithLoader(keys, loaderArgument);
}

相关文章

Ehcache类方法