/** * Instantiates all Apache Geode/Pivotal GemFire objects which have been declared * via {@link System#getProperties() System properties}. * * @param <T> {@link Class type} of the {@link GemFireCache}. * @param gemfireCache reference to the {@link GemFireCache} instance. * @return the given {@link GemFireCache} instance. * @see org.apache.geode.cache.GemFireCache */ private static <T extends GemFireCache> T constructGemFireObjects(T gemfireCache) { Properties localGemfireProperties = gemfireProperties.get(); Arrays.stream(GEMFIRE_OBJECT_BASED_PROPERTIES) .map(localGemfireProperties::getProperty) .filter(StringUtils::hasText) .filter(className -> ClassUtils.isPresent(className, ClassUtils.getDefaultClassLoader())) .forEach(className -> cacheGemFireObject(ReflectionUtils.createInstanceIfPresent(className, null))); return gemfireCache; }