Iterators

An iterator encapsulates a list of objects and a cursor that maintains the current position in the list. The concept of an Iterator, as available in Message Service Client for C/C++ is implemented by using IEnumerator interface in Message Service Client for .NET.

When an iterator is created, the position of the cursor is before the first object. An application uses an iterator to retrieve each object in turn.

The Iterator class of Message Service Client for C/C++ is equivalent to the Enumerator class in Java. XMS .NET is similar to Java and uses an IEnumerator interface.

An application can use an IEnumerator to perform the following tasks:
  • To get the properties of a message
  • To get the name-value pairs in the body of a map message
  • To browse the messages on a queue
  • To get the names of the JMS defined message properties supported by a connection