Class ActiveMQJMSContext
- java.lang.Object
-
- org.apache.activemq.artemis.jms.client.ActiveMQJMSContext
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,javax.jms.JMSContext
- Direct Known Subclasses:
ActiveMQXAJMSContext
public class ActiveMQJMSContext extends java.lang.Object implements javax.jms.JMSContext
ActiveMQ Artemis implementation of a JMSContext.
-
-
Constructor Summary
Constructors Constructor 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 Description void
acknowledge()
void
close()
void
commit()
javax.jms.QueueBrowser
createBrowser(javax.jms.Queue queue)
javax.jms.QueueBrowser
createBrowser(javax.jms.Queue queue, java.lang.String messageSelector)
javax.jms.BytesMessage
createBytesMessage()
javax.jms.JMSConsumer
createConsumer(javax.jms.Destination destination)
javax.jms.JMSConsumer
createConsumer(javax.jms.Destination destination, java.lang.String messageSelector)
javax.jms.JMSConsumer
createConsumer(javax.jms.Destination destination, java.lang.String messageSelector, boolean noLocal)
javax.jms.JMSContext
createContext(int sessionMode)
javax.jms.JMSConsumer
createDurableConsumer(javax.jms.Topic topic, java.lang.String name)
javax.jms.JMSConsumer
createDurableConsumer(javax.jms.Topic topic, java.lang.String name, java.lang.String messageSelector, boolean noLocal)
javax.jms.MapMessage
createMapMessage()
javax.jms.Message
createMessage()
javax.jms.ObjectMessage
createObjectMessage()
javax.jms.ObjectMessage
createObjectMessage(java.io.Serializable object)
javax.jms.JMSProducer
createProducer()
javax.jms.Queue
createQueue(java.lang.String queueName)
javax.jms.JMSConsumer
createSharedConsumer(javax.jms.Topic topic, java.lang.String sharedSubscriptionName)
javax.jms.JMSConsumer
createSharedConsumer(javax.jms.Topic topic, java.lang.String sharedSubscriptionName, java.lang.String messageSelector)
javax.jms.JMSConsumer
createSharedDurableConsumer(javax.jms.Topic topic, java.lang.String name)
javax.jms.JMSConsumer
createSharedDurableConsumer(javax.jms.Topic topic, java.lang.String name, java.lang.String messageSelector)
javax.jms.StreamMessage
createStreamMessage()
javax.jms.TemporaryQueue
createTemporaryQueue()
javax.jms.TemporaryTopic
createTemporaryTopic()
javax.jms.TextMessage
createTextMessage()
javax.jms.TextMessage
createTextMessage(java.lang.String text)
javax.jms.Topic
createTopic(java.lang.String topicName)
boolean
getAutoStart()
java.lang.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.javax.transaction.xa.XAResource
getXAResource()
void
recover()
void
rollback()
void
setAutoStart(boolean autoStart)
void
setClientID(java.lang.String clientID)
void
setExceptionListener(javax.jms.ExceptionListener listener)
void
start()
void
stop()
void
unsubscribe(java.lang.String name)
-
-
-
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 javax.transaction.xa.XAResource getXAResource()
-
createContext
public javax.jms.JMSContext createContext(int sessionMode)
- Specified by:
createContext
in interfacejavax.jms.JMSContext
-
createProducer
public javax.jms.JMSProducer createProducer()
- Specified by:
createProducer
in interfacejavax.jms.JMSContext
-
getClientID
public java.lang.String getClientID()
- Specified by:
getClientID
in interfacejavax.jms.JMSContext
-
setClientID
public void setClientID(java.lang.String clientID)
- Specified by:
setClientID
in interfacejavax.jms.JMSContext
-
getMetaData
public javax.jms.ConnectionMetaData getMetaData()
- Specified by:
getMetaData
in interfacejavax.jms.JMSContext
-
getExceptionListener
public javax.jms.ExceptionListener getExceptionListener()
- Specified by:
getExceptionListener
in interfacejavax.jms.JMSContext
-
setExceptionListener
public void setExceptionListener(javax.jms.ExceptionListener listener)
- Specified by:
setExceptionListener
in interfacejavax.jms.JMSContext
-
start
public void start()
- Specified by:
start
in interfacejavax.jms.JMSContext
-
stop
public void stop()
- Specified by:
stop
in interfacejavax.jms.JMSContext
-
setAutoStart
public void setAutoStart(boolean autoStart)
- Specified by:
setAutoStart
in interfacejavax.jms.JMSContext
-
getAutoStart
public boolean getAutoStart()
- Specified by:
getAutoStart
in interfacejavax.jms.JMSContext
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejavax.jms.JMSContext
-
createBytesMessage
public javax.jms.BytesMessage createBytesMessage()
- Specified by:
createBytesMessage
in interfacejavax.jms.JMSContext
-
createMapMessage
public javax.jms.MapMessage createMapMessage()
- Specified by:
createMapMessage
in interfacejavax.jms.JMSContext
-
createMessage
public javax.jms.Message createMessage()
- Specified by:
createMessage
in interfacejavax.jms.JMSContext
-
createObjectMessage
public javax.jms.ObjectMessage createObjectMessage()
- Specified by:
createObjectMessage
in interfacejavax.jms.JMSContext
-
createObjectMessage
public javax.jms.ObjectMessage createObjectMessage(java.io.Serializable object)
- Specified by:
createObjectMessage
in interfacejavax.jms.JMSContext
-
createStreamMessage
public javax.jms.StreamMessage createStreamMessage()
- Specified by:
createStreamMessage
in interfacejavax.jms.JMSContext
-
createTextMessage
public javax.jms.TextMessage createTextMessage()
- Specified by:
createTextMessage
in interfacejavax.jms.JMSContext
-
createTextMessage
public javax.jms.TextMessage createTextMessage(java.lang.String text)
- Specified by:
createTextMessage
in interfacejavax.jms.JMSContext
-
getTransacted
public boolean getTransacted()
- Specified by:
getTransacted
in interfacejavax.jms.JMSContext
-
getSessionMode
public int getSessionMode()
- Specified by:
getSessionMode
in interfacejavax.jms.JMSContext
-
commit
public void commit()
- Specified by:
commit
in interfacejavax.jms.JMSContext
-
rollback
public void rollback()
- Specified by:
rollback
in interfacejavax.jms.JMSContext
-
recover
public void recover()
- Specified by:
recover
in interfacejavax.jms.JMSContext
-
createConsumer
public javax.jms.JMSConsumer createConsumer(javax.jms.Destination destination)
- Specified by:
createConsumer
in interfacejavax.jms.JMSContext
-
createConsumer
public javax.jms.JMSConsumer createConsumer(javax.jms.Destination destination, java.lang.String messageSelector)
- Specified by:
createConsumer
in interfacejavax.jms.JMSContext
-
createConsumer
public javax.jms.JMSConsumer createConsumer(javax.jms.Destination destination, java.lang.String messageSelector, boolean noLocal)
- Specified by:
createConsumer
in interfacejavax.jms.JMSContext
-
createQueue
public javax.jms.Queue createQueue(java.lang.String queueName)
- Specified by:
createQueue
in interfacejavax.jms.JMSContext
-
createTopic
public javax.jms.Topic createTopic(java.lang.String topicName)
- Specified by:
createTopic
in interfacejavax.jms.JMSContext
-
createDurableConsumer
public javax.jms.JMSConsumer createDurableConsumer(javax.jms.Topic topic, java.lang.String name)
- Specified by:
createDurableConsumer
in interfacejavax.jms.JMSContext
-
createDurableConsumer
public javax.jms.JMSConsumer createDurableConsumer(javax.jms.Topic topic, java.lang.String name, java.lang.String messageSelector, boolean noLocal)
- Specified by:
createDurableConsumer
in interfacejavax.jms.JMSContext
-
createSharedDurableConsumer
public javax.jms.JMSConsumer createSharedDurableConsumer(javax.jms.Topic topic, java.lang.String name)
- Specified by:
createSharedDurableConsumer
in interfacejavax.jms.JMSContext
-
createSharedDurableConsumer
public javax.jms.JMSConsumer createSharedDurableConsumer(javax.jms.Topic topic, java.lang.String name, java.lang.String messageSelector)
- Specified by:
createSharedDurableConsumer
in interfacejavax.jms.JMSContext
-
createSharedConsumer
public javax.jms.JMSConsumer createSharedConsumer(javax.jms.Topic topic, java.lang.String sharedSubscriptionName)
- Specified by:
createSharedConsumer
in interfacejavax.jms.JMSContext
-
createSharedConsumer
public javax.jms.JMSConsumer createSharedConsumer(javax.jms.Topic topic, java.lang.String sharedSubscriptionName, java.lang.String messageSelector)
- Specified by:
createSharedConsumer
in interfacejavax.jms.JMSContext
-
createBrowser
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
- Specified by:
createBrowser
in interfacejavax.jms.JMSContext
-
createBrowser
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String messageSelector)
- Specified by:
createBrowser
in interfacejavax.jms.JMSContext
-
createTemporaryQueue
public javax.jms.TemporaryQueue createTemporaryQueue()
- Specified by:
createTemporaryQueue
in interfacejavax.jms.JMSContext
-
createTemporaryTopic
public javax.jms.TemporaryTopic createTemporaryTopic()
- Specified by:
createTemporaryTopic
in interfacejavax.jms.JMSContext
-
unsubscribe
public void unsubscribe(java.lang.String name)
- Specified by:
unsubscribe
in interfacejavax.jms.JMSContext
-
acknowledge
public void acknowledge()
- Specified by:
acknowledge
in interfacejavax.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()
-
-