Class BindingIteratorImpl

java.lang.Object
org.omg.PortableServer.Servant
org.omg.CosNaming.BindingIteratorPOA
com.sun.corba.ee.impl.naming.cosnaming.BindingIteratorImpl
All Implemented Interfaces:
InvokeHandler, BindingIteratorOperations
Direct Known Subclasses:
TransientBindingIterator

public abstract class BindingIteratorImpl extends BindingIteratorPOA
Class BindingIteratorImpl implements the org.omg.CosNaming::BindingIterator interface, but does not implement the method to retrieve the next binding in the NamingContext for which it was created. This is left to a subclass, which is why this class is abstract; BindingIteratorImpl provides an implementation of the interface operations on top of two subclass methods, allowing multiple implementations of iterators that differ in storage and access to the contents of a NamingContext implementation.

The operation next_one() is implemented by the subclass, whereas next_n() is implemented on top of the next_one() implementation. Destroy must also be implemented by the subclass.

A subclass must implement NextOne() and Destroy(); these methods are invoked from synchronized methods and need therefore not be synchronized themselves.

  • Field Details

    • orb

      protected ORB orb
  • Constructor Details

    • BindingIteratorImpl

      public BindingIteratorImpl(ORB orb) throws Exception
      Create a binding iterator servant. runs the super constructor.
      Parameters:
      orb - an ORB object.
      Throws:
      Exception - a Java exception.
  • Method Details

    • next_one

      public boolean next_one(BindingHolder b)
      Return the next binding. It also returns true or false, indicating whether there were more bindings.
      Parameters:
      b - The Binding as an out parameter.
      Returns:
      true if there were more bindings.
      Throws:
      SystemException - One of a fixed set of CORBA system exceptions.
      See Also:
    • next_n

      public boolean next_n(int how_many, BindingListHolder blh)
      Return the next n bindings. It also returns true or false, indicating whether there were more bindings.
      Parameters:
      how_many - The number of requested bindings in the BindingList.
      blh - The BindingList as an out parameter.
      Returns:
      true if there were more bindings.
      Throws:
      SystemException - One of a fixed set of CORBA system exceptions.
    • list

      public boolean list(int how_many, BindingListHolder blh)
      lists next n bindings. It returns true or false, indicating whether there were more bindings. This method has the package private scope, It will be called from NamingContext.list() operation or this.next_n().
      Parameters:
      how_many - The number of requested bindings in the BindingList.
      blh - The BindingList as an out parameter.
      Returns:
      true if there were more bindings.
    • destroy

      public void destroy()
      Destroy this BindingIterator object. The object corresponding to this object reference is destroyed.
      Throws:
      SystemException - One of a fixed set of CORBA system exceptions.
      See Also:
    • nextOneImpl

      protected abstract boolean nextOneImpl(BindingHolder b)
      Abstract method for returning the next binding in the NamingContext for which this BindingIterator was created.
      Parameters:
      b - The Binding as an out parameter.
      Returns:
      true if there were more bindings.
      Throws:
      SystemException - One of a fixed set of CORBA system exceptions.
    • destroyImpl

      protected abstract void destroyImpl()
      Abstract method for destroying this BindingIterator.
      Throws:
      SystemException - One of a fixed set of CORBA system exceptions.
    • remainingElementsImpl

      protected abstract int remainingElementsImpl()
      Abstract method for returning the remaining number of elements.
      Returns:
      the remaining number of elements in the iterator.