Class MQQueueEnumeration
java.lang.Object
com.ibm.mq.jms.MQQueueEnumeration
- All Implemented Interfaces:
Enumeration
MQQueueEnumeration enumerates messages on a queue. This class is not defined in the JMS
specification; it is created by calling the getEnumeration method of MQQueueBrowser. The class
contains a base MQQueue instance to hold the browse cursor. The queue is closed once the cursor
has moved off the end of the queue. There is no way to reset an instance of this class; it acts
as a one-shot mechanism.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether another message can be returned.javax.jms.MessageGets the current message.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Enumeration
asIterator
-
Method Details
-
hasMoreElements
public boolean hasMoreElements()Indicates whether another message can be returned.- Specified by:
hasMoreElementsin interfaceEnumeration- Returns:
- true if another message can be returned.
-
nextElement
public javax.jms.Message nextElement()Gets the current message. Always returns a message ifhasMoreElementsreturns true. It is possible for the returned message to pass its expiry date between the hasMoreElements() and the nextElement() calls.- Specified by:
nextElementin interfaceEnumeration- Returns:
- the current message.
- Throws:
NoSuchElementException- if no more messages are found in the collection.
-