Class 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.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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 interface javax.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 interface javax.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 interface java.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 interface java.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 interface javax.naming.NamingEnumeration<javax.naming.Binding>
        Throws:
        javax.naming.NamingException
      • finalize

        protected void finalize()
        Overrides:
        finalize in class java.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 context
        InvalidName - Name not understood.
        javax.naming.NamingException - One of the above.