public void cleanup() { infinispanManager.stop(); infinispanManager = null; }
/** * Requires to stop the engine when image servlet un-deploys */ public void stopFileManager() { try { LOGGER.info("Stopping CMS"); cacheManager.getManager().stop(); } catch (Exception e) { LOGGER.error("Error while stopping CmsImageFileManager", e); } }
public void stopFileManager() { try { cacheManager.getManager().stop(); LOGGER.info("Stopping CMS"); } catch (final Exception e) { LOGGER.error("Error while stopping CmsStaticContentFileManager", e); } }
@Override public void accept(EmbeddedCacheManager manager) { manager.removeListener(this); manager.stop(); InfinispanLogger.ROOT_LOGGER.debugf("%s cache container stopped", this.name); }
@AfterMethod public void tearDown() { if (cm != null) cm.stop(); cm =null; }
@AfterClass(alwaysRun = true) private void cleanUp() { if (cacheManager != null) { cacheManager.stop(); cacheManager = null; } }
@AfterMethod public void tearDown() throws Exception { TestingUtil.killCaches(cache); cm.stop(); }
@AfterClass public void tearDown() { if (cacheManager != null) { cacheManager.getGlobalComponentRegistry().getComponent(ExecutorService.class, KnownComponentNames.REMOTE_COMMAND_EXECUTOR).shutdownNow(); cacheManager.stop(); } }
private void testInvalidConfiguration(String xmlConfiguration) throws IOException { EmbeddedCacheManager invalidCacheManager = null; try { log.infof("Creating cache manager with %s", xmlConfiguration); invalidCacheManager = TestCacheManagerFactory .fromStream(new ByteArrayInputStream(xmlConfiguration.getBytes())); } finally { if (invalidCacheManager != null) { invalidCacheManager.stop(); } } }
@AfterClassOnce public void stop() { tm = null; cm.stop(); TestResourceTracker.testFinished(getClass().getSimpleName()); }
public void testStopStartCM() throws Exception { EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(false); cacheContainers.add(cm); cm.stop(); cm.start(); }
@AfterMethod(alwaysRun = true) public void stopSecondCacheManager() { if (otherCacheManager != null) { otherCacheManager.getCache().stop(); otherCacheManager.stop(); otherCacheManager = null; } }
public void testCacheManagerStopTwice() { EmbeddedCacheManager localCacheManager = createCacheManager(false); try { Cache<String, String> cache = localCacheManager.getCache(); cache.put("k", "v"); localCacheManager.stop(); localCacheManager.stop(); } finally { TestingUtil.killCacheManagers(localCacheManager); } }
protected void killMember(int cacheIndex, String cacheName, boolean awaitRehash) { List<Cache<Object, Object>> caches = caches(cacheName); caches.remove(cacheIndex); manager(cacheIndex).stop(); cacheManagers.remove(cacheIndex); if (awaitRehash && caches.size() > 0) { TestingUtil.blockUntilViewsReceived(60000, false, caches); TestingUtil.waitForNoRebalance(caches); } }
private void killCache() { if (stopCacheOnly) { killedCache.stop(); } else { manager(KILLED_INDEX).stop(); } if (waitForStateTransfer) { TestingUtil.waitForNoRebalance(originatorCache, otherCache); } }
public void testSkipLockingAfterPutWithTm(Method m) { EmbeddedCacheManager cacheManager = TestCacheManagerFactory.createCacheManager(true); try { AdvancedCache advancedCache = cacheManager.getCache().getAdvancedCache(); String name = m.getName(); advancedCache.put("k-" + name, "v-" + name); advancedCache.withFlags(Flag.SKIP_LOCKING).put("k-" + name, "v2-" + name); } finally { cacheManager.stop(); } }
@Test public void testIndexingOnNamedCache() { EmbeddedCacheManager cacheManager = createClusteredCacheManager(getIndexedConfig()); cacheManager.defineConfiguration("custom", cacheManager.getDefaultCacheConfiguration()); startAndIndexData("custom", cacheManager); cacheManager.stop(); assertEquals(cacheManager.getStatus(), ComponentStatus.TERMINATED); }
@Test public void testCyclicDependencies() { cacheManager.defineConfiguration("A", new ConfigurationBuilder().build()); cacheManager.defineConfiguration("B", new ConfigurationBuilder().build()); Cache<?, ?> cacheA = cacheManager.getCache("A"); Cache<?, ?> cacheB = cacheManager.getCache("B"); cacheManager.addCacheDependency("A", "B"); cacheManager.addCacheDependency("B", "A"); // Order will not be enforced cacheManager.stop(); assertAllTerminated(cacheA, cacheB); }
private void doReplicatePojoToNewJoiningNode(Method m, Object o) { Cache cache1 = manager(0).getCache(CACHE_NAME); EmbeddedCacheManager cm = createCacheManager(); try { Cache cache3 = cm.getCache(CACHE_NAME); cache1.put(k(m), o); assertEquals(o, cache3.get(k(m))); } finally { cm.stop(); } }
public void testXidReturnedOnlyOnce() throws Throwable { EmbeddedTransaction dummyTransaction1 = beginAndSuspendTx(this.cache(3)); prepareTransaction(dummyTransaction1); manager(3).stop(); TestingUtil.blockUntilViewsReceived(60000, false, cache(0), cache(1), cache(2)); TestingUtil.waitForNoRebalance(cache(0), cache(1), cache(2)); EmbeddedTransaction dummyTransaction = beginAndSuspendTx(this.cache(0)); Xid[] recover = dummyTransaction.firstEnlistedResource().recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN); assertEquals(recover.length,1); assertEquals(dummyTransaction1.getXid(), recover[0]); } }