/** * 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; }
@Override protected Collection<Cache> loadCaches() { net.sf.ehcache.CacheManager cacheManager = getCacheManager(); Assert.state(cacheManager != null, "No CacheManager set"); Status status = cacheManager.getStatus(); if (!Status.STATUS_ALIVE.equals(status)) { throw new IllegalStateException( "An 'alive' EhCache CacheManager is required - current cache is " + status.toString()); } String[] names = getCacheManager().getCacheNames(); Collection<Cache> caches = new LinkedHashSet<>(names.length); for (String name : names) { caches.add(new EhCacheCache(getCacheManager().getEhcache(name))); } return caches; }
@Override protected Collection<Cache> loadCaches() { net.sf.ehcache.CacheManager cacheManager = getCacheManager(); Assert.state(cacheManager != null, "No CacheManager set"); Status status = cacheManager.getStatus(); if (!Status.STATUS_ALIVE.equals(status)) { throw new IllegalStateException( "An 'alive' EhCache CacheManager is required - current cache is " + status.toString()); } String[] names = getCacheManager().getCacheNames(); Collection<Cache> caches = new LinkedHashSet<>(names.length); for (String name : names) { caches.add(new EhCacheCache(getCacheManager().getEhcache(name))); } return caches; }
@Override protected Collection<Cache> loadCaches() { Assert.notNull(this.cacheManager, "A backing EhCache CacheManager is required"); Status status = this.cacheManager.getStatus(); Assert.isTrue(Status.STATUS_ALIVE.equals(status), "An 'alive' EhCache CacheManager is required - current cache is " + status.toString()); String[] names = this.cacheManager.getCacheNames(); Collection<Cache> caches = Sets.newLinkedHashSetWithExpectedSize(names.length); for (String name : names) { if (enableMetrics) { caches.add(new InstrumentedEhCacheCache(this.cacheManager.getEhcache(name))); } else { caches.add(new EhCacheCache(this.cacheManager.getEhcache(name))); } } return caches; }
Status status = ehcache.getStatus(); Assert.isTrue(Status.STATUS_ALIVE.equals(status), "An 'alive' Ehcache is required - current cache is " + status.toString()); this.cache = ehcache;
/** * Gets the status attribute of the Ehcache * * @return The status value, as a String from the Status enum class */ public String getStatus() { return cacheManager.getStatus().toString(); }
/** * {@inheritDoc} */ public String getStatus() { return cacheManager.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(); }
/** * 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} */ 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(); }
/** * Gets the status attribute of the Ehcache * * @return The status value, as a String from the Status enum class */ public String getStatus() { return cacheManager.getStatus().toString(); }
/** * {@inheritDoc} */ public String getStatus() { return cacheManager.getStatus().toString(); }
/** * Gets the status attribute of the Ehcache * * @return The status value, as a String from the Status enum class */ public String getStatus() { return cacheManager.getStatus().toString(); }
/** * {@inheritDoc} */ public String getStatus() { return cacheManager.getStatus().toString(); }
/** * {@inheritDoc} */ @Override public String getStatus() { return cache.getStatus().toString(); }
/** * Gets the status attribute of the Ehcache * * @return The status value, as a String from the Status enum class */ public String getStatus() { return cacheManager.getStatus().toString(); }
/** * {@inheritDoc} */ public String getStatus() { return cacheManager.getStatus().toString(); }