@Override
  public void close() {
    if (instance != null) {
      instance.shutdown();

      logger.success("Shut down hazelcast");
    }
  }
Пример #2
0
  @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);
  }