001    package org.omg.CosNaming;
002    
003    
004    /**
005    * org/omg/CosNaming/_BindingIteratorStub.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    * Saturday, September 22, 2012 10:56:38 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    public class _BindingIteratorStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CosNaming.BindingIterator
021    {
022    
023    
024      /**
025           * This operation returns the next binding. If there are no more
026           * bindings, false is returned.
027           * 
028           * @param b the returned binding
029           */
030      public boolean next_one (org.omg.CosNaming.BindingHolder b)
031      {
032                org.omg.CORBA.portable.InputStream $in = null;
033                try {
034                    org.omg.CORBA.portable.OutputStream $out = _request ("next_one", true);
035                    $in = _invoke ($out);
036                    boolean $result = $in.read_boolean ();
037                    b.value = org.omg.CosNaming.BindingHelper.read ($in);
038                    return $result;
039                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
040                    $in = $ex.getInputStream ();
041                    String _id = $ex.getId ();
042                    throw new org.omg.CORBA.MARSHAL (_id);
043                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
044                    return next_one (b        );
045                } finally {
046                    _releaseReply ($in);
047                }
048      } // next_one
049    
050    
051      /**
052           * This operation returns at most the requested number of bindings.
053           * 
054           * @param how_many the maximum number of bindings tro return <p>
055           * 
056           * @param bl the returned bindings
057           */
058      public boolean next_n (int how_many, org.omg.CosNaming.BindingListHolder bl)
059      {
060                org.omg.CORBA.portable.InputStream $in = null;
061                try {
062                    org.omg.CORBA.portable.OutputStream $out = _request ("next_n", true);
063                    $out.write_ulong (how_many);
064                    $in = _invoke ($out);
065                    boolean $result = $in.read_boolean ();
066                    bl.value = org.omg.CosNaming.BindingListHelper.read ($in);
067                    return $result;
068                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
069                    $in = $ex.getInputStream ();
070                    String _id = $ex.getId ();
071                    throw new org.omg.CORBA.MARSHAL (_id);
072                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
073                    return next_n (how_many, bl        );
074                } finally {
075                    _releaseReply ($in);
076                }
077      } // next_n
078    
079    
080      /**
081           * This operation destroys the iterator.
082           */
083      public void destroy ()
084      {
085                org.omg.CORBA.portable.InputStream $in = null;
086                try {
087                    org.omg.CORBA.portable.OutputStream $out = _request ("destroy", true);
088                    $in = _invoke ($out);
089                    return;
090                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
091                    $in = $ex.getInputStream ();
092                    String _id = $ex.getId ();
093                    throw new org.omg.CORBA.MARSHAL (_id);
094                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
095                    destroy (        );
096                } finally {
097                    _releaseReply ($in);
098                }
099      } // destroy
100    
101      // Type-specific CORBA::Object operations
102      private static String[] __ids = {
103        "IDL:omg.org/CosNaming/BindingIterator:1.0"};
104    
105      public String[] _ids ()
106      {
107        return (String[])__ids.clone ();
108      }
109    
110      private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
111      {
112         String str = s.readUTF ();
113         String[] args = null;
114         java.util.Properties props = null;
115         org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
116         org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
117         _set_delegate (delegate);
118      }
119    
120      private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
121      {
122         String[] args = null;
123         java.util.Properties props = null;
124         String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
125         s.writeUTF (str);
126      }
127    } // class _BindingIteratorStub