protected Set<InterestRegistrationListener> getInterestRegistrationListeners() { return nullSafeSet(this.interestRegistrationListeners); }
protected OffHeapBeanFactoryPostProcessor(Set<String> regionNames) { this.regionNames = CollectionUtils.nullSafeSet(regionNames); }
protected Set<InterestRegistrationListener> getInterestRegistrationListeners() { return nullSafeSet(this.interestRegistrationListeners); }
protected OffHeapBeanFactoryPostProcessor(Set<String> regionNames) { this.regionNames = CollectionUtils.nullSafeSet(regionNames); }
/** * Returns a {@link Set} of all names and aliases assigned to the Spring bean that is associated with * the Spring {@link BeanFactory}. * * @return a {@link Set} containing all the names and aliases assigned to the Spring bean associated with * the Spring {@link BeanFactory}. * @see #setBeanName(String) */ protected Set<String> getAssociatedBeanNameWithAliases() { return Collections.unmodifiableSet(nullSafeSet(this.associatedBeanNameWithAliases)); }
/** * Returns a {@link Set} of all names and aliases assigned to the Spring bean that is associated with * the Spring {@link BeanFactory}. * * @return a {@link Set} containing all the names and aliases assigned to the Spring bean associated with * the Spring {@link BeanFactory}. * @see #setBeanName(String) */ protected Set<String> getAssociatedBeanNameWithAliases() { return Collections.unmodifiableSet(nullSafeSet(this.associatedBeanNameWithAliases)); }
private Set<Region> onlyClientRegions(Set<Region> regions) { return nullSafeSet(regions).stream().filter(RegionUtils::isClient).collect(Collectors.toSet()); } }
/** * Constructs an instance of {@link ExpirationPolicyMetaData} initialized with the given expiration policy * configuraiton meta-data and {@link Region} expiration settings. * * @param expirationAttributes {@link ExpirationAttributes} specifying the expiration timeout in seconds * and expiration action taken when the {@link Region} entry expires. * @param regionNames names of {@link Region Regions} configured with the expiration policy meta-data. * @param types type of expiration algorithm/behaviors (TTI/TTL) configured for the {@link Region}. * @throws IllegalArgumentException if the {@link ExpirationType} {@link Set} is empty. * @see org.springframework.data.gemfire.config.annotation.EnableExpiration.ExpirationType * @see org.apache.geode.cache.ExpirationAttributes */ protected ExpirationPolicyMetaData(ExpirationAttributes expirationAttributes, Set<String> regionNames, Set<ExpirationType> types) { Assert.notEmpty(types, "At least one ExpirationPolicy type [TTI, TTL] is required"); this.defaultExpirationAttributes = expirationAttributes; this.regionNames.addAll(CollectionUtils.nullSafeSet(regionNames)); this.types.addAll(CollectionUtils.nullSafeSet(types)); }
private Set<Region> onlyClientRegions(Set<Region> regions) { return nullSafeSet(regions).stream().filter(RegionUtils::isClient).collect(Collectors.toSet()); } }
/** * Constructs an instance of {@link ExpirationPolicyMetaData} initialized with the given expiration policy * configuraiton meta-data and {@link Region} expiration settings. * * @param expirationAttributes {@link ExpirationAttributes} specifying the expiration timeout in seconds * and expiration action taken when the {@link Region} entry expires. * @param regionNames names of {@link Region Regions} configured with the expiration policy meta-data. * @param types type of expiration algorithm/behaviors (TTI/TTL) configured for the {@link Region}. * @throws IllegalArgumentException if the {@link ExpirationType} {@link Set} is empty. * @see org.springframework.data.gemfire.config.annotation.EnableExpiration.ExpirationType * @see org.apache.geode.cache.ExpirationAttributes */ protected ExpirationPolicyMetaData(ExpirationAttributes expirationAttributes, Set<String> regionNames, Set<ExpirationType> types) { Assert.notEmpty(types, "At least one ExpirationPolicy type [TTI, TTL] is required"); this.defaultExpirationAttributes = expirationAttributes; this.regionNames.addAll(CollectionUtils.nullSafeSet(regionNames)); this.types.addAll(CollectionUtils.nullSafeSet(types)); }
/** * Attaches the given query definitions. * * @param queries set of queries */ public void setQueryListeners(Set<ContinuousQueryDefinition> queries) { getContinuousQueryDefinitions().clear(); getContinuousQueryDefinitions().addAll(nullSafeSet(queries)); }
/** * Attaches the given query definitions. * * @param queries set of queries */ public void setQueryListeners(Set<ContinuousQueryDefinition> queries) { getContinuousQueryDefinitions().clear(); getContinuousQueryDefinitions().addAll(nullSafeSet(queries)); }
/** * Registers all the provided names for given Spring {@link BeanFactory}. * * @param names {@link Set} of names and aliases to associate with the Spring {@link BeanFactory}. * @param beanFactory reference to the Spring {@link BeanFactory}. * @see org.springframework.beans.factory.BeanFactory * @throws IllegalArgumentException if {@link BeanFactory} is {@literal null}. * @throws IllegalStateException if one of the provided names is already associated with * an existing, other than given, Spring {@link BeanFactory}. * @see org.springframework.beans.factory.BeanFactory */ protected static synchronized void registerAliases(Set<String> names, BeanFactory beanFactory) { Set<String> safeNames = nullSafeSet(names); Assert.isTrue(safeNames.isEmpty() || beanFactory != null, "BeanFactory must not be null when aliases are specified"); for (String name : safeNames) { BeanFactory existingBeanFactory = BEAN_FACTORIES.putIfAbsent(name, beanFactory); Assert.isTrue(nullOrEquals(existingBeanFactory, beanFactory), String.format("BeanFactory reference already exists for key [%s]", name)); } }
/** * Registers all the provided names for given Spring {@link BeanFactory}. * * @param names {@link Set} of names and aliases to associate with the Spring {@link BeanFactory}. * @param beanFactory reference to the Spring {@link BeanFactory}. * @see org.springframework.beans.factory.BeanFactory * @throws IllegalArgumentException if {@link BeanFactory} is {@literal null}. * @throws IllegalStateException if one of the provided names is already associated with * an existing, other than given, Spring {@link BeanFactory}. * @see org.springframework.beans.factory.BeanFactory */ protected static synchronized void registerAliases(Set<String> names, BeanFactory beanFactory) { Set<String> safeNames = nullSafeSet(names); Assert.isTrue(safeNames.isEmpty() || beanFactory != null, "BeanFactory must not be null when aliases are specified"); for (String name : safeNames) { BeanFactory existingBeanFactory = BEAN_FACTORIES.putIfAbsent(name, beanFactory); Assert.isTrue(nullOrEquals(existingBeanFactory, beanFactory), String.format("BeanFactory reference already exists for key [%s]", name)); } }
@Override public void serialize(GemFireSessionAttributes sessionAttributes, DataOutput out) { synchronized (sessionAttributes.getLock()) { Set<String> attributeNames = nullSafeSet(sessionAttributes.getAttributeNames()); safeWrite(out, output -> output.writeInt(attributeNames.size())); attributeNames.forEach(attributeName -> { safeWrite(out, output -> output.writeUTF(attributeName)); safeWrite(out, output -> serializeObject(sessionAttributes.getAttribute(attributeName), output)); }); } }
.map(RegionAttributes::getCacheListeners).orElse(null), CacheListener.class))); Set<String> asyncEventQueueIds = new HashSet<>(nullSafeSet(optionalRegionAttributes .map(RegionAttributes::getAsyncEventQueueIds).orElse(null))); Set<String> gatewaySenderIds = new HashSet<>(nullSafeSet(optionalRegionAttributes .map(RegionAttributes::getGatewaySenderIds).orElse(null)));
new CopyOnWriteArrayList<>(nullSafeSet(baseRegionAttributes.getAsyncEventQueueIds())); new CopyOnWriteArrayList<>(nullSafeSet(baseRegionAttributes.getGatewaySenderIds()));