/** * Gets a context from the MQ instance. The default implementation simply uses * {@link HazelcastMQInstance#createContext()} but subclasses can use * different strategies. * * @param hazelcastMQInstance the HazelcastMQInstance to get the context from * * @return the context instance */ protected HazelcastMQContext getContext( HazelcastMQInstance hazelcastMQInstance) { return hazelcastMQInstance.createContext(); }
public XAHazelcastMQContext createXAContext() { XAHazelcastMQContext mqContext = mqInstance.createXAContext(); mqContext.start(); return mqContext; }
public void shutdown() { if (hazelcast != null) { mqInstance.shutdown(); hazelcast.getLifecycleService().shutdown(); hazelcast = null; } } }
HazelcastMQContext mqContext = mqInstance.createContext(); mqContext.start(); mqInstance.shutdown();
.newHazelcastMQInstance(mqConfig); try (HazelcastMQContext mqContext = mqInstance.createContext()) { mqInstance.shutdown();
@Override protected HazelcastMQContext getContext( HazelcastMQInstance hazelcastMQInstance) { HazelcastMQContext context = HazelcastMQUtils. getTransactionalHazelcastMQContext(hazelcastMQInstance, true); if (context == null) { context = hazelcastMQInstance.createContext(); } return context; }
.newHazelcastMQInstance(mqConfig); HazelcastMQContext mqProducerContext = mqInstance.createContext(); HazelcastMQContext mqConsumerContext1 = mqInstance.createContext(); HazelcastMQContext mqConsumerContext2 = mqInstance.createContext(); HazelcastMQContext mqConsumerContext3 = mqInstance.createContext(); mqConsumerContext2.close(); mqConsumerContext3.close(); mqInstance.shutdown();
public void shutdown() { if (hazelcast != null) { mqInstance.shutdown(); hazelcast.getLifecycleService().shutdown(); hazelcast = null; } } }
public HazelcastMQContext createContext(boolean transacted) { HazelcastMQContext mqContext = mqInstance.createContext(transacted); mqContext.start(); return mqContext; }
.newHazelcastMQInstance(mqConfig); HazelcastMQContext mqProducerContext = mqInstance.createContext(); HazelcastMQContext mqConsumerContext1 = mqInstance.createContext(); HazelcastMQContext mqConsumerContext2 = mqInstance.createContext(); HazelcastMQContext mqConsumerContext3 = mqInstance.createContext(); mqConsumerContext2.close(); mqConsumerContext3.close(); mqInstance.shutdown();
public void shutdown() { if (connectionFactory != null) { connectionFactory.shutdown(); connectionFactory = null; } if (hazelcast != null) { hazelcast.getLifecycleService().shutdown(); hazelcast = null; } } }
public HazelcastMQContext createContext(boolean transacted) { HazelcastMQContext mqContext = mqInstance.createContext(transacted); mqContext.start(); return mqContext; }
.newHazelcastMQInstance(mqConfig); HazelcastMQContext mqProducerContext = mqInstance.createContext(); HazelcastMQContext mqConsumerContext = mqInstance.createContext(); mqProducerContext.close(); mqConsumerContext.close(); mqInstance.shutdown();
public void kill() { if (connectionFactory != null) { connectionFactory.shutdown(); connectionFactory = null; } if (hazelcast != null) { hazelcast.getLifecycleService().terminate(); hazelcast = null; } }
public HazelcastMQContext createContext(boolean transacted) { HazelcastMQContext mqContext = mqInstance.createContext(transacted); mqContext.start(); return mqContext; }
consumerNode.start(); HazelcastMQContext mqContext = mqInstance.createContext(); mqInstance.shutdown();
public void shutdown() { if (hazelcast != null) { mqInstance.shutdown(); hazelcast.getLifecycleService().shutdown(); hazelcast = null; } } }
/** * Constructs the connection which is a child of the given connection factory. * * @param connectionFactory * the parent connection factory */ public HazelcastMQJmsConnection( HazelcastMQJmsConnectionFactory connectionFactory) { this.connectionFactory = connectionFactory; this.config = connectionFactory.getConfig(); this.sessionMap = new ConcurrentHashMap<String, HazelcastMQJmsSession>(); this.temporaryDestinationMap = new ConcurrentHashMap<String, Destination>(); this.mqContext = config.getHazelcastMQInstance().createContext(); }
HazelcastMQContext mqContext = mqInstance.createContext(); mqContext.stop(); mqContext.close(); mqInstance.shutdown();
connection.close(); mqInstance.shutdown();