Package org.objectweb.joram.client.jms
Class QueueSession
- java.lang.Object
-
- org.objectweb.joram.client.jms.Session
-
- org.objectweb.joram.client.jms.QueueSession
-
- All Implemented Interfaces:
AutoCloseable,Runnable,QueueSession,Session,SessionMBean
public class QueueSession extends Session implements QueueSession
Implements thejavax.jms.QueueSessioninterface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.objectweb.joram.client.jms.Session
Session.Closer
-
-
Field Summary
-
Fields inherited from class org.objectweb.joram.client.jms.Session
deliveries, INDIVIDUAL_ACKNOWLEDGE, listener, logger, messageConsumerListeners, messageListener, sendings, trace, tracker, transacted
-
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
-
-
Constructor Summary
Constructors Constructor Description QueueSession(Connection cnx, boolean transacted, int acknowledgeMode, RequestMultiplexer mtpx)Constructs a queue session.
-
Method Summary
-
Methods inherited from class org.objectweb.joram.client.jms.Session
acknowledge, acknowledge, addConsumer, addMessageListener, addProducer, checkClosed, checkConsumers, checkThread, close, closeBrowser, closeConsumer, closeProducer, commit, createBrowser, createBrowser, createBytesMessage, createConsumer, createConsumer, createConsumer, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createQueue, createStreamMessage, createTemporaryQueue, createTextMessage, createTextMessage, doClose, doCommit, doRollback, getAcknowledgeMode, getCompressedMinSize, getCompressionLevel, getConnection, getId, getJMXBeanName, getMessageConsumerListener, getMessageListener, getQueueMessageReadMax, getRequestMultiplexer, getRequestStatus, getSessionMode, getStatus, getTopicAckBufferMax, getTopicActivationThreshold, getTopicPassivationThreshold, getTransacted, isAsyncSend, isAsyncSub, isAutoAck, isImplicitAck, isStarted, onMessage, onMessage, pushMessages, putMessageConsumerListener, receive, recover, registerMBean, removeMessageConsumerListener, removeMessageListener, rollback, run, send, setAsyncSend, setAsyncSub, setCompressedMinSize, setCompressionLevel, setImplicitAck, setMessageConsumerListener, setMessageListener, setQueueMessageReadMax, setTopicAckBufferMax, setTopicActivationThreshold, setTopicPassivationThreshold, setTransacted, start, stop, syncRequest, toString, unregisterMBean
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.jms.QueueSession
createBrowser, createBrowser, createQueue, createTemporaryQueue
-
Methods inherited from interface javax.jms.Session
close, commit, createBytesMessage, createConsumer, createConsumer, createConsumer, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createStreamMessage, createTextMessage, createTextMessage, getAcknowledgeMode, getMessageListener, getTransacted, recover, rollback, run, setMessageListener
-
-
-
-
Constructor Detail
-
QueueSession
QueueSession(Connection cnx, boolean transacted, int acknowledgeMode, RequestMultiplexer mtpx) throws JMSException
Constructs a queue session.- Parameters:
cnx- The connection the session belongs to.transacted-truefor a transacted session.acknowledgeMode- 1 (auto), 2 (client) or 3 (dups ok).- Throws:
JMSException- In case of an invalid acknowledge mode.
-
-
Method Detail
-
createSender
public QueueSender createSender(Queue queue) throws JMSException
API method. Creates a QueueSender object to send messages to the specified queue.- Specified by:
createSenderin interfaceQueueSession- Parameters:
queue- the queue to send to, or null if this is a sender which does not have a specified destination.- Returns:
- the created QueueSender object.
- Throws:
IllegalStateException- If the session is closed or if the connection is broken.JMSException- If the creation fails for any other reason.
-
createReceiver
public QueueReceiver createReceiver(Queue queue, String selector) throws JMSException
API method. Creates a QueueReceiver object to receive messages from the specified queue using a message selector.- Specified by:
createReceiverin interfaceQueueSession- Parameters:
queue- the queue to access.selector- The selector allowing to filter messages.- Returns:
- the created QueueReceiver object.
- Throws:
IllegalStateException- If the session is closed or if the connection is broken.JMSException- If the creation fails for any other reason.
-
createReceiver
public QueueReceiver createReceiver(Queue queue) throws JMSException
API method. Creates a QueueReceiver object to receive messages from the specified queue.- Specified by:
createReceiverin interfaceQueueSession- Parameters:
queue- the queue to access.- Returns:
- the created QueueReceiver object.
- Throws:
IllegalStateException- If the session is closed or if the connection is broken.JMSException- If the creation fails for any other reason.
-
createDurableSubscriber
public TopicSubscriber createDurableSubscriber(Topic topic, String name, String selector, boolean noLocal) throws JMSException
API method.- Specified by:
createDurableSubscriberin interfaceSession- Overrides:
createDurableSubscriberin classSession- Parameters:
topic- the non-temporary Topic to subscribe to.name- the name used to identify this subscription.selector- The selector allowing to filter messages. A value of null or an empty string indicates that there is no message selector for the message consumer.noLocal- if true, inhibits the delivery of messages published by its own connection.- Returns:
- the created TopicSubscriber object.
- Throws:
IllegalStateException- Systematically.InvalidDestinationException- if an invalid destination is specified.JMSException- If the creation fails for any other reason.
-
createDurableSubscriber
public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
API method.- Specified by:
createDurableSubscriberin interfaceSession- Overrides:
createDurableSubscriberin classSession- Parameters:
topic- the non-temporary Topic to subscribe to.name- the name used to identify this subscription.- Returns:
- the created TopicSubscriber object.
- Throws:
IllegalStateException- Systematically.InvalidDestinationException- if an invalid destination is specified.JMSException- If the creation fails for any other reason.
-
createTopic
public Topic createTopic(String topicName) throws JMSException
API method.- Specified by:
createTopicin interfaceSession- Overrides:
createTopicin classSession- Parameters:
topicName- the name of this topic.- Returns:
- a topic with the given name.
- Throws:
IllegalStateException- Systematically.JMSException- If the topic creation failed.- See Also:
Topic
-
createTemporaryTopic
public TemporaryTopic createTemporaryTopic() throws JMSException
API method.- Specified by:
createTemporaryTopicin interfaceSession- Overrides:
createTemporaryTopicin classSession- Returns:
- a temporary topic identity.
- Throws:
IllegalStateException- Systematically.JMSException- If the request fails for any other reason.- See Also:
TemporaryTopic
-
unsubscribe
public void unsubscribe(String name) throws JMSException
API method.- Specified by:
unsubscribein interfaceSession- Specified by:
unsubscribein interfaceSessionMBean- Overrides:
unsubscribein classSession- Parameters:
name- the name used to identify this subscription.- Throws:
IllegalStateException- Systematically.InvalidDestinationException- If the subscription does not exist.JMSException- If the request fails for any other reason.
-
createSharedConsumer
public MessageConsumer createSharedConsumer(Topic topic, String name) throws JMSException
API 2.0 method.- Specified by:
createSharedConsumerin interfaceSession- Overrides:
createSharedConsumerin classSession- Throws:
JMSException
-
createSharedConsumer
public MessageConsumer createSharedConsumer(Topic topic, String name, String selector) throws JMSException
API 2.0 method.- Specified by:
createSharedConsumerin interfaceSession- Overrides:
createSharedConsumerin classSession- Throws:
JMSException
-
createDurableConsumer
public MessageConsumer createDurableConsumer(Topic topic, String name) throws JMSException
API 2.0 method.- Specified by:
createDurableConsumerin interfaceSession- Overrides:
createDurableConsumerin classSession- Parameters:
topic- the non-temporary Topic to subscribe to.name- the name used to identify this subscription.- Returns:
- the created MessageConsumer object.
- Throws:
InvalidDestinationException- if an invalid destination is specified.IllegalStateException- If the session is closed or if the connection is broken or if the client identifier is unset.JMSException- If the creation fails for any other reason.
-
createDurableConsumer
public MessageConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
API 2.0 method.- Specified by:
createDurableConsumerin interfaceSession- Overrides:
createDurableConsumerin classSession- Parameters:
topic- the non-temporary Topic to subscribe to.name- the name used to identify this subscription.messageSelector- the selector used to filter incoming messages.noLocal- if true, inhibits the delivery of messages published by its own connection.- Returns:
- the created MessageConsumer object.
- Throws:
InvalidDestinationException- if an invalid destination is specified.IllegalStateException- If the session is closed or if the connection is broken or if the client identifier is unset.JMSException- If the creation fails for any other reason.
-
createSharedDurableConsumer
public MessageConsumer createSharedDurableConsumer(Topic topic, String name) throws JMSException
API 2.0 method.- Specified by:
createSharedDurableConsumerin interfaceSession- Overrides:
createSharedDurableConsumerin classSession- Throws:
JMSException
-
createSharedDurableConsumer
public MessageConsumer createSharedDurableConsumer(Topic topic, String name, String selector) throws JMSException
API 2.0 method.- Specified by:
createSharedDurableConsumerin interfaceSession- Overrides:
createSharedDurableConsumerin classSession- Throws:
JMSException
-
-