KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > CosNaming > BindingIteratorPOA


1 package org.omg.CosNaming;
2
3
4 /**
5 * org/omg/CosNaming/BindingIteratorPOA.java .
6 * Generated by the IDL-to-Java compiler (portable), version "3.2"
7 * from ../../../../src/share/classes/org/omg/CosNaming/nameservice.idl
8 * Saturday, February 9, 2008 9:40:10 AM GMT
9 */

10
11
12 /**
13    * The BindingIterator interface allows a client to iterate through
14    * the bindings using the next_one or next_n operations.
15    *
16    * The bindings iterator is obtained by using the <tt>list</tt>
17    * method on the <tt>NamingContext</tt>.
18    * @see org.omg.CosNaming.NamingContext#list
19    */

20 public abstract class BindingIteratorPOA extends org.omg.PortableServer.Servant JavaDoc
21  implements org.omg.CosNaming.BindingIteratorOperations JavaDoc, org.omg.CORBA.portable.InvokeHandler JavaDoc
22 {
23
24   // Constructors
25

26   private static java.util.Hashtable JavaDoc _methods = new java.util.Hashtable JavaDoc ();
27   static
28   {
29     _methods.put ("next_one", new java.lang.Integer JavaDoc (0));
30     _methods.put ("next_n", new java.lang.Integer JavaDoc (1));
31     _methods.put ("destroy", new java.lang.Integer JavaDoc (2));
32   }
33
34   public org.omg.CORBA.portable.OutputStream JavaDoc _invoke (String JavaDoc $method,
35                                 org.omg.CORBA.portable.InputStream JavaDoc in,
36                                 org.omg.CORBA.portable.ResponseHandler JavaDoc $rh)
37   {
38     org.omg.CORBA.portable.OutputStream JavaDoc out = null;
39     java.lang.Integer JavaDoc __method = (java.lang.Integer JavaDoc)_methods.get ($method);
40     if (__method == null)
41       throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
42
43     switch (__method.intValue ())
44     {
45
46   /**
47      * This operation returns the next binding. If there are no more
48      * bindings, false is returned.
49      *
50      * @param b the returned binding
51      */

52        case 0: // CosNaming/BindingIterator/next_one
53
{
54          org.omg.CosNaming.BindingHolder JavaDoc b = new org.omg.CosNaming.BindingHolder JavaDoc ();
55          boolean $result = false;
56          $result = this.next_one (b);
57          out = $rh.createReply();
58          out.write_boolean ($result);
59          org.omg.CosNaming.BindingHelper.write (out, b.value);
60          break;
61        }
62
63
64   /**
65      * This operation returns at most the requested number of bindings.
66      *
67      * @param how_many the maximum number of bindings tro return <p>
68      *
69      * @param bl the returned bindings
70      */

71        case 1: // CosNaming/BindingIterator/next_n
72
{
73          int how_many = in.read_ulong ();
74          org.omg.CosNaming.BindingListHolder JavaDoc bl = new org.omg.CosNaming.BindingListHolder JavaDoc ();
75          boolean $result = false;
76          $result = this.next_n (how_many, bl);
77          out = $rh.createReply();
78          out.write_boolean ($result);
79          org.omg.CosNaming.BindingListHelper.write (out, bl.value);
80          break;
81        }
82
83
84   /**
85      * This operation destroys the iterator.
86      */

87        case 2: // CosNaming/BindingIterator/destroy
88
{
89          this.destroy ();
90          out = $rh.createReply();
91          break;
92        }
93
94        default:
95          throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
96     }
97
98     return out;
99   } // _invoke
100

101   // Type-specific CORBA::Object operations
102
private static String JavaDoc[] __ids = {
103     "IDL:omg.org/CosNaming/BindingIterator:1.0"};
104
105   public String JavaDoc[] _all_interfaces (org.omg.PortableServer.POA JavaDoc poa, byte[] objectId)
106   {
107     return (String JavaDoc[])__ids.clone ();
108   }
109
110   public BindingIterator JavaDoc _this()
111   {
112     return BindingIteratorHelper.narrow(
113     super._this_object());
114   }
115
116   public BindingIterator JavaDoc _this(org.omg.CORBA.ORB JavaDoc orb)
117   {
118     return BindingIteratorHelper.narrow(
119     super._this_object(orb));
120   }
121
122
123 } // class BindingIteratorPOA
124
Popular Tags