public void shutdown() { if (connectionFactory != null) { connectionFactory.shutdown(); connectionFactory = null; } if (hazelcast != null) { hazelcast.getLifecycleService().shutdown(); hazelcast = null; } }
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(); }