private static void closeClientCache() { try { if (clientCache != null) { clientCache.close(); } } catch (Exception ignored) { // ignored } }
private Pool getDefaultPool() { return getCache().getDefaultPool(); }
public InternalDistributedSystem getSystem() { return clientCache.getInternalDistributedSystem(); }
&& this.pdxReadSerialized != cacheInstance.getPdxReadSerialized()) { throw new IllegalStateException( String.format("Existing cache has different cache configuration, it has:%s", "pdxReadSerialized: " + cacheInstance.getPdxReadSerialized())); if (this.pdxDiskStoreUserSet && !equals(this.pdxDiskStore, cacheInstance.getPdxDiskStore())) { throw new IllegalStateException( String.format("Existing cache has different cache configuration, it has:%s", "pdxDiskStore: " + cacheInstance.getPdxDiskStore())); if (this.pdxPersistentUserSet && this.pdxPersistent != cacheInstance.getPdxPersistent()) { throw new IllegalStateException( String.format("Existing cache has different cache configuration, it has:%s", "pdxPersistent: " + cacheInstance.getPdxPersistent())); && this.pdxIgnoreUnreadFields != cacheInstance.getPdxIgnoreUnreadFields()) { throw new IllegalStateException( String.format("Existing cache has different cache configuration, it has:%s", "pdxIgnoreUnreadFields: " + cacheInstance.getPdxIgnoreUnreadFields())); && !samePdxSerializer(this.pdxSerializer, cacheInstance.getPdxSerializer())) { throw new IllegalStateException( String.format("Existing cache has different cache configuration, it has:%s", "pdxSerializer: " + cacheInstance.getPdxSerializer()));
@Override public Execution onServer(RegionService regionService, String... groups) { if (regionService == null) { throw new FunctionException(String.format("%s passed is null", "RegionService instance ")); } if (regionService instanceof GemFireCacheImpl) { InternalClientCache internalCache = (InternalClientCache) regionService; if (!internalCache.isClient()) { throw new FunctionException("The cache was not a client cache"); } else if (internalCache.getDefaultPool() != null) { return onServer(internalCache.getDefaultPool(), groups); } else { throw new FunctionException("The client cache does not have a default pool"); } } else { ProxyCache proxyCache = (ProxyCache) regionService; return new ServerFunctionExecutor(proxyCache.getUserAttributes().getPool(), false, proxyCache, groups); } }
/** * Gets an arbitrary open instance of {@link ClientCache} produced by an earlier call to * {@link #create}. * * @throws CacheClosedException if a cache has not been created or the only created one is * {@link ClientCache#isClosed closed} * @throws IllegalStateException if the cache was created by CacheFactory instead of * ClientCacheFactory */ public static synchronized ClientCache getAnyInstance() { InternalClientCache instance = GemFireCacheImpl.getInstance(); if (instance == null) { throw new CacheClosedException( "A cache has not yet been created."); } else { if (!instance.isClient()) { throw new IllegalStateException( "The singleton cache was created by CacheFactory not ClientCacheFactory."); } instance.getCancelCriterion().checkCancelInProgress(null); return instance; } }
@SuppressWarnings("unchecked") @Override public Region<K, V> create(String name) throws RegionExistsException { return getCache().basicCreateRegion(name, createRegionAttributes()); }
@Override public Execution onServers(RegionService regionService, String... groups) { if (regionService == null) { throw new FunctionException(String.format("%s passed is null", "RegionService instance ")); } if (regionService instanceof GemFireCacheImpl) { InternalClientCache internalCache = (InternalClientCache) regionService; if (!internalCache.isClient()) { throw new FunctionException("The cache was not a client cache"); } else if (internalCache.getDefaultPool() != null) { return onServers(internalCache.getDefaultPool(), groups); } else { throw new FunctionException("The client cache does not have a default pool"); } } else { ProxyCache proxyCache = (ProxyCache) regionService; return new ServerFunctionExecutor(proxyCache.getUserAttributes().getPool(), true, proxyCache, groups); } }
if (cache instanceof GemFireCacheImpl) { InternalClientCache gfc = (InternalClientCache) cache; if (gfc.getDefaultPool() != null) { defaultPoolName = gfc.getDefaultPool().getName(); if (cache instanceof GemFireCacheImpl) { InternalClientCache gfc = (InternalClientCache) cache; if (gfc.getDefaultPool() != null) { defaultPoolName = gfc.getDefaultPool().getName();