src/share/classes/com/sun/jndi/cosnaming/CNBindingEnumeration.java
Print this page
@@ -30,39 +30,38 @@
import java.util.NoSuchElementException;
import java.util.Hashtable;
import org.omg.CosNaming.*;
-import org.omg.CosNaming.NamingContextPackage.*;
-import org.omg.CORBA.*;
/**
* Implements the JNDI NamingEnumeration interface for COS
* Naming. Gets hold of a list of bindings from the COS Naming Server
* and allows the client to iterate through them.
*
* @author Raj Krishnamurthy
* @author Rosanna Lee
*/
-final class CNBindingEnumeration implements NamingEnumeration {
+final class CNBindingEnumeration
+ implements NamingEnumeration<javax.naming.Binding> {
private static final int DEFAULT_BATCHSIZE = 100;
private BindingListHolder _bindingList; // list of bindings
private BindingIterator _bindingIter; // iterator for getting list of bindings
private int counter; // pointer in _bindingList
private int batchsize = DEFAULT_BATCHSIZE; // how many to ask for each time
private CNCtx _ctx; // ctx to list
- private Hashtable _env; // environment for getObjectInstance
+ private Hashtable<?,?> _env; // environment for getObjectInstance
private boolean more = false; // iterator done?
private boolean isLookedUpCtx = false; // iterating on a context beneath this context ?
/**
* Creates a CNBindingEnumeration object.
* @param ctx Context to enumerate
*/
- CNBindingEnumeration(CNCtx ctx, boolean isLookedUpCtx, Hashtable env) {
+ CNBindingEnumeration(CNCtx ctx, boolean isLookedUpCtx, Hashtable<?,?> env) {
// Get batch size to use
String batch = (env != null ?
(String)env.get(javax.naming.Context.BATCHSIZE) : null);
if (batch != null) {
try {
@@ -96,11 +95,11 @@
/**
* Returns the next binding in the list.
* @exception NamingException any naming exception.
*/
- public java.lang.Object next() throws NamingException {
+ public javax.naming.Binding next() throws NamingException {
if (more && counter >= _bindingList.value.length) {
getMore();
}
if (more && counter < _bindingList.value.length) {
org.omg.CosNaming.Binding bndg = _bindingList.value[counter];
@@ -142,11 +141,11 @@
* Returns the next binding in the list.
* @exception NoSuchElementException Thrown when the end of the
* list is reached.
*/
- public java.lang.Object nextElement() {
+ public javax.naming.Binding nextElement() {
try {
return next();
} catch (NamingException ne) {
throw new NoSuchElementException();
}