Package org.glassfish.jndi.cosnaming
Class CNBindingEnumeration
- java.lang.Object
-
- org.glassfish.jndi.cosnaming.CNBindingEnumeration
-
- All Implemented Interfaces:
java.util.Enumeration<javax.naming.Binding>
,javax.naming.NamingEnumeration<javax.naming.Binding>
final class CNBindingEnumeration extends java.lang.Object implements javax.naming.NamingEnumeration<javax.naming.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
Fields Modifier and Type Field Description private BindingIterator
_bindingIter
private BindingListHolder
_bindingList
private CNCtx
_ctx
private java.util.Hashtable<?,?>
_env
private int
batchsize
private int
counter
private static int
DEFAULT_BATCHSIZE
private boolean
isLookedUpCtx
private boolean
more
-
Constructor Summary
Constructors Constructor Description CNBindingEnumeration(CNCtx ctx, boolean isLookedUpCtx, java.util.Hashtable<?,?> env)
Creates a CNBindingEnumeration object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
hasMoreElements()
Returns true or false depending on whether there are more bindings.private javax.naming.Binding
mapBinding(Binding bndg)
Constructs a JNDI Binding object from the COS Naming binding object.javax.naming.Binding
next()
Returns the next binding in the list.javax.naming.Binding
nextElement()
Returns the next binding in the list.
-
-
-
Field Detail
-
DEFAULT_BATCHSIZE
private static final int DEFAULT_BATCHSIZE
- See Also:
- Constant Field Values
-
_bindingList
private BindingListHolder _bindingList
-
_bindingIter
private BindingIterator _bindingIter
-
counter
private int counter
-
batchsize
private int batchsize
-
_ctx
private CNCtx _ctx
-
_env
private java.util.Hashtable<?,?> _env
-
more
private boolean more
-
isLookedUpCtx
private boolean isLookedUpCtx
-
-
Constructor Detail
-
CNBindingEnumeration
CNBindingEnumeration(CNCtx ctx, boolean isLookedUpCtx, java.util.Hashtable<?,?> env)
Creates a CNBindingEnumeration object.- Parameters:
ctx
- Context to enumerate
-
-
Method Detail
-
next
public javax.naming.Binding next() throws javax.naming.NamingException
Returns the next binding in the list.- Specified by:
next
in interfacejavax.naming.NamingEnumeration<javax.naming.Binding>
- Throws:
javax.naming.NamingException
- any naming exception.
-
hasMore
public boolean hasMore() throws javax.naming.NamingException
Returns true or false depending on whether there are more bindings.- Specified by:
hasMore
in interfacejavax.naming.NamingEnumeration<javax.naming.Binding>
- Returns:
- boolean value
- Throws:
javax.naming.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 interfacejava.util.Enumeration<javax.naming.Binding>
- Returns:
- boolean value
-
nextElement
public javax.naming.Binding nextElement()
Returns the next binding in the list.- Specified by:
nextElement
in interfacejava.util.Enumeration<javax.naming.Binding>
- Throws:
java.util.NoSuchElementException
- Thrown when the end of the list is reached.
-
close
public void close() throws javax.naming.NamingException
- Specified by:
close
in interfacejavax.naming.NamingEnumeration<javax.naming.Binding>
- Throws:
javax.naming.NamingException
-
finalize
protected void finalize()
- Overrides:
finalize
in classjava.lang.Object
-
getMore
private boolean getMore() throws javax.naming.NamingException
Get the next batch using _bindingIter. Update the 'more' field.- Throws:
javax.naming.NamingException
-
mapBinding
private javax.naming.Binding mapBinding(Binding bndg) throws javax.naming.NamingException
Constructs a JNDI Binding object from the COS Naming binding object.- Throws:
NameNotFound
- No objects under the name.CannotProceed
- Unable to obtain a continuation contextInvalidName
- Name not understood.javax.naming.NamingException
- One of the above.
-
-