use of com.hazelcast.config.MapStoreConfig in project ddf by codice.
the class HazelcastNotificationStore method getHazelcastConfig.
private Config getHazelcastConfig(BundleContext context, String xmlConfigFilename) {
Config cfg = null;
Bundle bundle = context.getBundle();
URL xmlConfigFileUrl = null;
if (StringUtils.isNotBlank(xmlConfigFilename)) {
xmlConfigFileUrl = bundle.getResource(xmlConfigFilename);
}
XmlConfigBuilder xmlConfigBuilder = null;
if (xmlConfigFileUrl != null) {
try {
xmlConfigBuilder = new XmlConfigBuilder(xmlConfigFileUrl.openStream());
cfg = xmlConfigBuilder.build();
LOGGER.debug("Successfully built hazelcast config from XML config file {}", xmlConfigFilename);
} catch (FileNotFoundException e) {
LOGGER.info("FileNotFoundException trying to build hazelcast config from XML file " + xmlConfigFilename, e);
cfg = null;
} catch (IOException e) {
LOGGER.info("IOException trying to build hazelcast config from XML file " + xmlConfigFilename, e);
cfg = null;
}
}
if (cfg == null) {
LOGGER.info("Falling back to using generic Config for hazelcast");
cfg = new Config();
} else if (LOGGER.isDebugEnabled()) {
MapConfig mapConfig = cfg.getMapConfig("persistentNotifications");
if (mapConfig == null) {
LOGGER.debug("mapConfig is NULL for persistentNotifications - try persistent*");
mapConfig = cfg.getMapConfig("persistent*");
if (mapConfig == null) {
LOGGER.debug("mapConfig is NULL for persistent*");
}
} else {
MapStoreConfig mapStoreConfig = mapConfig.getMapStoreConfig();
if (mapStoreConfig != null) {
LOGGER.debug("mapStoreConfig factoryClassName = {}", mapStoreConfig.getFactoryClassName());
} else {
LOGGER.debug("mapStoreConfig is null");
}
}
}
return cfg;
}
Aggregations