KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.omg.CosNaming;
2
3
4 /**
5 * org/omg/CosNaming/BindingIteratorHelper.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 abstract public class BindingIteratorHelper
21 {
22   private static String JavaDoc _id = "IDL:omg.org/CosNaming/BindingIterator:1.0";
23
24   public static void insert (org.omg.CORBA.Any JavaDoc a, org.omg.CosNaming.BindingIterator JavaDoc that)
25   {
26     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
27     a.type (type ());
28     write (out, that);
29     a.read_value (out.create_input_stream (), type ());
30   }
31
32   public static org.omg.CosNaming.BindingIterator JavaDoc extract (org.omg.CORBA.Any JavaDoc a)
33   {
34     return read (a.create_input_stream ());
35   }
36
37   private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
38   synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
39   {
40     if (__typeCode == null)
41     {
42       __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.CosNaming.BindingIteratorHelper.id (), "BindingIterator");
43     }
44     return __typeCode;
45   }
46
47   public static String JavaDoc id ()
48   {
49     return _id;
50   }
51
52   public static org.omg.CosNaming.BindingIterator JavaDoc read (org.omg.CORBA.portable.InputStream JavaDoc istream)
53   {
54     return narrow (istream.read_Object (_BindingIteratorStub JavaDoc.class));
55   }
56
57   public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, org.omg.CosNaming.BindingIterator JavaDoc value)
58   {
59     ostream.write_Object ((org.omg.CORBA.Object JavaDoc) value);
60   }
61
62   public static org.omg.CosNaming.BindingIterator JavaDoc narrow (org.omg.CORBA.Object JavaDoc obj)
63   {
64     if (obj == null)
65       return null;
66     else if (obj instanceof org.omg.CosNaming.BindingIterator JavaDoc)
67       return (org.omg.CosNaming.BindingIterator JavaDoc)obj;
68     else if (!obj._is_a (id ()))
69       throw new org.omg.CORBA.BAD_PARAM JavaDoc ();
70     else
71     {
72       org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc)obj)._get_delegate ();
73       org.omg.CosNaming._BindingIteratorStub JavaDoc stub = new org.omg.CosNaming._BindingIteratorStub JavaDoc ();
74       stub._set_delegate(delegate);
75       return stub;
76     }
77   }
78
79   public static org.omg.CosNaming.BindingIterator JavaDoc unchecked_narrow (org.omg.CORBA.Object JavaDoc obj)
80   {
81     if (obj == null)
82       return null;
83     else if (obj instanceof org.omg.CosNaming.BindingIterator JavaDoc)
84       return (org.omg.CosNaming.BindingIterator JavaDoc)obj;
85     else
86     {
87       org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc)obj)._get_delegate ();
88       org.omg.CosNaming._BindingIteratorStub JavaDoc stub = new org.omg.CosNaming._BindingIteratorStub JavaDoc ();
89       stub._set_delegate(delegate);
90       return stub;
91     }
92   }
93
94 }
95
Popular Tags