KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.omg.CosNaming;
2
3
4 /**
5 * org/omg/CosNaming/_BindingIteratorStub.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 class _BindingIteratorStub extends org.omg.CORBA.portable.ObjectImpl JavaDoc implements org.omg.CosNaming.BindingIterator JavaDoc
21 {
22
23
24   /**
25      * This operation returns the next binding. If there are no more
26      * bindings, false is returned.
27      *
28      * @param b the returned binding
29      */

30   public boolean next_one (org.omg.CosNaming.BindingHolder JavaDoc b)
31   {
32             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
33             try {
34                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("next_one", true);
35                 $in = _invoke ($out);
36                 boolean $result = $in.read_boolean ();
37                 b.value = org.omg.CosNaming.BindingHelper.read ($in);
38                 return $result;
39             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
40                 $in = $ex.getInputStream ();
41                 String JavaDoc _id = $ex.getId ();
42                 throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
43             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
44                 return next_one (b );
45             } finally {
46                 _releaseReply ($in);
47             }
48   } // next_one
49

50
51   /**
52      * This operation returns at most the requested number of bindings.
53      *
54      * @param how_many the maximum number of bindings tro return <p>
55      *
56      * @param bl the returned bindings
57      */

58   public boolean next_n (int how_many, org.omg.CosNaming.BindingListHolder JavaDoc bl)
59   {
60             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
61             try {
62                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("next_n", true);
63                 $out.write_ulong (how_many);
64                 $in = _invoke ($out);
65                 boolean $result = $in.read_boolean ();
66                 bl.value = org.omg.CosNaming.BindingListHelper.read ($in);
67                 return $result;
68             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
69                 $in = $ex.getInputStream ();
70                 String JavaDoc _id = $ex.getId ();
71                 throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
72             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
73                 return next_n (how_many, bl );
74             } finally {
75                 _releaseReply ($in);
76             }
77   } // next_n
78

79
80   /**
81      * This operation destroys the iterator.
82      */

83   public void destroy ()
84   {
85             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
86             try {
87                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("destroy", true);
88                 $in = _invoke ($out);
89                 return;
90             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
91                 $in = $ex.getInputStream ();
92                 String JavaDoc _id = $ex.getId ();
93                 throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
94             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
95                 destroy ( );
96             } finally {
97                 _releaseReply ($in);
98             }
99   } // destroy
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[] _ids ()
106   {
107     return (String JavaDoc[])__ids.clone ();
108   }
109
110   private void readObject (java.io.ObjectInputStream JavaDoc s) throws java.io.IOException JavaDoc
111   {
112      String JavaDoc str = s.readUTF ();
113      String JavaDoc[] args = null;
114      java.util.Properties JavaDoc props = null;
115      org.omg.CORBA.Object JavaDoc obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
116      org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc) obj)._get_delegate ();
117      _set_delegate (delegate);
118   }
119
120   private void writeObject (java.io.ObjectOutputStream JavaDoc s) throws java.io.IOException JavaDoc
121   {
122      String JavaDoc[] args = null;
123      java.util.Properties JavaDoc props = null;
124      String JavaDoc str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
125      s.writeUTF (str);
126   }
127 } // class _BindingIteratorStub
128
Popular Tags