org.apache.activemq.artemis.jms.client

## Class ActiveMQJMSContext

- java.lang.Object
- - org.apache.activemq.artemis.jms.client.ActiveMQJMSContext

- All Implemented Interfaces:
    AutoCloseable, javax.jms.JMSContext
  Direct Known Subclasses:
    ActiveMQXAJMSContext

      public class ActiveMQJMSContext
      extends Object
      implements javax.jms.JMSContext

  ActiveMQ Artemis implementation of a JMSContext.

- - ### Field Summary

    - ### Fields inherited from interface javax.jms.JMSContext

      `AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ActiveMQJMSContext(ActiveMQConnectionForContext connection, int ackMode, ThreadAwareContext threadAwareContext)`
    `ActiveMQJMSContext(ActiveMQConnectionForContext connection, ThreadAwareContext threadAwareContext)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `acknowledge()`
    `void` | `close()`
    `void` | `commit()`
    `javax.jms.QueueBrowser` | `createBrowser(javax.jms.Queue queue)`
    `javax.jms.QueueBrowser` | `createBrowser(javax.jms.Queue queue, String messageSelector)`
    `javax.jms.BytesMessage` | `createBytesMessage()`
    `javax.jms.JMSConsumer` | `createConsumer(javax.jms.Destination destination)`
    `javax.jms.JMSConsumer` | `createConsumer(javax.jms.Destination destination, String messageSelector)`
    `javax.jms.JMSConsumer` | `createConsumer(javax.jms.Destination destination, String messageSelector, boolean noLocal)`
    `javax.jms.JMSContext` | `createContext(int sessionMode)`
    `javax.jms.JMSConsumer` | `createDurableConsumer(javax.jms.Topic topic, String name)`
    `javax.jms.JMSConsumer` | `createDurableConsumer(javax.jms.Topic topic, String name, String messageSelector, boolean noLocal)`
    `javax.jms.MapMessage` | `createMapMessage()`
    `javax.jms.Message` | `createMessage()`
    `javax.jms.ObjectMessage` | `createObjectMessage()`
    `javax.jms.ObjectMessage` | `createObjectMessage(Serializable object)`
    `javax.jms.JMSProducer` | `createProducer()`
    `javax.jms.Queue` | `createQueue(String queueName)`
    `javax.jms.JMSConsumer` | `createSharedConsumer(javax.jms.Topic topic, String sharedSubscriptionName)`
    `javax.jms.JMSConsumer` | `createSharedConsumer(javax.jms.Topic topic, String sharedSubscriptionName, String messageSelector)`
    `javax.jms.JMSConsumer` | `createSharedDurableConsumer(javax.jms.Topic topic, String name)`
    `javax.jms.JMSConsumer` | `createSharedDurableConsumer(javax.jms.Topic topic, String name, String messageSelector)`
    `javax.jms.StreamMessage` | `createStreamMessage()`
    `javax.jms.TemporaryQueue` | `createTemporaryQueue()`
    `javax.jms.TemporaryTopic` | `createTemporaryTopic()`
    `javax.jms.TextMessage` | `createTextMessage()`
    `javax.jms.TextMessage` | `createTextMessage(String text)`
    `javax.jms.Topic` | `createTopic(String topicName)`
    `boolean` | `getAutoStart()`
    `String` | `getClientID()`
    `javax.jms.JMSContext` | `getContext()`
    `javax.jms.ExceptionListener` | `getExceptionListener()`
    `javax.jms.ConnectionMetaData` | `getMetaData()`
    `javax.jms.Session` | `getSession()`
    `int` | `getSessionMode()`
    `ThreadAwareContext` | `getThreadAwareContext()`
    `boolean` | `getTransacted()`
    `javax.jms.Session` | `getUsedSession()` This is to be used on tests only.
    `XAResource` | `getXAResource()`
    `void` | `recover()`
    `void` | `rollback()`
    `void` | `setAutoStart(boolean autoStart)`
    `void` | `setClientID(String clientID)`
    `void` | `setExceptionListener(javax.jms.ExceptionListener listener)`
    `void` | `start()`
    `void` | `stop()`
    `void` | `unsubscribe(String name)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ActiveMQJMSContext

          public ActiveMQJMSContext(ActiveMQConnectionForContext connection,
                                    int ackMode,
                                    ThreadAwareContext threadAwareContext)

    - #### ActiveMQJMSContext

          public ActiveMQJMSContext(ActiveMQConnectionForContext connection,
                                    ThreadAwareContext threadAwareContext)

  - ### Method Detail

    - #### getContext

          public javax.jms.JMSContext getContext()

    - #### getSession

          public javax.jms.Session getSession()

    - #### getXAResource

          public XAResource getXAResource()

    - #### createContext

          public javax.jms.JMSContext createContext(int sessionMode)

      Specified by:
        `createContext` in interface `javax.jms.JMSContext`

    - #### createProducer

          public javax.jms.JMSProducer createProducer()

      Specified by:
        `createProducer` in interface `javax.jms.JMSContext`

    - #### getClientID

          public String getClientID()

      Specified by:
        `getClientID` in interface `javax.jms.JMSContext`

    - #### setClientID

          public void setClientID(String clientID)

      Specified by:
        `setClientID` in interface `javax.jms.JMSContext`

    - #### getMetaData

          public javax.jms.ConnectionMetaData getMetaData()

      Specified by:
        `getMetaData` in interface `javax.jms.JMSContext`

    - #### getExceptionListener

          public javax.jms.ExceptionListener getExceptionListener()

      Specified by:
        `getExceptionListener` in interface `javax.jms.JMSContext`

    - #### setExceptionListener

          public void setExceptionListener(javax.jms.ExceptionListener listener)

      Specified by:
        `setExceptionListener` in interface `javax.jms.JMSContext`

    - #### start

          public void start()

      Specified by:
        `start` in interface `javax.jms.JMSContext`

    - #### stop

          public void stop()

      Specified by:
        `stop` in interface `javax.jms.JMSContext`

    - #### setAutoStart

          public void setAutoStart(boolean autoStart)

      Specified by:
        `setAutoStart` in interface `javax.jms.JMSContext`

    - #### getAutoStart

          public boolean getAutoStart()

      Specified by:
        `getAutoStart` in interface `javax.jms.JMSContext`

    - #### close

          public void close()

      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `javax.jms.JMSContext`

    - #### createBytesMessage

          public javax.jms.BytesMessage createBytesMessage()

      Specified by:
        `createBytesMessage` in interface `javax.jms.JMSContext`

    - #### createMapMessage

          public javax.jms.MapMessage createMapMessage()

      Specified by:
        `createMapMessage` in interface `javax.jms.JMSContext`

    - #### createMessage

          public javax.jms.Message createMessage()

      Specified by:
        `createMessage` in interface `javax.jms.JMSContext`

    - #### createObjectMessage

          public javax.jms.ObjectMessage createObjectMessage()

      Specified by:
        `createObjectMessage` in interface `javax.jms.JMSContext`

    - #### createObjectMessage

          public javax.jms.ObjectMessage createObjectMessage(Serializable object)

      Specified by:
        `createObjectMessage` in interface `javax.jms.JMSContext`

    - #### createStreamMessage

          public javax.jms.StreamMessage createStreamMessage()

      Specified by:
        `createStreamMessage` in interface `javax.jms.JMSContext`

    - #### createTextMessage

          public javax.jms.TextMessage createTextMessage()

      Specified by:
        `createTextMessage` in interface `javax.jms.JMSContext`

    - #### createTextMessage

          public javax.jms.TextMessage createTextMessage(String text)

      Specified by:
        `createTextMessage` in interface `javax.jms.JMSContext`

    - #### getTransacted

          public boolean getTransacted()

      Specified by:
        `getTransacted` in interface `javax.jms.JMSContext`

    - #### getSessionMode

          public int getSessionMode()

      Specified by:
        `getSessionMode` in interface `javax.jms.JMSContext`

    - #### commit

          public void commit()

      Specified by:
        `commit` in interface `javax.jms.JMSContext`

    - #### rollback

          public void rollback()

      Specified by:
        `rollback` in interface `javax.jms.JMSContext`

    - #### recover

          public void recover()

      Specified by:
        `recover` in interface `javax.jms.JMSContext`

    - #### createConsumer

          public javax.jms.JMSConsumer createConsumer(javax.jms.Destination destination)

      Specified by:
        `createConsumer` in interface `javax.jms.JMSContext`

    - #### createConsumer

          public javax.jms.JMSConsumer createConsumer(javax.jms.Destination destination,
                                                      String messageSelector)

      Specified by:
        `createConsumer` in interface `javax.jms.JMSContext`

    - #### createConsumer

          public javax.jms.JMSConsumer createConsumer(javax.jms.Destination destination,
                                                      String messageSelector,
                                                      boolean noLocal)

      Specified by:
        `createConsumer` in interface `javax.jms.JMSContext`

    - #### createQueue

          public javax.jms.Queue createQueue(String queueName)

      Specified by:
        `createQueue` in interface `javax.jms.JMSContext`

    - #### createTopic

          public javax.jms.Topic createTopic(String topicName)

      Specified by:
        `createTopic` in interface `javax.jms.JMSContext`

    - #### createDurableConsumer

          public javax.jms.JMSConsumer createDurableConsumer(javax.jms.Topic topic,
                                                             String name)

      Specified by:
        `createDurableConsumer` in interface `javax.jms.JMSContext`

    - #### createDurableConsumer

          public javax.jms.JMSConsumer createDurableConsumer(javax.jms.Topic topic,
                                                             String name,
                                                             String messageSelector,
                                                             boolean noLocal)

      Specified by:
        `createDurableConsumer` in interface `javax.jms.JMSContext`

    - #### createSharedDurableConsumer

          public javax.jms.JMSConsumer createSharedDurableConsumer(javax.jms.Topic topic,
                                                                   String name)

      Specified by:
        `createSharedDurableConsumer` in interface `javax.jms.JMSContext`

    - #### createSharedDurableConsumer

          public javax.jms.JMSConsumer createSharedDurableConsumer(javax.jms.Topic topic,
                                                                   String name,
                                                                   String messageSelector)

      Specified by:
        `createSharedDurableConsumer` in interface `javax.jms.JMSContext`

    - #### createSharedConsumer

          public javax.jms.JMSConsumer createSharedConsumer(javax.jms.Topic topic,
                                                            String sharedSubscriptionName)

      Specified by:
        `createSharedConsumer` in interface `javax.jms.JMSContext`

    - #### createSharedConsumer

          public javax.jms.JMSConsumer createSharedConsumer(javax.jms.Topic topic,
                                                            String sharedSubscriptionName,
                                                            String messageSelector)

      Specified by:
        `createSharedConsumer` in interface `javax.jms.JMSContext`

    - #### createBrowser

          public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)

      Specified by:
        `createBrowser` in interface `javax.jms.JMSContext`

    - #### createBrowser

          public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue,
                                                      String messageSelector)

      Specified by:
        `createBrowser` in interface `javax.jms.JMSContext`

    - #### createTemporaryQueue

          public javax.jms.TemporaryQueue createTemporaryQueue()

      Specified by:
        `createTemporaryQueue` in interface `javax.jms.JMSContext`

    - #### createTemporaryTopic

          public javax.jms.TemporaryTopic createTemporaryTopic()

      Specified by:
        `createTemporaryTopic` in interface `javax.jms.JMSContext`

    - #### unsubscribe

          public void unsubscribe(String name)

      Specified by:
        `unsubscribe` in interface `javax.jms.JMSContext`

    - #### acknowledge

          public void acknowledge()

      Specified by:
        `acknowledge` in interface `javax.jms.JMSContext`

    - #### getUsedSession

          public javax.jms.Session getUsedSession()

      This is to be used on tests only. It's not part of the interface and it's not guaranteed to be kept on the API contract.
      Returns:

    - #### getThreadAwareContext

          public ThreadAwareContext getThreadAwareContext()

Copyright © 2017. All rights reserved.