private void throwIfClient() { if (isClient()) { throw new UnsupportedOperationException("operation is not supported on a client cache"); } }
@Override public boolean isServer() { if (isClient()) { return false; } this.stopper.checkCancelInProgress(null); return this.isServer || !this.allCacheServers.isEmpty(); }
@Override public InternalQueryService getQueryService() { if (!isClient()) { return new DefaultQueryService(this); } Pool defaultPool = getDefaultPool(); if (defaultPool == null) { throw new IllegalStateException( "Client cache does not have a default pool. Use getQueryService(String poolName) instead."); } return (InternalQueryService) defaultPool.getQueryService(); }
@Override public void readyForEvents() { if (isClient()) { // If a durable client has been configured... if (Objects.nonNull(system) && Objects.nonNull(system.getConfig()) && !Objects.equals(DistributionConfig.DEFAULT_DURABLE_CLIENT_ID, Objects.toString(system.getConfig().getDurableClientId(), DistributionConfig.DEFAULT_DURABLE_CLIENT_ID))) { // Ensure that there is a pool to use for readyForEvents(). if (Objects.isNull(defaultPool)) { determineDefaultPool(); } } } PoolManagerImpl.readyForEvents(this.system, false); }
protected void initializeSessionCache() { // Retrieve the cache GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance(); if (cache == null) { throw new IllegalStateException( "No cache exists. Please configure either a PeerToPeerCacheLifecycleListener or ClientServerCacheLifecycleListener in the server.xml file."); } // Create the appropriate session cache this.sessionCache = cache.isClient() ? new ClientServerSessionCache(this, cache) : new PeerToPeerSessionCache(this, cache); // Initialize the session cache this.sessionCache.initialize(); }
sessionCache = cache.isClient() ? new ClientServerSessionCache(cache, properties) : new PeerToPeerSessionCache(cache, properties);
private boolean isServerNode() { return this.system.getDistributedMember() .getVmKind() != ClusterDistributionManager.LOCATOR_DM_TYPE && this.system.getDistributedMember() .getVmKind() != ClusterDistributionManager.ADMIN_ONLY_DM_TYPE && !isClient(); }
if (!isClient()) { throw new UnsupportedOperationException();
String cacheXmlDescription = this.cacheConfig.getCacheXMLDescription(); if (url == null && cacheXmlDescription == null) { if (isClient()) { initializeClientRegionShortcuts(this); } else {
TypeRegistry.open(); if (!isClient()) {
@SuppressWarnings("all") public static boolean isClient(GemFireCache cache) { boolean client = (cache instanceof ClientCache); if (cache instanceof GemFireCacheImpl) { client &= ((GemFireCacheImpl) cache).isClient(); } return client; }
@SuppressWarnings("all") public static boolean isClient(GemFireCache cache) { boolean client = (cache instanceof ClientCache); if (cache instanceof GemFireCacheImpl) { client &= ((GemFireCacheImpl) cache).isClient(); } return client; }
@SuppressWarnings("all") public static boolean isPeer(GemFireCache cache) { boolean peer = (cache instanceof Cache); if (cache instanceof GemFireCacheImpl) { peer &= !((GemFireCacheImpl) cache).isClient(); } return peer; }
@SuppressWarnings("all") public static boolean isPeer(GemFireCache cache) { boolean peer = (cache instanceof Cache); if (cache instanceof GemFireCacheImpl) { peer &= !((GemFireCacheImpl) cache).isClient(); } return peer; }
/** * Determines whether the Pivotal GemFire cache is a client. * * @param gemfireCache a reference to the Pivotal GemFire cache. * @return a boolean value indicating whether the Pivotal GemFire cache is a client. * @see org.apache.geode.cache.client.ClientCache * @see org.apache.geode.cache.GemFireCache */ public static boolean isClient(@Nullable GemFireCache gemfireCache) { boolean client = gemfireCache instanceof ClientCache; client &= (!(gemfireCache instanceof GemFireCacheImpl) || ((GemFireCacheImpl) gemfireCache).isClient()); return client; }
protected void initializeSessionCache() { // Retrieve the cache GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance(); if (cache == null) { throw new IllegalStateException( "No cache exists. Please configure either a PeerToPeerCacheLifecycleListener or ClientServerCacheLifecycleListener in the server.xml file."); } // Create the appropriate session cache this.sessionCache = cache.isClient() ? new ClientServerSessionCache(this, cache) : new PeerToPeerSessionCache(this, cache); // Initialize the session cache this.sessionCache.initialize(); }