public class MQQueueBrowser extends MQRoot implements javax.jms.QueueBrowser, JmsQueueBrowser
Note that the WebSphere MQ extensions class MQQueueEnumeration is used
to hold the browse cursor. This means that each instance of this class will have one open handle
to the underlying queue on which the MQQueueBrowser is created. These open queues get closed only
when the close() method of MQQueueBrowser is called or when the queue does not have any more
messages ( either when MQQueueEnumeration.hasMoreElements() returns false, or
MQQueueEnumeration.nextElement() throws a NoSuchElementException ).
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes all open queues left in enumerated objects.
|
java.util.Enumeration<?> |
getEnumeration()
Gets an enumeration for browsing the current queue messages in the order that they are
received.
|
java.lang.String |
getMessageSelector()
Gets the queue browser's message selector expression.
|
javax.jms.Queue |
getQueue()
Gets an enumeration for browsing the current queue messages in the order that they are
received.
|
clear, containsKey, containsValue, entrySet, equals, get, getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty, getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, hashCode, isEmpty, keySet, propertyExists, put, putAll, remove, setBatchProperties, setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty, setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty, setObjectProperty, setShortProperty, setStringProperty, size, valuesgetClass, notify, notifyAll, toString, wait, wait, waitsetBatchProperties, setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty, setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty, setObjectProperty, setShortProperty, setStringPropertygetBooleanProperty, getByteProperty, getBytesProperty, getCharProperty, getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExistspublic void close()
throws javax.jms.JMSException
close in interface java.lang.AutoCloseableclose in interface javax.jms.QueueBrowserjavax.jms.JMSException - if JMS fails to close this browser because of a JMS error.public java.util.Enumeration<?> getEnumeration()
throws javax.jms.JMSException
If the queue browser detects a poison message, it will not be returned to the enumeration. What happens to the poison message depends upon the WebSphere MQ messaging provider mode being used by the application:
Applications using WebSphere MQ messaging provider normal mode
--------------------------------------------------------------
If the MQQueueBrowser was created from an XASession that is taking part in a global
transaction and the XASession has not previously been used to perform any transactional
work, the message will be left on the queue. In all other cases, the WebSphere MQ classes
for JMS will move the poison message to the backout requeue queue (as specified by the
WebSphere MQ queue parameter BOQNAME) for the queue being browsed.
Applications using WebSphere MQ messaging provider migration mode
-----------------------------------------------------------------
If the MQQueueBrowser was created from an XASession, the message will be left on the queue.
In all other cases, the WebSphere MQ classes for JMS will move the poison message to the
backout requeue queue (as specified by the WebSphere MQ queue parameter BOQNAME) for the queue being browsed.
Note that if the browser is created for a nonexistent queue, this is not detected until the first call to this method.
getEnumeration in interface javax.jms.QueueBrowserjavax.jms.JMSException - if JMS fails to get the enumeration for this browser because of a JMS
error.public java.lang.String getMessageSelector()
throws javax.jms.JMSException
getMessageSelector in interface javax.jms.QueueBrowserjavax.jms.JMSException - if JMS fails to get the message selector for this browser due to some JMS
errorpublic javax.jms.Queue getQueue()
throws javax.jms.JMSException
Note that if the browser is created for a nonexistent queue, this is not detected until the
first call to getEnumeration().
getQueue in interface javax.jms.QueueBrowserjavax.jms.JMSException - if JMS fails to get the enumeration for this browser because of a JMS
error.