private SetConfig getSetConfig(final com.typesafe.config.Config c) { final SetConfig setConfig = new SetConfig(); setConfig.setName(ConfigUtils.getString(c, "name").orElseThrow(new ConfigurationExceptionSupplier("name is required"))); ConfigUtils.getInt(c, "backup-count").ifPresent(setConfig::setBackupCount); ConfigUtils.getInt(c, "async-backup-count").ifPresent(setConfig::setAsyncBackupCount); ConfigUtils.getInt(c, "max-size").ifPresent(setConfig::setMaxSize); ConfigUtils.getBoolean(c, "statistics-enabled").ifPresent(setConfig::setStatisticsEnabled); return setConfig; }
public HazelcastInstance build() { Config config = new Config(); if (listener != null) { SetConfig setConfig = new SetConfig(); setConfig.setName(PUBLISHED_SERVICES); setConfig.addItemListenerConfig(new ItemListenerConfig(listener, true)); config.addSetConfig(setConfig); } config.setInstanceName(UUID.randomUUID().toString()); return Hazelcast.newHazelcastInstance(config); }
@Override protected SetConfig getConfig() { if (config == null) { config = nodeEngine.getConfig().findSetConfig(name); } return config; }