QueueSession


public interface QueueSession
extends Session

WebSphere MQ class: MQQueueSession



java.lang.Object
   |
   +----com.ibm.mq.jms.MQSession
           |
           +----com.ibm.mq.jms.MQQueueSession

A QueueSession provides methods to create QueueReceivers, QueueSenders, QueueBrowsers and TemporaryQueues.

See also: Session

The following methods are inherited from MQSession:

Methods

createBrowser
public QueueBrowser createBrowser(Queue queue)
                                       throws JMSException

Create a QueueBrowser to peek at the messages on the specified queue.

Parameters:
queue - the queue to access.

Throws:
  • JMSException - if a session fails to create a browser because of a JMS error.
  • InvalidDestinationException - if a non valid Queue is specified.

createBrowser
public QueueBrowser createBrowser(Queue queue,
                                  java.lang.String messageSelector)
                                  throws JMSException

Create a QueueBrowser to peek at the messages on the specified queue.

Parameters:
  • queue - the queue to access.
  • messageSelector - only messages with properties that match the message selector expression are delivered.

Throws:
  • JMSException - if a session fails to create a browser because of a JMS error.
  • InvalidDestinationException - if a non valid Queue is specified.
  • InvalidSelectorException - if the message selector is not valid.

createQueue
public Queue createQueue(java.lang.String queueName)
                                            throws JMSException

Create a Queue given a Queue name. This allows the creation of a queue with a provider specific name. The string takes a URI format, as described on topic (JMSURI).

Note:
Clients that depend on this ability are not portable.

Parameters:
queueName - the name of this queue.

Returns:
a Queue with the given name.

Throws:
JMSException - if a session fails to create a queue because of a JMS error.

createReceiver
public QueueReceiver createReceiver(Queue queue)
                                            throws JMSException

Create a QueueReceiver to receive messages from the specified queue.

Parameters:
queue - the queue to access.

Throws:
  • JMSException - if a session fails to create a receiver because of a JMS error.
  • InvalidDestinationException - if a non valid Queue is specified.

createReceiver
public QueueReceiver createReceiver(Queue queue,
                                    java.lang.String messageSelector)
                                    throws JMSException

Create a QueueReceiver to receive messages from the specified queue.

Parameters:
  • queue - the queue to access.
  • messageSelector - only messages with properties that match the message selector expression are delivered.

Throws:
  • JMSException - if a session fails to create a receiver because of a JMS error.
  • InvalidDestinationException - if a non valid Queue is specified.
  • InvalidSelectorException - if the message selector is not valid.

createSender
public QueueSender createSender(Queue queue)
                                         throws JMSException

Create a QueueSender to send messages to the specified queue.

Parameters:
queue - the queue to access, or null if this is to be an unidentified producer.

Throws:
  • JMSException - if a session fails to create a sender because of a JMS error.
  • InvalidDestinationException - if a non valid Queue is specified.

createTemporaryQueue
public TemporaryQueue createTemporaryQueue()
                                         throws JMSException

Create a temporary queue. Its lifetime will be that of the QueueConnection unless deleted earlier.

Returns:
a temporary queue.

Throws:
JMSException - if a session fails to create a Temporary Queue because of a JMS error.



© IBM Corporation 1997, 2002. All Rights Reserved