001    package org.omg.CosNaming;
002    
003    
004    /**
005    * org/omg/CosNaming/BindingIteratorHelper.java .
006    * Generated by the IDL-to-Java compiler (portable), version "3.2"
007    * from /builddir/build/BUILD/geronimo-specs-1.6/geronimo-spec-corba/src/main/idl/CosNaming.idl
008    * Monday, June 18, 2012 10:36:14 AM CEST
009    */
010    
011    
012    /**
013       * The BindingIterator interface allows a client to iterate through
014       * the bindings using the next_one or next_n operations.
015       * 
016       * The bindings iterator is obtained by using the <tt>list</tt>
017       * method on the <tt>NamingContext</tt>. 
018       * @see org.omg.CosNaming.NamingContext#list
019       */
020    abstract public class BindingIteratorHelper
021    {
022      private static String  _id = "IDL:omg.org/CosNaming/BindingIterator:1.0";
023    
024      public static void insert (org.omg.CORBA.Any a, org.omg.CosNaming.BindingIterator that)
025      {
026        org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
027        a.type (type ());
028        write (out, that);
029        a.read_value (out.create_input_stream (), type ());
030      }
031    
032      public static org.omg.CosNaming.BindingIterator extract (org.omg.CORBA.Any a)
033      {
034        return read (a.create_input_stream ());
035      }
036    
037      private static org.omg.CORBA.TypeCode __typeCode = null;
038      synchronized public static org.omg.CORBA.TypeCode type ()
039      {
040        if (__typeCode == null)
041        {
042          __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.CosNaming.BindingIteratorHelper.id (), "BindingIterator");
043        }
044        return __typeCode;
045      }
046    
047      public static String id ()
048      {
049        return _id;
050      }
051    
052      public static org.omg.CosNaming.BindingIterator read (org.omg.CORBA.portable.InputStream istream)
053      {
054        return narrow (istream.read_Object (_BindingIteratorStub.class));
055      }
056    
057      public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CosNaming.BindingIterator value)
058      {
059        ostream.write_Object ((org.omg.CORBA.Object) value);
060      }
061    
062      public static org.omg.CosNaming.BindingIterator narrow (org.omg.CORBA.Object obj)
063      {
064        if (obj == null)
065          return null;
066        else if (obj instanceof org.omg.CosNaming.BindingIterator)
067          return (org.omg.CosNaming.BindingIterator)obj;
068        else if (!obj._is_a (id ()))
069          throw new org.omg.CORBA.BAD_PARAM ();
070        else
071        {
072          org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
073          org.omg.CosNaming._BindingIteratorStub stub = new org.omg.CosNaming._BindingIteratorStub ();
074          stub._set_delegate(delegate);
075          return stub;
076        }
077      }
078    
079      public static org.omg.CosNaming.BindingIterator unchecked_narrow (org.omg.CORBA.Object obj)
080      {
081        if (obj == null)
082          return null;
083        else if (obj instanceof org.omg.CosNaming.BindingIterator)
084          return (org.omg.CosNaming.BindingIterator)obj;
085        else
086        {
087          org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
088          org.omg.CosNaming._BindingIteratorStub stub = new org.omg.CosNaming._BindingIteratorStub ();
089          stub._set_delegate(delegate);
090          return stub;
091        }
092      }
093    
094    }