@Override protected void releaseFromUse() { try { // todo (5.3) : if this is a manager instance that was provided to us we should probably not close it... // - when the explicit `setting` passed to `#useExplicitCacheManager` is // a CacheManager instance cacheManager.shutdown(); } finally { cacheManager = null; } }
@Override public void destroy() { if (this.cacheManager != null && this.locallyManaged) { if (logger.isInfoEnabled()) { logger.info("Shutting down EhCache CacheManager" + (this.cacheManagerName != null ? " '" + this.cacheManagerName + "'" : "")); } this.cacheManager.shutdown(); } }
public boolean stop() { cacheManager.shutdown(); cacheManager = null; return true; } }
@Override public void destroy() { if (this.cacheManager != null && this.locallyManaged) { if (logger.isInfoEnabled()) { logger.info("Shutting down EhCache CacheManager" + (this.cacheManagerName != null ? " '" + this.cacheManagerName + "'" : "")); } this.cacheManager.shutdown(); } }
@Dispose public void stop() { if (ehCacheManager != null) { ehCacheManager.shutdown(); } } }
@After public void shutdown() { cacheManager.shutdown(); }
@After public void shutdown() { nativeCacheManager.shutdown(); }
/** * Shuts-down the wrapped Ehcache CacheManager <b>only if implicitly created</b>. * <p/> * If another component injected * a non-null CacheManager into this instance before calling {@link #init() init}, this instance expects that same * component to also destroy the CacheManager instance, and it will not attempt to do so. */ public void destroy() { if (cacheManagerImplicitlyCreated) { try { net.sf.ehcache.CacheManager cacheMgr = getCacheManager(); cacheMgr.shutdown(); } catch (Throwable t) { if (log.isWarnEnabled()) { log.warn("Unable to cleanly shutdown implicitly created CacheManager instance. " + "Ignoring (shutting down)...", t); } } finally { this.manager = null; this.cacheManagerImplicitlyCreated = false; } } } }
@AfterClass public static void shutdownCacheManager() { cacheManager.removalAll(); cacheManager.shutdown(); }
@AfterClass public static void shutdownCacheManager() { cacheManager.removalAll(); cacheManager.shutdown(); }
@AfterClass public static void shutdownCacheManager() { cacheManager.removalAll(); cacheManager.shutdown(); }
System.out.println("runtime used memory: " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 / 1024 + "M"); cacheManager.shutdown();
/** * Callback to perform any necessary cleanup of the underlying cache implementation * during SessionFactory.close(). */ public final void stop() { if (manager != null) { manager.shutdown(); manager = null; } } }
/** * Shuts down the CacheManager. * <p> * If the shutdown occurs on the singleton, then the singleton is removed, so that if a singleton access method * is called, a new singleton will be created. */ public void shutdown() { cacheManager.shutdown(); }
/** * Callback to perform any necessary cleanup of the underlying cache implementation * during SessionFactory.close(). */ public void stop() { if (manager != null) { referenceCount--; if (referenceCount == 0) { manager.shutdown(); } manager = null; } } }
@Override public void run() { synchronized (this) { if (status.equals(Status.STATUS_ALIVE)) { // clear shutdown hook reference to prevent // removeShutdownHook to remove it during shutdown shutdownHook = null; LOG.info("VM shutting down with the CacheManager still active. Calling shutdown."); shutdown(); } } } };
/** * {@inheritDoc} */ public void stop() { try { if (manager != null) { if (REFERENCE_COUNT.decrementAndGet() == 0) { manager.shutdown(); } manager = null; } } catch (net.sf.ehcache.CacheException e) { throw new CacheException(e); } } }
/** * {@inheritDoc} */ public void stop() { try { if (manager != null) { mbeanRegistrationHelper.unregisterMBean(); manager.shutdown(); manager = null; } } catch (net.sf.ehcache.CacheException e) { throw new CacheException(e); } } }
public void stop() { Cache cache = manager.getCache(ehcacheConf.getPredefinedCacheName()); cache.removeAll(); manager.removeCache(ehcacheConf.getPredefinedCacheName()); manager.removalAll(); manager.clearAll(); manager.shutdown(); manager = null; }
CacheManager.getInstance().shutdown();