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_bindingIterprivate BindingListHolder_bindingListprivate CNCtx_ctxprivate java.util.Hashtable<?,?>_envprivate intbatchsizeprivate intcounterprivate static intDEFAULT_BATCHSIZEprivate booleanisLookedUpCtxprivate booleanmore
-
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 voidclose()protected voidfinalize()private booleangetMore()Get the next batch using _bindingIter.booleanhasMore()Returns true or false depending on whether there are more bindings.booleanhasMoreElements()Returns true or false depending on whether there are more bindings.private javax.naming.BindingmapBinding(Binding bndg)Constructs a JNDI Binding object from the COS Naming binding object.javax.naming.Bindingnext()Returns the next binding in the list.javax.naming.BindingnextElement()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.NamingExceptionReturns the next binding in the list.- Specified by:
nextin interfacejavax.naming.NamingEnumeration<javax.naming.Binding>- Throws:
javax.naming.NamingException- any naming exception.
-
hasMore
public boolean hasMore() throws javax.naming.NamingExceptionReturns true or false depending on whether there are more bindings.- Specified by:
hasMorein 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:
hasMoreElementsin interfacejava.util.Enumeration<javax.naming.Binding>- Returns:
- boolean value
-
nextElement
public javax.naming.Binding nextElement()
Returns the next binding in the list.- Specified by:
nextElementin 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:
closein interfacejavax.naming.NamingEnumeration<javax.naming.Binding>- Throws:
javax.naming.NamingException
-
finalize
protected void finalize()
- Overrides:
finalizein classjava.lang.Object
-
getMore
private boolean getMore() throws javax.naming.NamingExceptionGet 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.
-
-