예제 #1
0
    public void shutdown() {
      if (connectionFactory != null) {
        connectionFactory.shutdown();
        connectionFactory = null;
      }

      if (hazelcast != null) {
        hazelcast.getLifecycleService().shutdown();
        hazelcast = null;
      }
    }
예제 #2
0
    public void restart() {
      if (hazelcast != null) {
        shutdown();
      }

      hazelcast = Hazelcast.newHazelcastInstance(config);

      HazelcastMQConfig mqConfig = new HazelcastMQConfig();
      mqConfig.setHazelcastInstance(hazelcast);

      connectionFactory = HazelcastMQ.newHazelcastMQInstance(mqConfig);
      mqContext = connectionFactory.createContext();
    }