/** * Returns a reference to the configured {@link EvictionPolicyConfigurer} used to configure the Eviction policy * of a {@link Region}. * * @return a reference to the configured {@link EvictionPolicyConfigurer}. * @see org.springframework.data.gemfire.config.annotation.EvictionConfiguration.EvictionPolicyConfigurer */ protected EvictionPolicyConfigurer getEvictionPolicyConfigurer() { return Optional.ofNullable(this.evictionPolicyConfigurer).orElseThrow(() -> newIllegalStateException("EvictionPolicyConfigurer was not properly configured and initialized")); }
protected ExpirationPolicyConfigurer getExpirationPolicyConfigurer() { return Optional.ofNullable(this.expirationPolicyConfigurer) .orElseThrow(() -> newIllegalStateException("ExpirationPolicyConfigurer was not properly configured and initialized")); }
/** * Returns a reference to the Spring {@link BeanFactory} in the current application context. * * @return a reference to the Spring {@link BeanFactory}. * @throws IllegalStateException if the Spring {@link BeanFactory} was not properly configured. * @see org.springframework.beans.factory.BeanFactory */ protected BeanFactory getBeanFactory() { return Optional.ofNullable(this.beanFactory) .orElseThrow(() -> newIllegalStateException("BeanFactory is required")); }
/** * Gets a reference to the Pivotal GemFire Cache for which the snapshot will be taken. * * @return the Pivotal GemFire Cache used to create an instance of CacheSnapshotService. * @throws IllegalStateException if the Cache argument is null. * @see org.apache.geode.cache.Cache * @see #setCache(Cache) */ protected Cache getCache() { return Optional.ofNullable(this.cache) .orElseThrow(() -> newIllegalStateException("The cache was not properly initialized")); }
protected ExpirationPolicyConfigurer getExpirationPolicyConfigurer() { return Optional.ofNullable(this.expirationPolicyConfigurer) .orElseThrow(() -> newIllegalStateException("ExpirationPolicyConfigurer was not properly configured and initialized")); }
/** * Returns a reference to the Spring {@link BeanFactory} in the current application context. * * @return a reference to the Spring {@link BeanFactory}. * @throws IllegalStateException if the Spring {@link BeanFactory} was not properly configured. * @see org.springframework.beans.factory.BeanFactory */ protected BeanFactory getBeanFactory() { return Optional.ofNullable(this.beanFactory) .orElseThrow(() -> newIllegalStateException("BeanFactory is required")); }
/** * Returns a reference to the containing Spring {@link BeanFactory}. * * @return a reference to the containing Spring {@link BeanFactory}. * @throws IllegalStateException if the {@link BeanFactory} was not configured. * @see org.springframework.beans.factory.BeanFactory */ protected ConfigurableListableBeanFactory getBeanFactory() { return Optional.ofNullable(this.beanFactory) .orElseThrow(() -> newIllegalStateException("BeanFactory was not properly configured")); }
@SuppressWarnings("all") protected BeanFactory getBeanFactory() { return Optional.ofNullable(this.beanFactory) .orElseThrow(() -> newIllegalStateException("BeanFactory was not properly configured")); }
/** * Returns a reference to the Spring {@link ApplicationContext}. * * @return a reference to the Spring {@link ApplicationContext}. * @see org.springframework.context.ApplicationContext */ protected ApplicationContext getApplicationContext() { return Optional.ofNullable(this.applicationContext) .orElseThrow(() -> newIllegalStateException("The ApplicationContext was not properly configured")); }
protected String getIndexName() { return Optional.ofNullable(this.indexName).filter(StringUtils::hasText).orElseThrow(() -> newIllegalStateException("Index name is required")); }
protected Integer getEnableTransactionManagementOrder() { return Optional.ofNullable(this.enableTransactionManagementOrder) .orElseThrow(() -> newIllegalStateException( "The @%1$s(order) attribute was not properly set [%2$s]; Also, please make your" + " Spring application @%3$s annotated class is annotated with both @%4$s and @%1$s", EnableTransactionManagement.class.getSimpleName(), String.valueOf(this.enableTransactionManagementOrder), Configuration.class.getSimpleName(), EnableGemFireAsLastResource.class.getSimpleName())); }
protected Integer getEnableTransactionManagementOrder() { return Optional.ofNullable(this.enableTransactionManagementOrder) .orElseThrow(() -> newIllegalStateException( "The @%1$s(order) attribute was not properly set [%2$s]; Also, please make your" + " Spring application @%3$s annotated class is annotated with both @%4$s and @%1$s", EnableTransactionManagement.class.getSimpleName(), String.valueOf(this.enableTransactionManagementOrder), Configuration.class.getSimpleName(), EnableGemFireAsLastResource.class.getSimpleName())); }
protected Pool resolveNamedPool() { if (StringUtils.hasText(this.poolName)) { this.pool = Optional.ofNullable(PoolManager.find(this.poolName)) .orElseThrow(() -> newIllegalStateException("No Pool with name [%s] exists", this.poolName)); } return this.pool; }
QueryService resolveQueryService() { return Optional.ofNullable(this.queryService) .orElseGet(() -> Optional.ofNullable(lookupQueryService()) .orElseThrow(() -> newIllegalStateException("QueryService is required to create an Index"))); }
protected Pool resolveNamedPool() { if (StringUtils.hasText(this.poolName)) { this.pool = Optional.ofNullable(PoolManager.find(this.poolName)) .orElseThrow(() -> newIllegalStateException("No Pool with name [%s] exists", this.poolName)); } return this.pool; }
RegionService resolveCache() { return Optional.ofNullable(this.cache) .orElseGet(() -> Optional.ofNullable(GemfireUtils.resolveGemFireCache()) .orElseThrow(() -> newIllegalStateException("Cache is required"))); }
protected Pool resolveNamedPool() { if (StringUtils.hasText(this.poolName)) { this.pool = Optional.ofNullable(PoolManager.find(this.poolName)) .orElseThrow(() -> newIllegalStateException("No Pool with name [%s] exists", this.poolName)); } return this.pool; }
QueryService resolveQueryService() { return Optional.ofNullable(this.queryService) .orElseGet(() -> Optional.ofNullable(lookupQueryService()) .orElseThrow(() -> newIllegalStateException("QueryService is required to create an Index"))); }
protected Pool resolveNamedPool() { if (StringUtils.hasText(this.poolName)) { this.pool = Optional.ofNullable(PoolManager.find(this.poolName)) .orElseThrow(() -> newIllegalStateException("No Pool with name [%s] exists", this.poolName)); } return this.pool; }
Region<?, ?> resolveRegion(@NonNull RepositoryMetadata repositoryMetadata, String regionNamePath) { return Optional.ofNullable(getRegions().getRegion(regionNamePath)) .orElseThrow(() -> newIllegalStateException(REGION_NOT_FOUND, regionNamePath, repositoryMetadata.getDomainType().getName(), repositoryMetadata.getRepositoryInterface().getName())); }