@Override public void close() { if (instance != null) { instance.shutdown(); logger.success("Shut down hazelcast"); } }
@LazySingleton @Provides public HazelcastInstance getInstance(ClusteringConfig clusteringConfig) throws FileNotFoundException { if (new File(clusteringConfig.getOverridePath()).exists()) { logger .with("override-path", clusteringConfig.getOverridePath()) .info("Using hazelcast override"); final Config hazelcastXmlConfig = new XmlConfigBuilder(clusteringConfig.getOverridePath()).build(); return Hazelcast.newHazelcastInstance(hazelcastXmlConfig); } return defaultConfig(clusteringConfig); }