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

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

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

Ehcache.getStatus介绍

[英]Gets the status attribute of the Cache.
[中]获取缓存的状态属性。

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Create an {@link EhCacheCache} instance.
 * @param ehcache the backing Ehcache instance
 */
public EhCacheCache(Ehcache ehcache) {
  Assert.notNull(ehcache, "Ehcache must not be null");
  Status status = ehcache.getStatus();
  if (!Status.STATUS_ALIVE.equals(status)) {
    throw new IllegalArgumentException(
        "An 'alive' Ehcache is required - current cache is " + status.toString());
  }
  this.cache = ehcache;
}

代码示例来源:origin: org.springframework/spring-context-support

/**
 * Create an {@link EhCacheCache} instance.
 * @param ehcache the backing Ehcache instance
 */
public EhCacheCache(Ehcache ehcache) {
  Assert.notNull(ehcache, "Ehcache must not be null");
  Status status = ehcache.getStatus();
  if (!Status.STATUS_ALIVE.equals(status)) {
    throw new IllegalArgumentException(
        "An 'alive' Ehcache is required - current cache is " + status.toString());
  }
  this.cache = ehcache;
}

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

/**
 * {@inheritDoc}
 */
public Status getStatus() {
  return underlyingCache.getStatus();
}

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

@Override
public Status getStatus() {
  return underlyingCache.getStatus();
}

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

/**
* {@inheritDoc}
*/
public Status getStatus() {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.getStatus();
  } finally {
    t.setContextClassLoader(prev);
  }
}

代码示例来源:origin: apache/kylin

Status status = ehcache.getStatus();
Assert.isTrue(Status.STATUS_ALIVE.equals(status),
    "An 'alive' Ehcache is required - current cache is " + status.toString());

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

/**
 * Gets the status attribute of the Cache.
 *
 * @return The status value as a String from the Status enum class
 */
public String getStatus() {
  return cache.getStatus().toString();
}

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

/**
 * {@inheritDoc}
 */
@Override
public String getStatus() {
  return cache.getStatus().toString();
}

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

private void notifyEventListenersChangedIfNecessary() {
    if (cache.getStatus() == Status.STATUS_ALIVE && helper.getStore() instanceof TerracottaStore) {
      ((TerracottaStore)helper.getStore()).notifyCacheEventListenersChanged();
    }
  }
}

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

/**
 * {@inheritDoc}
 */
public void load(final Ehcache cache) throws CacheException {
  if (!cache.getCacheConfiguration().isTerracottaClustered()) {
    LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader! Cache "
        + "'{}' will not be bootstrapped and no keySet snapshot will be recorded...", cache.getName());
    return;
  }
  if (cache.getStatus() != Status.STATUS_ALIVE) {
    throw new CacheException("Cache '" + cache.getName() + "' isn't alive yet: " + cache.getStatus());
  }
  if (isAsynchronous()) {
    BootstrapThread thread = new BootstrapThread(cache);
    thread.start();
  } else {
    doLoad(cache);
  }
}

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

/**
 * Remove a cache from the CacheManager. The cache is disposed of.
 *
 * @param cacheName
 *            the cache name
 * @throws IllegalStateException
 *             if the cache is not {@link Status#STATUS_ALIVE}
 */
public synchronized void removeCache(String cacheName) throws IllegalStateException {
  checkStatus();
  // NPE guard
  if (cacheName == null || cacheName.length() == 0) {
    return;
  }
  Ehcache cache = ehcaches.remove(cacheName);
  if (cache != null && cache.getStatus().equals(Status.STATUS_ALIVE)) {
    cache.dispose();
    runtimeCfg.removeCache(cache.getCacheConfiguration());
    cacheManagerEventListenerRegistry.notifyCacheRemoved(cache.getName());
  }
}

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

private Ehcache addCacheNoCheck(final Ehcache cache, final boolean strict) throws IllegalStateException, ObjectExistsException,
    CacheException {
  if (cache.getStatus() != Status.STATUS_UNINITIALISED) {
    throw new CacheException("Trying to add an already initialized cache." + " If you are adding a decorated cache, "
        + "use CacheManager.addDecoratedCache" + "(Ehcache decoratedCache) instead.");

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

/**
 * {@inheritDoc}
 */
public Status getStatus() {
  return underlyingCache.getStatus();
}

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

/**
 * Gets the status attribute of the Cache.
 * 
 * @return The status value from the Status enum class
 */
public Status getStatus() {
  return cache.getStatus();
}

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

/**
 * {@inheritDoc}
 */
public Status getStatus() {
  return underlyingCache.getStatus();
}

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

/**
 * {@inheritDoc}
 */
public String getStatus() {
  return cache.getStatus().toString();
}

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

/**
 * Gets the status attribute of the Cache.
 *
 * @return The status value as a String from the Status enum class
 */
public String getStatus() {
  return cache.getStatus().toString();
}

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

/**
 * {@inheritDoc}
 */
@Override
public String getStatus() {
  return cache.getStatus().toString();
}

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

/**
 * {@inheritDoc}
 */
@Override
public String getStatus() {
  return cache.getStatus().toString();
}

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

private void notifyEventListenersChangedIfNecessary() {
    if (cache.getStatus() == Status.STATUS_ALIVE && helper.getStore() instanceof TerracottaStore) {
      ((TerracottaStore)helper.getStore()).notifyCacheEventListenersChanged();
    }
  }
}

相关文章

Ehcache类方法