/** * Creates a {@link EhCacheCache} instance. * * @param ehcache backing Ehcache instance */ public EhCacheCache(Ehcache ehcache) { Assert.notNull(ehcache, "non null ehcache required"); Status status = ehcache.getStatus(); Assert.isTrue( Status.STATUS_ALIVE.equals(status), "an 'alive' ehcache is required - current cache is " + status.toString()); this.cache = ehcache; }
protected Cache getCache() { if (manager == null || Status.STATUS_SHUTDOWN.equals(manager.getStatus()) || cache == null || !Status.STATUS_ALIVE.equals(cache.getStatus())) { cache = createCache(); } else { cache = getManager().getCache(cacheId); } return cache; }