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

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

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

Ehcache.load介绍

[英]The load method provides a means to "pre load" the cache. This method will, asynchronously, load the specified object into the cache using the associated cacheloader. If the object already exists in the cache, no action is taken. If no loader is associated with the object, no object will be loaded into the cache. If a problem is encountered during the retrieving or loading of the object, an exception should be logged. If the "arg" argument is set, the arg object will be passed to the CacheLoader.load method. The cache will not dereference the object. If no "arg" value is provided a null will be passed to the load 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.

The Ehcache native API provides similar functionality to loaders using the decorator net.sf.ehcache.constructs.blocking.SelfPopulatingCache
[中]load方法提供了一种“预加载”缓存的方法。此方法将使用关联的cacheloader异步地将指定对象加载到缓存中。如果对象已存在于缓存中,则不采取任何操作。如果没有加载程序与该对象关联,则不会将任何对象加载到缓存中。如果在检索或加载对象期间遇到问题,则应记录异常。如果设置了“arg”参数,则arg对象将传递给CacheLoader。加载方法。缓存不会取消对对象的引用。如果没有提供“arg”值,则会将null传递给load方法。允许在缓存中存储null值,但是,get方法不会区分返回缓存中存储的null和在缓存中找不到对象。在这两种情况下都返回null。
Ehcache原生API为使用decorator net的加载程序提供了类似的功能。旧金山。ehcache。构造。舞台调度。自填充缓存

代码示例

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

/**
 * {@inheritDoc}
 */
public void load(Object key) throws CacheException {
  underlyingCache.load(key);
}

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

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

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

/**
 * {@inheritDoc}
 */
public void load(Object key) throws CacheException {
  underlyingCache.load(key);
}

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

/**
 * {@inheritDoc}
 */
public void load(Object key) throws CacheException {
  underlyingCache.load(key);
}

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

/**
 * {@inheritDoc}
 */
public void load(Object key) throws CacheException {
  underlyingCache.load(key);
}

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

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

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

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

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

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

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

public void load(Object key) throws CacheException {
 self().load(key);
}

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

public void load(Object key) throws CacheException {
 self().load(key);
}

相关文章

Ehcache类方法