QueueSession.getTransacted
Code IndexAdd Codota to your IDE (free)

Best code snippets using javax.jms.QueueSession.getTransacted(Showing top 15 results out of 315)

  • Common ways to obtain QueueSession
private void myMethod () {
QueueSession q =
  • QueueConnection queueConnection;queueConnection.createQueueSession(false, acknowledgeMode)
  • QueueConnection queueConnection;queueConnection.createQueueSession(transacted, acknowledgeMode)
  • TransactionAwareConnectionFactoryProxy transactionAwareConnectionFactoryProxy;ConnectionFactoryUtils.getTransactionalQueueSession((QueueConnectionFactory)transactionAwareConnectionFactoryProxy.getTargetConnectionFactory(), (QueueConnection)transactionAwareConnectionFactoryProxyTransactionAwareConnectionInvocationHandler.target, transactionAwareConnectionFactoryProxy2.isSynchedLocalTransactionAllowed())
  • AI code suggestions by Codota
}
origin: org.apache.activemq/activemq-core

/**
 * @return
 * @throws JMSException
 */
public boolean getTransacted() throws JMSException {
  return next.getTransacted();
}
origin: apache/activemq-artemis

/**
* Test that the <code>getTransacted()</code> method of a <code>Session</code> returns <code>true</code>
* if the session is transacted, <code>false</code> else.
*/
@Test
public void testGetTransacted() {
 try {
   // senderSession has been created as non transacted
   Assert.assertEquals(false, senderSession.getTransacted());
   // we re-create senderSession as a transacted session
   senderSession = senderConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
   Assert.assertEquals(true, senderSession.getTransacted());
 } catch (Exception e) {
   fail(e);
 }
}
origin: org.fusesource.joram-jms-tests/joram-jms-tests

/**
* Test that an attempt to call the <code>roolback()</code> method on a 
* <strong>non transacted</strong> <code>Session</code> throws a 
* <code>javax.jms.IllegalStateException</code>.
*/
public void testRollbackNonTransactedSession()
{
 try
 {
   // senderSession has been created as non transacted in the setUp() method
   Assert.assertEquals(false, senderSession.getTransacted());
   senderSession.rollback();
   Assert.fail("Should raise an IllegalStateException, the session is not transacted.\n");
 }
 catch (javax.jms.IllegalStateException e)
 {
 }
 catch (java.lang.IllegalStateException e)
 {
   Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException.\n");
 }
 catch (Exception e)
 {
   Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
 }
}
origin: apache/activemq-artemis

/**
* Test that a call to the <code>rollback()</code> method on a
* <strong>transacted</strong> <code>Session</code> rollbacks all
* the messages sent in the transaction.
*/
@Test
public void testRollbackTransactedSession() {
 try {
   // re-create senderSession as a transacted session
   senderSession = senderConnection.createQueueSession(true, 0);
   sender = senderSession.createSender(senderQueue);
   Assert.assertEquals(true, senderSession.getTransacted());
   TextMessage message = senderSession.createTextMessage();
   message.setText("testRollbackTransactedSession");
   // send a message within a transacted session
   sender.send(message);
   // rollback the transaction -> the sent message shouldn't be received
   senderSession.rollback();
   TextMessage m = (TextMessage) receiver.receiveNoWait();
   // test that no message has been received
   Assert.assertEquals(null, m);
 } catch (Exception e) {
   fail(e);
 }
}
origin: apache/activemq-artemis

/**
* Test that a call to the <code>rollback()</code> method on a
* <strong>transacted</strong> <code>Session</code> rollbacks all
* the messages sent in the transaction.
*/
@Test
public void testCommitTransactedSession() {
 try {
   // re-create senderSession as a transacted session
   senderSession = senderConnection.createQueueSession(true, 0);
   sender = senderSession.createSender(senderQueue);
   Assert.assertEquals(true, senderSession.getTransacted());
   TextMessage message = senderSession.createTextMessage();
   message.setText("testCommitTransactedSession");
   // send a message within a transacted session
   sender.send(message);
   TextMessage m = (TextMessage) receiver.receiveNoWait();
   // test that no message has been received (the transaction has not been committed yet)
   Assert.assertEquals(null, m);
   // commit the transaction -> the sent message should be received
   senderSession.commit();
   m = (TextMessage) receiver.receive(TestConfig.TIMEOUT);
   Assert.assertTrue(m != null);
   Assert.assertEquals("testCommitTransactedSession", m.getText());
 } catch (Exception e) {
   fail(e);
 }
}
origin: apache/activemq-artemis

/**
* Test that an attempt to call the <code>roolback()</code> method on a
* <strong>non transacted</strong> <code>Session</code> throws a
* <code>javax.jms.IllegalStateException</code>.
*/
@Test
public void testRollbackNonTransactedSession() {
 try {
   // senderSession has been created as non transacted in the setUp() method
   Assert.assertEquals(false, senderSession.getTransacted());
   senderSession.rollback();
   Assert.fail("Should raise an IllegalStateException, the session is not transacted.\n");
 } catch (javax.jms.IllegalStateException e) {
 } catch (java.lang.IllegalStateException e) {
   Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException.\n");
 } catch (Exception e) {
   Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
 }
}
origin: apache/activemq-artemis

/**
* Test that an attempt to call the <code>recover()</code> method on a
* <strong>transacted </strong> <code>Session</code> throws a
* <code>javax.jms.IllegalStateException</code>.
*/
@Test
public void testRecoverTransactedSession() {
 try {
   // senderSession has been created as non transacted
   Assert.assertEquals(false, senderSession.getTransacted());
   // we create it again but as a transacted session
   senderSession = senderConnection.createQueueSession(true, 0);
   Assert.assertEquals(true, senderSession.getTransacted());
   senderSession.recover();
   Assert.fail("Should raise an IllegalStateException, the session is not transacted.\n");
 } catch (javax.jms.IllegalStateException e) {
 } catch (java.lang.IllegalStateException e) {
   Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException.\n");
 } catch (Exception e) {
   Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
 }
}
origin: org.fusesource.joram-jms-tests/joram-jms-tests

/**
* Test that the <code>getTransacted()</code> method of a <code>Session</code> returns <code>true</code>
* if the session is transacted, <code>false</code> else.
*/
public void testGetTransacted()
{
 try
 {
   // senderSession has been created as non transacted
   Assert.assertEquals(false, senderSession.getTransacted());
   // we re-create senderSession as a transacted session
   senderSession = senderConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
   Assert.assertEquals(true, senderSession.getTransacted());
 }
 catch (Exception e)
 {
   fail(e);
 }
}
origin: org.fusesource.joram-jms-tests/joram-jms-tests

/**
* Test that an attempt to call the <code>commit()</code> method on a 
* <strong>non transacted</strong> <code>Session</code> throws a 
* <code>javax.jms.IllegalStateException</code>.
*/
public void testCommitNonTransactedSession()
{
 try
 {
   // senderSession has been created as non transacted in the setUp() method
   Assert.assertEquals(false, senderSession.getTransacted());
   senderSession.commit();
   Assert.fail("Should raise an IllegalStateException, the session is not transacted.\n");
 }
 catch (javax.jms.IllegalStateException e)
 {
 }
 catch (java.lang.IllegalStateException e)
 {
   Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException.\n");
 }
 catch (Exception e)
 {
   Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
 }
}
origin: apache/activemq-artemis

/**
* Test that an attempt to call the <code>commit()</code> method on a
* <strong>non transacted</strong> <code>Session</code> throws a
* <code>javax.jms.IllegalStateException</code>.
*/
@Test
public void testCommitNonTransactedSession() {
 try {
   // senderSession has been created as non transacted in the setUp() method
   Assert.assertEquals(false, senderSession.getTransacted());
   senderSession.commit();
   Assert.fail("Should raise an IllegalStateException, the session is not transacted.\n");
 } catch (javax.jms.IllegalStateException e) {
 } catch (java.lang.IllegalStateException e) {
   Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException.\n");
 } catch (Exception e) {
   Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
 }
}
origin: org.apache.activemq/activemq-client

@Override
public boolean getTransacted() throws JMSException {
  return next.getTransacted();
}
origin: apache/activemq

@Override
public boolean getTransacted() throws JMSException {
  return next.getTransacted();
}
origin: org.apache.activemq/activemq-all

@Override
public boolean getTransacted() throws JMSException {
  return next.getTransacted();
}
origin: org.apache.activemq/activemq-client

@Override
public boolean getTransacted() throws JMSException {
  return next.getTransacted();
}
origin: org.apache.activemq/activemq-osgi

@Override
public boolean getTransacted() throws JMSException {
  return next.getTransacted();
}
javax.jmsQueueSessiongetTransacted

Popular methods of QueueSession

  • createSender
    Creates a QueueSender object to send messages to the specified queue.
  • createReceiver
    Creates a QueueReceiver object to receive messages from the specified queue using a message selector
  • close
  • createTemporaryQueue
    Creates a TemporaryQueue object. Its lifetime will be that of the QueueConnection unless it is delet
  • createObjectMessage
  • createTextMessage
  • createQueue
    Creates a queue identity given a Queue name.This facility is provided for the rare cases where clien
  • createBrowser
    Creates a QueueBrowser object to peek at the messages on the specified queue using a message selecto
  • createConsumer
  • commit
  • createMessage
  • createBytesMessage
  • createMessage,
  • createBytesMessage,
  • createMapMessage,
  • createStreamMessage,
  • createProducer,
  • recover,
  • rollback,
  • getAcknowledgeMode,
  • getMessageListener

Popular classes and methods

  • getContentResolver (Context)
  • setContentView (Activity)
  • startActivity (Activity)
  • BorderLayout (java.awt)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JLabel (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)