1. package org.omg.CosNaming;
  2. /**
  3. * org/omg/CosNaming/_BindingIteratorStub.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. public class _BindingIteratorStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CosNaming.BindingIterator
  17. {
  18. /**
  19. * This operation returns the next binding. If there are no more
  20. * bindings, false is returned.
  21. *
  22. * @param b the returned binding
  23. */
  24. public boolean next_one (org.omg.CosNaming.BindingHolder b)
  25. {
  26. org.omg.CORBA.portable.InputStream $in = null;
  27. try {
  28. org.omg.CORBA.portable.OutputStream $out = _request ("next_one", true);
  29. $in = _invoke ($out);
  30. boolean $result = $in.read_boolean ();
  31. b.value = org.omg.CosNaming.BindingHelper.read ($in);
  32. return $result;
  33. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  34. $in = $ex.getInputStream ();
  35. String _id = $ex.getId ();
  36. throw new org.omg.CORBA.MARSHAL (_id);
  37. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  38. return next_one (b );
  39. } finally {
  40. _releaseReply ($in);
  41. }
  42. } // next_one
  43. /**
  44. * This operation returns at most the requested number of bindings.
  45. *
  46. * @param how_many the maximum number of bindings tro return <p>
  47. *
  48. * @param bl the returned bindings
  49. */
  50. public boolean next_n (int how_many, org.omg.CosNaming.BindingListHolder bl)
  51. {
  52. org.omg.CORBA.portable.InputStream $in = null;
  53. try {
  54. org.omg.CORBA.portable.OutputStream $out = _request ("next_n", true);
  55. $out.write_ulong (how_many);
  56. $in = _invoke ($out);
  57. boolean $result = $in.read_boolean ();
  58. bl.value = org.omg.CosNaming.BindingListHelper.read ($in);
  59. return $result;
  60. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  61. $in = $ex.getInputStream ();
  62. String _id = $ex.getId ();
  63. throw new org.omg.CORBA.MARSHAL (_id);
  64. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  65. return next_n (how_many, bl );
  66. } finally {
  67. _releaseReply ($in);
  68. }
  69. } // next_n
  70. /**
  71. * This operation destroys the iterator.
  72. */
  73. public void destroy ()
  74. {
  75. org.omg.CORBA.portable.InputStream $in = null;
  76. try {
  77. org.omg.CORBA.portable.OutputStream $out = _request ("destroy", true);
  78. $in = _invoke ($out);
  79. return;
  80. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  81. $in = $ex.getInputStream ();
  82. String _id = $ex.getId ();
  83. throw new org.omg.CORBA.MARSHAL (_id);
  84. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  85. destroy ( );
  86. } finally {
  87. _releaseReply ($in);
  88. }
  89. } // destroy
  90. // Type-specific CORBA::Object operations
  91. private static String[] __ids = {
  92. "IDL:omg.org/CosNaming/BindingIterator:1.0"};
  93. public String[] _ids ()
  94. {
  95. return (String[])__ids.clone ();
  96. }
  97. private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  98. {
  99. String str = s.readUTF ();
  100. String[] args = null;
  101. java.util.Properties props = null;
  102. org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
  103. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
  104. _set_delegate (delegate);
  105. }
  106. private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  107. {
  108. String[] args = null;
  109. java.util.Properties props = null;
  110. String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
  111. s.writeUTF (str);
  112. }
  113. } // class _BindingIteratorStub