1. package org.omg.CosNaming;
  2. /**
  3. * org/omg/CosNaming/BindingIteratorHelper.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.2"
  5. * from ../../../../src/share/classes/org/omg/CosNaming/nameservice.idl
  6. * Wednesday, September 15, 2004 10:28:47 AM GMT
  7. */
  8. /**
  9. * The BindingIterator interface allows a client to iterate through
  10. * the bindings using the next_one or next_n operations.
  11. *
  12. * The bindings iterator is obtained by using the <tt>list</tt>
  13. * method on the <tt>NamingContext</tt>.
  14. * @see org.omg.CosNaming.NamingContext#list
  15. */
  16. abstract public class BindingIteratorHelper
  17. {
  18. private static String _id = "IDL:omg.org/CosNaming/BindingIterator:1.0";
  19. public static void insert (org.omg.CORBA.Any a, org.omg.CosNaming.BindingIterator that)
  20. {
  21. org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  22. a.type (type ());
  23. write (out, that);
  24. a.read_value (out.create_input_stream (), type ());
  25. }
  26. public static org.omg.CosNaming.BindingIterator extract (org.omg.CORBA.Any a)
  27. {
  28. return read (a.create_input_stream ());
  29. }
  30. private static org.omg.CORBA.TypeCode __typeCode = null;
  31. synchronized public static org.omg.CORBA.TypeCode type ()
  32. {
  33. if (__typeCode == null)
  34. {
  35. __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.CosNaming.BindingIteratorHelper.id (), "BindingIterator");
  36. }
  37. return __typeCode;
  38. }
  39. public static String id ()
  40. {
  41. return _id;
  42. }
  43. public static org.omg.CosNaming.BindingIterator read (org.omg.CORBA.portable.InputStream istream)
  44. {
  45. return narrow (istream.read_Object (_BindingIteratorStub.class));
  46. }
  47. public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CosNaming.BindingIterator value)
  48. {
  49. ostream.write_Object ((org.omg.CORBA.Object) value);
  50. }
  51. public static org.omg.CosNaming.BindingIterator narrow (org.omg.CORBA.Object obj)
  52. {
  53. if (obj == null)
  54. return null;
  55. else if (obj instanceof org.omg.CosNaming.BindingIterator)
  56. return (org.omg.CosNaming.BindingIterator)obj;
  57. else if (!obj._is_a (id ()))
  58. throw new org.omg.CORBA.BAD_PARAM ();
  59. else
  60. {
  61. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
  62. org.omg.CosNaming._BindingIteratorStub stub = new org.omg.CosNaming._BindingIteratorStub ();
  63. stub._set_delegate(delegate);
  64. return stub;
  65. }
  66. }
  67. public static org.omg.CosNaming.BindingIterator unchecked_narrow (org.omg.CORBA.Object obj)
  68. {
  69. if (obj == null)
  70. return null;
  71. else if (obj instanceof org.omg.CosNaming.BindingIterator)
  72. return (org.omg.CosNaming.BindingIterator)obj;
  73. else
  74. {
  75. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
  76. org.omg.CosNaming._BindingIteratorStub stub = new org.omg.CosNaming._BindingIteratorStub ();
  77. stub._set_delegate(delegate);
  78. return stub;
  79. }
  80. }
  81. }