MQQueueEnumeration *


public class MQQueueEnumeration
extends Object
implements Enumeration



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

Enumeration of 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: MQQueueBrowser

Methods

hasMoreElements
public boolean hasMoreElements()

Indicate whether another message can be returned.

nextElement
public Object nextElement() throws NoSuchElementException

Return the current message.

If hasMoreElements() returns 'true', nextElement() always returns a message. It is possible for the returned message to pass its expiry date between the hasMoreElements() and the nextElement calls.



© IBM Corporation 1997, 2002. All Rights Reserved