/** * shuts down this server and closes the embedded GemFire caching node */ public void shutdown() { if (acceptor != null) { this.acceptor.interrupt(); } this.executor.shutdownNow(); this.cache.close(); }
public static void closeCache() { try { if (!cache.isClosed()) { cache.close(); } } catch (Exception e) { e.printStackTrace(); } }
@Override public boolean authorizeOperation(String regionName, OperationContext context) { if (context instanceof ExecuteCQOperationContext) { cache.close(); // return false; throw new CacheClosedException("cache is closed"); } return true; } }
public void closeCache() { if (!cache.isClosed()) { cache.close(); } }
private static void cleanupOffline() { if (offlineCache != null) { offlineCache.close(); offlineCache = null; } if (offlineDS != null) { offlineDS.disconnect(); offlineDS = null; } }
public static void closeCacheInVM(VM vm) { vm.invoke(() -> { cache.close(); }); }
@After public void closeCache() { if (this.cache != null) { this.cache.close(); } }
private void doStopInProcess() { cache.close(); cache = null; if (process != null) { process.stop(deletePidFileOnStop); process = null; } }
@Override public void run() { Cache cache = (Cache) remoteObjects.remove(CACHE_KEY); cache.close(); disconnectFromDS(); } });
public static void restartCache() { try { if (!cache.isClosed()) { cache.close(); } cache = CacheFactory.create(ds); } catch (Exception e) { e.printStackTrace(); } }
protected void disconnect(Cache cache) { DistributedSystem dsys = cache.getDistributedSystem(); cache.close(); dsys.disconnect(); }
@After public void tearDown() throws Exception { if (cache != null) { cache.close(); } }
public static void closeCache() { if (expected != null) { expected.remove(); expected = null; } if (cache != null && !cache.isClosed()) { cache.close(); cache.getDistributedSystem().disconnect(); } }
public static void closeCache(boolean keepalive) { if (expected != null) { expected.remove(); expected = null; } if (cache != null && !cache.isClosed()) { cache.close(keepalive); cache.getDistributedSystem().disconnect(); } }
@Override public void afterCreate(EntryEvent event) { if ((Long) event.getKey() == 900) { cache.getLogger().fine(" Gateway sender is killed by a test"); cache.close(); cache.getDistributedSystem().disconnect(); } } };
protected static void closeCache() { removeExpectedExceptions(ignoredExceptions); if (cache != null && !cache.isClosed()) { DistributedSystem sys = cache.getDistributedSystem(); cache.close(); sys.disconnect(); cache = null; } disconnectFromDS(); }
protected static void closeCache(final Boolean keepAlive) { removeExpectedExceptions(ignoredExceptions); if (cache != null && !cache.isClosed()) { DistributedSystem sys = cache.getDistributedSystem(); cache.close(keepAlive); sys.disconnect(); cache = null; } disconnectFromDS(); }
@Test public void reconnectedCacheIsClosed() { Cache cache = mock(Cache.class, "Cache"); Cache reconnectedCache = mock(Cache.class, "ReconnectedCache"); when(cache.isReconnecting()).thenReturn(false).thenReturn(false).thenReturn(true); when(cache.getCacheServers()).thenReturn(Collections.emptyList()); when(cache.getReconnectedCache()).thenReturn(reconnectedCache); new Builder().setCache(cache).build().waitOnServer(); verify(cache, atLeast(3)).isReconnecting(); verify(cache).getReconnectedCache(); verify(reconnectedCache).close(); }
public static void killSender() { LogWriterUtils.getLogWriter().info("Gateway sender is going to be killed by a test"); cache.close(); cache.getDistributedSystem().disconnect(); LogWriterUtils.getLogWriter().info("Gateway sender is killed by a test"); }
public static void closeCache() throws IOException { if (cache != null && !cache.isClosed()) { cache.close(); cache.getDistributedSystem().disconnect(); cache = null; } else { AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(); if (test.isConnectedToDS()) { test.getSystem().disconnect(); } } }