public synchronized void signalStopToAllSessions() { for (ActiveMQSession session : sessions) { ClientSession coreSession = session.getCoreSession(); if (coreSession instanceof ClientSessionInternal) { ClientSessionInternal internalSession = (ClientSessionInternal) coreSession; internalSession.setStopSignal(); } } }
private void checkClosed() throws JMSException { if (consumer.isClosed() || session.getCoreSession().isClosed()) { throw new IllegalStateException("Consumer is closed"); } }
public void delete() throws JMSException { if (session != null) { if (session.getCoreSession().isClosed()) { // Temporary queues will be deleted when the connection is closed.. nothing to be done then! return; } if (isQueue()) { session.deleteTemporaryQueue(this); } else { session.deleteTemporaryTopic(this); } } }
ClientSession coreSession = session.getCoreSession(); boolean needSession = ackMode == Session.CLIENT_ACKNOWLEDGE || ackMode == ActiveMQJMSConstants.INDIVIDUAL_ACKNOWLEDGE || jmsMsg.doBeforeReceive(); } catch (IndexOutOfBoundsException ioob) { ((ClientSessionInternal) session.getCoreSession()).markRollbackOnly(); ((ClientSessionInternal) session.getCoreSession()).markRollbackOnly(); throw JMSExceptionHelper.convertFromActiveMQException(e); } catch (ActiveMQInterruptedException e) { ((ClientSessionInternal) session.getCoreSession()).markRollbackOnly(); throw JMSExceptionHelper.convertFromActiveMQException(e);
ActiveMQMessage msg = ActiveMQMessage.createMessage(message, session.getCoreSession(), options); message.acknowledge(); } catch (ActiveMQException e) { ((ClientSessionInternal) session.getCoreSession()).markRollbackOnly(); ActiveMQJMSClientLogger.LOGGER.errorProcessingMessage(e); session.getCoreSession().rollback(true); ((ClientSessionInternal) session.getCoreSession()).markRollbackOnly(); ActiveMQJMSClientLogger.LOGGER.errorProcessingMessage(e);
public synchronized void signalStopToAllSessions() { for (ActiveMQSession session : sessions) { ClientSession coreSession = session.getCoreSession(); if (coreSession instanceof ClientSessionInternal) { ClientSessionInternal internalSession = (ClientSessionInternal) coreSession; internalSession.setStopSignal(); } } }
@Override public void setInput(InputStream inputStream, Session session) throws Exception { XMLStreamReader streamReader = XMLInputFactory.newInstance().createXMLStreamReader(inputStream); this.clientSession = ((ActiveMQSession) session).getCoreSession(); this.reader = new XMLMessageImporter(streamReader, clientSession); }
public synchronized void signalStopToAllSessions() { for (ActiveMQSession session : sessions) { ClientSession coreSession = session.getCoreSession(); if (coreSession instanceof ClientSessionInternal) { ClientSessionInternal internalSession = (ClientSessionInternal) coreSession; internalSession.setStopSignal(); } } }
@Override public void setInput(InputStream inputStream, Session session) throws Exception { XMLStreamReader streamReader = XMLInputFactory.newInstance().createXMLStreamReader(inputStream); this.clientSession = ((ActiveMQSession) session).getCoreSession(); this.reader = new XMLMessageImporter(streamReader, clientSession); }
public synchronized void signalStopToAllSessions() { for (ActiveMQSession session : sessions) { ClientSession coreSession = session.getCoreSession(); if (coreSession instanceof ClientSessionInternal) { ClientSessionInternal internalSession = (ClientSessionInternal) coreSession; internalSession.setStopSignal(); } } }
public synchronized void signalStopToAllSessions() { for (ActiveMQSession session : sessions) { ClientSession coreSession = session.getCoreSession(); if (coreSession instanceof ClientSessionInternal) { ClientSessionInternal internalSession = (ClientSessionInternal) coreSession; internalSession.setStopSignal(); } } }
private void checkClosed() throws JMSException { if (consumer.isClosed() || session.getCoreSession().isClosed()) { throw new IllegalStateException("Consumer is closed"); } }
private void checkClosed() throws JMSException { if (consumer.isClosed() || session.getCoreSession().isClosed()) { throw new IllegalStateException("Consumer is closed"); } }
private void checkClosed() throws JMSException { if (consumer.isClosed() || session.getCoreSession().isClosed()) { throw new IllegalStateException("Consumer is closed"); } }
/** * Returns the ID of the Node that this session is associated with. * * @return Node ID */ public String getNodeId() throws JMSException { ActiveMQSession session = (ActiveMQSession) getSessionInternal(); ClientSessionFactoryInternal factory = (ClientSessionFactoryInternal) session.getCoreSession().getSessionFactory(); return factory.getLiveNodeId(); }
/** * Returns the ID of the Node that this session is associated with. * * @return Node ID */ public String getNodeId() throws JMSException { ActiveMQSession session = (ActiveMQSession) getSessionInternal(); ClientSessionFactoryInternal factory = (ClientSessionFactoryInternal) session.getCoreSession().getSessionFactory(); return factory.getLiveNodeId(); }
private void checkClosed() throws JMSException { if (consumer.isClosed() || session.getCoreSession().isClosed()) { throw new IllegalStateException("Consumer is closed"); } }
public void delete() throws JMSException { if (session != null) { if (session.getCoreSession().isClosed()) { // Temporary queues will be deleted when the connection is closed.. nothing to be done then! return; } if (isQueue()) { session.deleteTemporaryQueue(this); } else { session.deleteTemporaryTopic(this); } } }
private boolean checkQueueFromInternalAddress(String queue) throws JMSException, ActiveMQException { try (Connection coreConn = coreCf.createConnection()) { ActiveMQSession session = (ActiveMQSession) coreConn.createSession(); ClientSession coreSession = session.getCoreSession(); ClientSession.QueueQuery query = coreSession.queueQuery(new SimpleString(queue)); assertTrue("Queue doesn't exist: " + queue, query.isExists()); SimpleString qAddr = query.getAddress(); return qAddr.toString().startsWith(AdvisorySupport.ADVISORY_TOPIC_PREFIX); } } }
@Test public void testUsingDeadConnection() throws Exception { for (int i = 0; i < 100; i++) { final Connection conn1 = cf1.createConnection(); Session sess1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE); RemotingConnection rc1 = ((ClientSessionInternal) ((ActiveMQSession) sess1).getCoreSession()).getConnection(); rc1.fail(new ActiveMQNotConnectedException("blah")); try { conn1.createSession(false, Session.AUTO_ACKNOWLEDGE); Assert.fail("should throw exception"); } catch (JMSException e) { //pass } conn1.close(); } }