if (sessionFactory != null) session = sessionFactory.createSession(); if (session != null) sessionFactory.close();
session = sessionFactory.createSession(username, password, isXA, false, false, sessionFactory.getServerLocator().isPreAcknowledge(), transactionBatchSize); session = sessionFactory.createSession(username, password, isXA, true, true, sessionFactory.getServerLocator().isPreAcknowledge(), 0); session = sessionFactory.createSession(username, password, isXA, true, true, sessionFactory.getServerLocator().isPreAcknowledge(), dupsOKBatchSize); session = sessionFactory.createSession(username, password, isXA, true, false,
public XmlDataImporter(InputStream inputStream, String host, String port, boolean transactional) { try { reader = XMLInputFactory.newInstance().createXMLStreamReader(inputStream); HashMap<String, Object> connectionParams = new HashMap<String, Object>(); connectionParams.put(TransportConstants.HOST_PROP_NAME, host); connectionParams.put(TransportConstants.PORT_PROP_NAME, port); ServerLocator serverLocator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName(), connectionParams)); ClientSessionFactory sf = serverLocator.createSessionFactory(); session = sf.createSession(false, !transactional, true); managementSession = sf.createSession(false, true, true); localSession = true; } catch (Exception e) { e.printStackTrace(); } }
/** * Closes the passed-in {@link ClientSessionFactory}. * * @param factory the {@link ClientSessionFactory} instance to close. */ public static void closeSessionFactory(final ClientSessionFactory factory) { if (factory != null) { factory.close(); } }
if (backupSessionFactory != null) backupSessionFactory.getConnection() .getChannel(0, -1) .send(new NodeAnnounceMessage(System.currentTimeMillis(),
ServerLocator locator = sf.getServerLocator(); long callTimeout = locator.getCallTimeout();
@Override public void stop() throws Exception { shutdown.set(true); if (session != null) session.close(); ClientSession coreSession = sf.createSession(false, false, false); coreSession.deleteQueue(QUEUE_EXAMPLE_QUEUE); coreSession.close(); }
/** * Closes the passed-in {@link ClientSessionFactory}. * * @param factory the {@link ClientSessionFactory} instance to close. */ public static void closeSessionFactory(final ClientSessionFactory factory) { if (factory != null) { factory.close(); } }
backupSessionFactory.getConnection() .getChannel(0, -1) .send(new NodeAnnounceMessage(System.currentTimeMillis(),
ServerLocator locator = sf.getServerLocator(); long callTimeout = locator.getCallTimeout();
public ClientSession createSubscription(String subscriptionName, boolean durable) { ClientSession session = null; try { session = sessionFactory.createSession(); if (durable) { session.createQueue(destination, subscriptionName, true); } else { session.createTemporaryQueue(destination, subscriptionName); } return session; } catch (HornetQException e) { throw new RuntimeException(e); } }
ClientSession session = sf.createSession(); sf.close();
public void stop() { if (started == false) return; for (TopicResource topic : destination.getTopics().values()) { topic.stop(); } try { sessionFactory.close(); } catch (Exception e) { } } }
csf.getConnection().addFailureListener(new FailureListener()
ServerLocator locator = sf.getServerLocator(); long callTimeout = locator.getCallTimeout();
public void authorize() throws JMSException { try { initialSession = sessionFactory.createSession(username, password, false, false, false, false, 0); addSessionMetaData(initialSession); initialSession.addFailureListener(listener); } catch (HornetQException me) { throw JMSExceptionHelper.convertFromHornetQException(me); } }
ClientSession coreSession = sf.createSession(false, false, false); session = sf.createSession(); sf.close();
@Override public void stop() { if (started == false) return; for (QueueResource queue : destination.getQueues().values()) { queue.stop(); } try { timeoutTask.stop(); sessionFactory.close(); } catch (Exception e) { } } }