/** * Returns the {@link DistributedSystem} formed from cache initialization. * * @param <T> {@link Class} type of the {@link DistributedSystem}. * @return an instance of the {@link DistributedSystem}. * @see org.apache.geode.distributed.DistributedSystem */ <T extends DistributedSystem> T getDistributedSystem() { return GemfireUtils.getDistributedSystem(); }
public static boolean isGemfireFeatureAvailable(Element element) { boolean featureAvailable = (!isAsyncEventQueue(element) || isAsyncEventQueueAvailable()); featureAvailable &= (!isContinuousQuery(element) || isContinuousQueryAvailable()); featureAvailable &= (!isGateway(element) || isGatewayAvailable()); return featureAvailable; }
private static boolean isContinuousQueryAvailable() { return isClassAvailable(CQ_TYPE_NAME); }
public static boolean isGemfireFeatureAvailable(GemfireFeature feature) { boolean featureAvailable = (!GemfireFeature.AEQ.equals(feature) || isAsyncEventQueueAvailable()); featureAvailable &= (!GemfireFeature.CONTINUOUS_QUERY.equals(feature) || isContinuousQueryAvailable()); featureAvailable &= (!GemfireFeature.WAN.equals(feature) || isGatewayAvailable()); return featureAvailable; }
RegionService resolveCache() { return Optional.ofNullable(this.cache) .orElseGet(() -> Optional.ofNullable(GemfireUtils.resolveGemFireCache()) .orElseThrow(() -> newIllegalStateException("Cache is required"))); }
/** * Resolves the Pivotal GemFire/Apache Geode {@link Properties} used to configure the {@link ClientCache}. * * @return the resolved Pivotal GemFire/Apache Geode {@link Properties} used to configure the {@link ClientCache}. * @see org.apache.geode.distributed.DistributedSystem#getProperties() * @see #getDistributedSystem() */ @Override protected Properties resolveProperties() { Properties gemfireProperties = super.resolveProperties(); DistributedSystem distributedSystem = getDistributedSystem(); if (GemfireUtils.isConnected(distributedSystem)) { Properties distributedSystemProperties = (Properties) distributedSystem.getProperties().clone(); distributedSystemProperties.putAll(gemfireProperties); gemfireProperties = distributedSystemProperties; } GemfireUtils.configureDurableClient(gemfireProperties, getDurableClientId(), getDurableClientTimeout()); return gemfireProperties; }
apacheGeodeProductName(), apacheGeodeVersion(), cache.getName()));
/** * @inheritDoc */ @Override public Region<K, V> createRegion(GemFireCache gemfireCache, String regionName) throws Exception { return GemfireUtils.isClient(gemfireCache) ? newClientRegion(gemfireCache, regionName) : newServerRegion(gemfireCache, regionName); }
/** * Determines whether the {@link ClientCache} exists yet or not. * * @return a boolean value indicating whether the single {@link ClientCache} instance * has been created yet. * @see org.springframework.data.gemfire.GemfireUtils#getClientCache() * @see org.apache.geode.distributed.DistributedSystem * @see org.apache.geode.cache.client.ClientCache */ boolean isClientCachePresent() { return Optional.ofNullable(GemfireUtils.getClientCache()) .filter(clientCache -> !clientCache.isClosed()) .map(ClientCache::getDistributedSystem) .filter(GemfireUtils::isConnected) .isPresent(); }
public static boolean isGemfireFeatureAvailable(GemfireFeature feature) { boolean featureAvailable = (!GemfireFeature.AEQ.equals(feature) || isAsyncEventQueueAvailable()); featureAvailable &= (!GemfireFeature.CONTINUOUS_QUERY.equals(feature) || isContinuousQueryAvailable()); featureAvailable &= (!GemfireFeature.WAN.equals(feature) || isGatewayAvailable()); return featureAvailable; }
RegionService resolveCache() { return Optional.ofNullable(this.cache) .orElseGet(() -> Optional.ofNullable(GemfireUtils.resolveGemFireCache()) .orElseThrow(() -> newIllegalStateException("Cache is required"))); }
/** * Resolves the Pivotal GemFire/Apache Geode {@link Properties} used to configure the {@link ClientCache}. * * @return the resolved Pivotal GemFire/Apache Geode {@link Properties} used to configure the {@link ClientCache}. * @see org.apache.geode.distributed.DistributedSystem#getProperties() * @see #getDistributedSystem() */ @Override protected Properties resolveProperties() { Properties gemfireProperties = super.resolveProperties(); DistributedSystem distributedSystem = getDistributedSystem(); if (GemfireUtils.isConnected(distributedSystem)) { Properties distributedSystemProperties = (Properties) distributedSystem.getProperties().clone(); distributedSystemProperties.putAll(gemfireProperties); gemfireProperties = distributedSystemProperties; } GemfireUtils.configureDurableClient(gemfireProperties, getDurableClientId(), getDurableClientTimeout()); return gemfireProperties; }
apacheGeodeProductName(), apacheGeodeVersion(), cache.getName()));
/** * @inheritDoc */ @Override public Region<K, V> createRegion(GemFireCache gemfireCache, String regionName) throws Exception { return GemfireUtils.isClient(gemfireCache) ? newClientRegion(gemfireCache, regionName) : newServerRegion(gemfireCache, regionName); }
/** * Determines whether the {@link ClientCache} exists yet or not. * * @return a boolean value indicating whether the single {@link ClientCache} instance * has been created yet. * @see org.springframework.data.gemfire.GemfireUtils#getClientCache() * @see org.apache.geode.distributed.DistributedSystem * @see org.apache.geode.cache.client.ClientCache */ boolean isClientCachePresent() { return Optional.ofNullable(GemfireUtils.getClientCache()) .filter(clientCache -> !clientCache.isClosed()) .map(ClientCache::getDistributedSystem) .filter(GemfireUtils::isConnected) .isPresent(); }
public static boolean isGemfireFeatureAvailable(Element element) { boolean featureAvailable = (!isAsyncEventQueue(element) || isAsyncEventQueueAvailable()); featureAvailable &= (!isContinuousQuery(element) || isContinuousQueryAvailable()); featureAvailable &= (!isGateway(element) || isGatewayAvailable()); return featureAvailable; }
/** * Resolves a reference to the {@link GemFireCache} required by this Aspect to perform its function. * * This method either returns the configured {@link GemFireCache} instance or looks up * the {@link GemFireCache} instance using GemFire's API. * * @return a reference to the resolved {@link GemFireCache} instance. * @see org.springframework.data.gemfire.GemfireUtils#resolveGemFireCache() * @see org.apache.geode.cache.GemFireCache * @see #getGemFireCache() */ protected synchronized GemFireCache resolveGemFireCache() { GemFireCache gemfireCache = getGemFireCache(); if (gemfireCache == null) { gemfireCache = this.gemfireCache = GemfireUtils.resolveGemFireCache(); } return gemfireCache; }
GemfireUtils.isClient(gemfireCache) ? getClientRegionShortcut() : getServerRegionShortcut());
private static boolean isAsyncEventQueueAvailable() { return isClassAvailable(ASYNC_EVENT_QUEUE_TYPE_NAME); }
/** * Returns the {@link DistributedSystem} formed from cache initialization. * * @param <T> {@link Class} type of the {@link DistributedSystem}. * @return an instance of the {@link DistributedSystem}. * @see org.apache.geode.distributed.DistributedSystem */ <T extends DistributedSystem> T getDistributedSystem() { return GemfireUtils.getDistributedSystem(); }