QueueBrowser

public interface QueueBrowser

WebSphere MQ class: MQQueueBrowser



java.lang.Object
   |
   +----com.ibm.mq.jms.MQQueueBrowser

A client uses a QueueBrowser to look at messages on a queue without removing them.

Note:
The WebSphere MQ class MQQueueEnumeration is used to hold the browse cursor.

See also: QueueReceiver

Methods

close
public void close() throws JMSException

Because a provider may allocate some resources outside of the JVM on behalf of a QueueBrowser, clients should close them when they are not needed. You cannot rely on garbage collection to reclaim these resources eventually, because this may not occur soon enough.

Throws:
JMSException - if a JMS fails to close this Browser because of a JMS error.

getEnumeration
public java.util.Enumeration getEnumeration() throws JMSException

Get an enumeration for browsing the current queue messages in the order that they would be received.

Returns:
an enumeration for browsing the messages.

Throws:
JMSException - if JMS fails to get the enumeration for this browser because of a JMS error.
Note:
If the browser is created for a nonexistent queue, this is not detected until the first call to getEnumeration.

getMessageSelector
public java.lang.String getMessageSelector() throws JMSException

Get this queue browser's message selector expression.

Returns:
this queue browser's message selector.

Throws:
JMSException - if JMS fails to get the message selector for this browser because of a JMS error.

getQueue
public Queue getQueue() throws JMSException

Get the queue associated with this queue browser.

Returns:
the queue.

Throws:
JMSException - if JMS fails to get the queue associated with this Browser because of a JMS error.



© IBM Corporation 1997, 2002. All Rights Reserved