/** * 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; }
/** * 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; }
/** * {@inheritDoc} */ public Status getStatus() { return underlyingCache.getStatus(); }
@Override public Status getStatus() { return underlyingCache.getStatus(); }
/** * {@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); } }
Status status = ehcache.getStatus(); Assert.isTrue(Status.STATUS_ALIVE.equals(status), "An 'alive' Ehcache is required - current cache is " + status.toString());
/** * 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(); }
/** * {@inheritDoc} */ @Override public String getStatus() { return cache.getStatus().toString(); }
private void notifyEventListenersChangedIfNecessary() { if (cache.getStatus() == Status.STATUS_ALIVE && helper.getStore() instanceof TerracottaStore) { ((TerracottaStore)helper.getStore()).notifyCacheEventListenersChanged(); } } }
/** * {@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); } }
/** * 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()); } }
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.");
/** * {@inheritDoc} */ public Status getStatus() { return underlyingCache.getStatus(); }
/** * Gets the status attribute of the Cache. * * @return The status value from the Status enum class */ public Status getStatus() { return cache.getStatus(); }
/** * {@inheritDoc} */ public Status getStatus() { return underlyingCache.getStatus(); }
/** * {@inheritDoc} */ public String getStatus() { return cache.getStatus().toString(); }
/** * 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(); }
/** * {@inheritDoc} */ @Override public String getStatus() { return cache.getStatus().toString(); }
/** * {@inheritDoc} */ @Override public String getStatus() { return cache.getStatus().toString(); }
private void notifyEventListenersChangedIfNecessary() { if (cache.getStatus() == Status.STATUS_ALIVE && helper.getStore() instanceof TerracottaStore) { ((TerracottaStore)helper.getStore()).notifyCacheEventListenersChanged(); } } }