1. package org.omg.CosNaming;
  2. /**
  3. * org/omg/CosNaming/BindingIteratorPOA.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.1"
  5. * from ../../../../src/share/classes/org/omg/CosNaming/nameservice.idl
  6. * Monday, February 23, 2004 7:03:07 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 abstract class BindingIteratorPOA extends org.omg.PortableServer.Servant
  17. implements org.omg.CosNaming.BindingIteratorOperations, org.omg.CORBA.portable.InvokeHandler
  18. {
  19. // Constructors
  20. private static java.util.Hashtable _methods = new java.util.Hashtable ();
  21. static
  22. {
  23. _methods.put ("next_one", new java.lang.Integer (0));
  24. _methods.put ("next_n", new java.lang.Integer (1));
  25. _methods.put ("destroy", new java.lang.Integer (2));
  26. }
  27. public org.omg.CORBA.portable.OutputStream _invoke (String $method,
  28. org.omg.CORBA.portable.InputStream in,
  29. org.omg.CORBA.portable.ResponseHandler $rh)
  30. {
  31. org.omg.CORBA.portable.OutputStream out = null;
  32. java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
  33. if (__method == null)
  34. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  35. switch (__method.intValue ())
  36. {
  37. /**
  38. * This operation returns the next binding. If there are no more
  39. * bindings, false is returned.
  40. *
  41. * @param b the returned binding
  42. */
  43. case 0: // CosNaming/BindingIterator/next_one
  44. {
  45. org.omg.CosNaming.BindingHolder b = new org.omg.CosNaming.BindingHolder ();
  46. boolean $result = false;
  47. $result = this.next_one (b);
  48. out = $rh.createReply();
  49. out.write_boolean ($result);
  50. org.omg.CosNaming.BindingHelper.write (out, b.value);
  51. break;
  52. }
  53. /**
  54. * This operation returns at most the requested number of bindings.
  55. *
  56. * @param how_many the maximum number of bindings tro return <p>
  57. *
  58. * @param bl the returned bindings
  59. */
  60. case 1: // CosNaming/BindingIterator/next_n
  61. {
  62. int how_many = in.read_ulong ();
  63. org.omg.CosNaming.BindingListHolder bl = new org.omg.CosNaming.BindingListHolder ();
  64. boolean $result = false;
  65. $result = this.next_n (how_many, bl);
  66. out = $rh.createReply();
  67. out.write_boolean ($result);
  68. org.omg.CosNaming.BindingListHelper.write (out, bl.value);
  69. break;
  70. }
  71. /**
  72. * This operation destroys the iterator.
  73. */
  74. case 2: // CosNaming/BindingIterator/destroy
  75. {
  76. this.destroy ();
  77. out = $rh.createReply();
  78. break;
  79. }
  80. default:
  81. throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  82. }
  83. return out;
  84. } // _invoke
  85. // Type-specific CORBA::Object operations
  86. private static String[] __ids = {
  87. "IDL:omg.org/CosNaming/BindingIterator:1.0"};
  88. public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
  89. {
  90. return (String[])__ids.clone ();
  91. }
  92. public BindingIterator _this()
  93. {
  94. return BindingIteratorHelper.narrow(
  95. super._this_object());
  96. }
  97. public BindingIterator _this(org.omg.CORBA.ORB orb)
  98. {
  99. return BindingIteratorHelper.narrow(
  100. super._this_object(orb));
  101. }
  102. } // class BindingIteratorPOA