Oracle Application Server Web Services UDDI Client API Reference
10g (9.0.4)

Part No. B10396-01

oracle.uddi.message
Interface UddiElementIterator


public interface UddiElementIterator

This class is for iterating UDDI elements (of the same type) in various UddiElements.

It is very similar to java.util.Iterator. However, it allows exceptions to be thrown during the iteration. The methods hasNextUddiElement() and nextUddiElement() are named so to avoid name collision with Iterator, in case an implementation chooses to implement both.

Note also that NoSuchElementException is thrown if the program invokes next() when there are no elements left in the iterator. The program can always avoid this exception by using hasMore() to check whether the end of the iteration has been reached.

If an exception is thrown during an iteration, the iterator becomes invalid. Subsequent invocation of any method on that iterator will yield undefined results.


Method Summary
 void close()
           Closes this iteration.
 IteratorElementLifeCycle getElementLifeCycle()
          Is the element returned in next() call reused in the subsequenet next() calls.
 boolean hasNextUddiElement()
          Determines whether there are any more elements in the iteration.
 UddiElement nextUddiElement()
           Retrieves the next element in the iteration.

 

Method Detail

getElementLifeCycle

public IteratorElementLifeCycle getElementLifeCycle()
Is the element returned in next() call reused in the subsequenet next() calls.
Returns:
Return IteratorElementLifeCycle
See Also:
IteratorElementLifeCycle

hasNextUddiElement

public boolean hasNextUddiElement()
                           throws UddiException
Determines whether there are any more elements in the iteration. This method allows iterator exceptions encountered while determining whether there are more elements to be caught and handled by the application.
Returns:
true if there is more in the iteration ; false otherwise.
Throws:
UddiException - If a iterator exception is encountered while attempting to determine whether there is another element in the iteration.
See Also:
Iterator.hasNext()

nextUddiElement

public UddiElement nextUddiElement()
                            throws UddiException

Retrieves the next element in the iteration. This method allows iterator exceptions encountered while retrieving the next element to be caught and handled by the application.

Note that next() can also throw the runtime exception NoSuchElementException to indicate that the caller is attempting to enumerate beyond the end of the iteration. This is different from a UddiException, which indicates that there was a problem in obtaining the next element.

Returns:
A non-null UddiElement. The specific types of UddiElements returned in an iteration should be compatible with each other.
Throws:
UddiException - If a iterator exception is encountered while attempting to retrieve the next element.
NoSuchElementException - If attempting to get the next element when none is available.
See Also:
Iterator.next()

close

public void close()
           throws UddiException

Closes this iteration. After this method has been invoked on this iteration, the iteration becomes invalid and subsequent invocation of any of its methods will yield undefined results. This method is intended for freeing up resources used by the iteration. The client should always call close() when his operation on the iteration is finished.

If the caller has exhausted the iterator, i.e., hasNextUddiElement() return false, the caller does not have to make the close() call: the iterator will implicitly make the close() call when the iterator is exhausted. However, if the caller does explicitly make the close() call, the iterator should not throw any exception either.

This method indicates to the service provider that it is free to release resources associated with the iteration, and can notify servers to cancel any outstanding requests. The close() method is a hint to implementations for managing their resources. Implementations are encouraged to use appropriate algorithms to manage their resources when client accidentally omits the close() calls.

Throws:
UddiException - If an iterator exception is encountered while closing the iteration.

Oracle Application Server Web Services UDDI Client API Reference
10g (9.0.4)

Part No. B10396-01

Copyright © 2001, 2003, Oracle. All rights reserved.