001    package org.omg.CosNaming;
002    
003    
004    /**
005    * org/omg/CosNaming/_BindingIteratorImplBase.java .
006    * Generated by the IDL-to-Java compiler (portable), version "3.2"
007    * from /home/iurt/rpm/BUILD/geronimo-spec-corba/src/main/idl/CosNaming.idl
008    * Saturday, November 26, 2011 9:53:36 PM UTC
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 abstract class _BindingIteratorImplBase extends org.omg.CORBA.portable.ObjectImpl
021                    implements org.omg.CosNaming.BindingIterator, org.omg.CORBA.portable.InvokeHandler
022    {
023    
024      // Constructors
025      public _BindingIteratorImplBase ()
026      {
027      }
028    
029      private static java.util.Hashtable _methods = new java.util.Hashtable ();
030      static
031      {
032        _methods.put ("next_one", new java.lang.Integer (0));
033        _methods.put ("next_n", new java.lang.Integer (1));
034        _methods.put ("destroy", new java.lang.Integer (2));
035      }
036    
037      public org.omg.CORBA.portable.OutputStream _invoke (String $method,
038                                    org.omg.CORBA.portable.InputStream in,
039                                    org.omg.CORBA.portable.ResponseHandler $rh)
040      {
041        org.omg.CORBA.portable.OutputStream out = null;
042        java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
043        if (__method == null)
044          throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
045    
046        switch (__method.intValue ())
047        {
048    
049      /**
050           * This operation returns the next binding. If there are no more
051           * bindings, false is returned.
052           * 
053           * @param b the returned binding
054           */
055           case 0:  // CosNaming/BindingIterator/next_one
056           {
057             org.omg.CosNaming.BindingHolder b = new org.omg.CosNaming.BindingHolder ();
058             boolean $result = false;
059             $result = this.next_one (b);
060             out = $rh.createReply();
061             out.write_boolean ($result);
062             org.omg.CosNaming.BindingHelper.write (out, b.value);
063             break;
064           }
065    
066    
067      /**
068           * This operation returns at most the requested number of bindings.
069           * 
070           * @param how_many the maximum number of bindings tro return <p>
071           * 
072           * @param bl the returned bindings
073           */
074           case 1:  // CosNaming/BindingIterator/next_n
075           {
076             int how_many = in.read_ulong ();
077             org.omg.CosNaming.BindingListHolder bl = new org.omg.CosNaming.BindingListHolder ();
078             boolean $result = false;
079             $result = this.next_n (how_many, bl);
080             out = $rh.createReply();
081             out.write_boolean ($result);
082             org.omg.CosNaming.BindingListHelper.write (out, bl.value);
083             break;
084           }
085    
086    
087      /**
088           * This operation destroys the iterator.
089           */
090           case 2:  // CosNaming/BindingIterator/destroy
091           {
092             this.destroy ();
093             out = $rh.createReply();
094             break;
095           }
096    
097           default:
098             throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
099        }
100    
101        return out;
102      } // _invoke
103    
104      // Type-specific CORBA::Object operations
105      private static String[] __ids = {
106        "IDL:omg.org/CosNaming/BindingIterator:1.0"};
107    
108      public String[] _ids ()
109      {
110        return (String[])__ids.clone ();
111      }
112    
113    
114    } // class _BindingIteratorImplBase