Package org.glassfish.jndi.cosnaming
Class CNBindingEnumeration
java.lang.Object
org.glassfish.jndi.cosnaming.CNBindingEnumeration
- All Implemented Interfaces:
Enumeration<Binding>
,NamingEnumeration<Binding>
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BindingIterator
private BindingListHolder
private CNCtx
private Hashtable
<?, ?> private int
private int
private static final int
private boolean
private boolean
-
Constructor Summary
ConstructorsConstructorDescriptionCNBindingEnumeration
(CNCtx ctx, boolean isLookedUpCtx, Hashtable<?, ?> env) Creates a CNBindingEnumeration object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
finalize()
private boolean
getMore()
Get the next batch using _bindingIter.boolean
hasMore()
Returns true or false depending on whether there are more bindings.boolean
Returns true or false depending on whether there are more bindings.private Binding
mapBinding
(Binding bndg) Constructs a JNDI Binding object from the COS Naming binding object.next()
Returns the next binding in the list.Returns the next binding in the list.
-
Field Details
-
DEFAULT_BATCHSIZE
private static final int DEFAULT_BATCHSIZE- See Also:
-
_bindingList
-
_bindingIter
-
counter
private int counter -
batchsize
private int batchsize -
_ctx
-
_env
-
more
private boolean more -
isLookedUpCtx
private boolean isLookedUpCtx
-
-
Constructor Details
-
CNBindingEnumeration
Creates a CNBindingEnumeration object.- Parameters:
ctx
- Context to enumerate
-
-
Method Details
-
next
Returns the next binding in the list.- Specified by:
next
in interfaceNamingEnumeration<Binding>
- Throws:
NamingException
- any naming exception.
-
hasMore
Returns true or false depending on whether there are more bindings.- Specified by:
hasMore
in interfaceNamingEnumeration<Binding>
- Returns:
- boolean value
- Throws:
NamingException
-
hasMoreElements
public boolean hasMoreElements()Returns true or false depending on whether there are more bindings. Need to define this to satisfy the Enumeration api requirement.- Specified by:
hasMoreElements
in interfaceEnumeration<Binding>
- Returns:
- boolean value
-
nextElement
Returns the next binding in the list.- Specified by:
nextElement
in interfaceEnumeration<Binding>
- Throws:
NoSuchElementException
- Thrown when the end of the list is reached.
-
close
- Specified by:
close
in interfaceNamingEnumeration<Binding>
- Throws:
NamingException
-
finalize
protected void finalize() -
getMore
Get the next batch using _bindingIter. Update the 'more' field.- Throws:
NamingException
-
mapBinding
Constructs a JNDI Binding object from the COS Naming binding object.
-