TransientBindingIteratorpublic class TransientBindingIterator extends BindingIteratorImpl Class TransientBindingIterator implements the abstract methods
defined by BindingIteratorImpl, to use with the TransientNamingContext
implementation of the NamingContextImpl. The TransientBindingIterator
implementation receives a hash table of InternalBindingValues, and uses
an Enumeration to iterate over the contents of the hash table. |
Fields Summary |
---|
private org.omg.PortableServer.POA | nsPOA | private int | currentSize | private Hashtable | theHashtable | private Enumeration | theEnumeration |
Constructors Summary |
---|
public TransientBindingIterator(org.omg.CORBA.ORB orb, Hashtable aTable, org.omg.PortableServer.POA thePOA)Constructs a new TransientBindingIterator object.
super(orb);
theHashtable = aTable;
theEnumeration = this.theHashtable.elements();
currentSize = this.theHashtable.size();
this.nsPOA = thePOA;
|
Methods Summary |
---|
public final void | Destroy()Destroys this BindingIterator by disconnecting from the ORB
// Remove the object from the Active Object Map.
try {
byte[] objectId = nsPOA.servant_to_id( this );
if( objectId != null ) {
nsPOA.deactivate_object( objectId );
}
}
catch( Exception e ) {
NamingUtils.errprint("BindingIterator.Destroy():caught exception:");
NamingUtils.printException(e);
}
| public final boolean | NextOne(org.omg.CosNaming.BindingHolder b)Returns the next binding in the NamingContext. Uses the enumeration
object to determine if there are more bindings and if so, returns
the next binding from the InternalBindingValue.
// If there are more elements get the next element
boolean hasMore = theEnumeration.hasMoreElements();
if (hasMore) {
b.value =
((InternalBindingValue)theEnumeration.nextElement()).theBinding;
currentSize--;
} else {
// Return empty but marshalable binding
b.value = new Binding(new NameComponent[0],BindingType.nobject);
}
return hasMore;
| public final int | RemainingElements()Returns the remaining number of elements in the iterator.
return currentSize;
|
|