< prev index next >
src/java.naming/share/classes/javax/naming/NamingEnumeration.java
Print this page
*** 83,93 ****
* Retrieves the next element in the enumeration.
* This method allows naming exceptions encountered while
* retrieving the next element to be caught and handled
* by the application.
* <p>
! * Note that <tt>next()</tt> can also throw the runtime exception
* NoSuchElementException to indicate that the caller is
* attempting to enumerate beyond the end of the enumeration.
* This is different from a NamingException, which indicates
* that there was a problem in obtaining the next element,
* for example, due to a referral or server unavailability, etc.
--- 83,93 ----
* Retrieves the next element in the enumeration.
* This method allows naming exceptions encountered while
* retrieving the next element to be caught and handled
* by the application.
* <p>
! * Note that {@code next()} can also throw the runtime exception
* NoSuchElementException to indicate that the caller is
* attempting to enumerate beyond the end of the enumeration.
* This is different from a NamingException, which indicates
* that there was a problem in obtaining the next element,
* for example, due to a referral or server unavailability, etc.
*** 126,145 ****
* After this method has been invoked on this enumeration, the
* enumeration becomes invalid and subsequent invocation of any of
* its methods will yield undefined results.
* This method is intended for aborting an enumeration to free up resources.
* If an enumeration proceeds to the end--that is, until
! * <tt>hasMoreElements()</tt> or <tt>hasMore()</tt> returns <tt>false</tt>--
* resources will be freed up automatically and there is no need to
! * explicitly call <tt>close()</tt>.
*<p>
* This method indicates to the service provider that it is free
* to release resources associated with the enumeration, and can
! * notify servers to cancel any outstanding requests. The <tt>close()</tt>
* method is a hint to implementations for managing their resources.
* Implementations are encouraged to use appropriate algorithms to
! * manage their resources when client omits the <tt>close()</tt> calls.
*
* @exception NamingException If a naming exception is encountered
* while closing the enumeration.
* @since 1.3
*/
--- 126,145 ----
* After this method has been invoked on this enumeration, the
* enumeration becomes invalid and subsequent invocation of any of
* its methods will yield undefined results.
* This method is intended for aborting an enumeration to free up resources.
* If an enumeration proceeds to the end--that is, until
! * {@code hasMoreElements()} or {@code hasMore()} returns {@code false}--
* resources will be freed up automatically and there is no need to
! * explicitly call {@code close()}.
*<p>
* This method indicates to the service provider that it is free
* to release resources associated with the enumeration, and can
! * notify servers to cancel any outstanding requests. The {@code close()}
* method is a hint to implementations for managing their resources.
* Implementations are encouraged to use appropriate algorithms to
! * manage their resources when client omits the {@code close()} calls.
*
* @exception NamingException If a naming exception is encountered
* while closing the enumeration.
* @since 1.3
*/
< prev index next >