NamingContext.java 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /* NamingContext.java --
  2. Copyright (C) 2005 Free Software Foundation, Inc.
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package org.omg.CosNaming;
  32. import org.omg.CORBA.portable.IDLEntity;
  33. import org.omg.CosNaming.NamingContextPackage.AlreadyBound;
  34. import org.omg.CosNaming.NamingContextPackage.CannotProceed;
  35. import org.omg.CosNaming.NamingContextPackage.InvalidName;
  36. import org.omg.CosNaming.NamingContextPackage.NotEmpty;
  37. import org.omg.CosNaming.NamingContextPackage.NotFound;
  38. /**
  39. * The interface for the naming context. The naming context can
  40. * store (bound) and retrieve (resolve) the named objects or
  41. * named child contexts. These operations are defined in a separate
  42. * interface.
  43. *
  44. * @see NamingContextExt
  45. *
  46. * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
  47. */
  48. public interface NamingContext
  49. extends NamingContextOperations, org.omg.CORBA.Object, IDLEntity
  50. {
  51. /**
  52. * Gives the object a name, valid in this context.
  53. *
  54. * @param a_name the name, being given to the object.
  55. * @param an_object the object, being named.
  56. *
  57. * @throws AlreadyBound if the object is already named in this context.
  58. * @throws InvalidName if the name has zero length or otherwise invalid.
  59. *
  60. * @specnote since 1.3 this method has moved into NamingContextOperations.
  61. */
  62. void bind(NameComponent[] a_name, org.omg.CORBA.Object an_object)
  63. throws NotFound, CannotProceed, InvalidName, AlreadyBound;
  64. /**
  65. * Gives a child context name, valid in this context.
  66. *
  67. * @param a_name the name, being given to the child context.
  68. * @param a_context the child context being named.
  69. *
  70. * @throws AlreadyBound if the child context is already named in
  71. * the current context.
  72. *
  73. * @specnote since 1.3 this method has moved into NamingContextOperations.
  74. */
  75. void bind_context(NameComponent[] a_name, NamingContext a_context)
  76. throws NotFound, CannotProceed, InvalidName, AlreadyBound;
  77. /**
  78. * Create a new context and give it a given name (bound it)
  79. * in the current context.
  80. *
  81. * @param a_name the name being given to the new context.
  82. *
  83. * @return the newly created context.
  84. *
  85. * @throws AlreadyBound if the name is already in use.
  86. * @throws InvalidName if the name has zero length or otherwise invalid.
  87. *
  88. * @specnote since 1.3 this method has moved into NamingContextOperations.
  89. */
  90. NamingContext bind_new_context(NameComponent[] a_name)
  91. throws NotFound, AlreadyBound, CannotProceed,
  92. InvalidName;
  93. /**
  94. * Destroy this context (must be empty).
  95. * @throws NotEmpty if the context being destroyed is not empty.
  96. *
  97. * @specnote since 1.3 this method has moved into NamingContextOperations.
  98. */
  99. void destroy()
  100. throws NotEmpty;
  101. /**
  102. * Iterate over all bindings, defined in this namind context.
  103. *
  104. * @param amount the maximal number of context to return in the
  105. * holder a_list. The remaining bindings are accessible via iterator
  106. * an_iter. If the parameter amount is zero, all bindings are accessed only
  107. * via this iterator.
  108. *
  109. * @param a_list the holder, where the returned bindigs are stored.
  110. * @param an_iter the iterator that can be used to access the remaining
  111. * bindings.
  112. *
  113. * @specnote since 1.3 this method has moved into NamingContextOperations.
  114. */
  115. void list(int amount, BindingListHolder a_list, BindingIteratorHolder an_iter);
  116. /**
  117. * Creates a new naming context, not bound to any name.
  118. *
  119. * @specnote since 1.3 this method has moved into NamingContextOperations.
  120. */
  121. NamingContext new_context();
  122. /**
  123. * Names or renames the object.
  124. *
  125. * @param a_name the new name, being given to the object. If
  126. * the object is already named in this context, it is renamed.
  127. *
  128. * @param an_object the object, being named.
  129. *
  130. * @throws InvalidName if the name has zero length or otherwise invalid.
  131. *
  132. * @specnote since 1.3 this method has moved into NamingContextOperations.
  133. */
  134. void rebind(NameComponent[] a_name, org.omg.CORBA.Object an_object)
  135. throws NotFound, CannotProceed, InvalidName;
  136. /**
  137. * Names or renames the child context.
  138. * If the child context is already named in
  139. * the current context, it is renamed.
  140. *
  141. * @param a_name the name, being given to the child context.
  142. * @param a_context the child context being named.
  143. *
  144. * @throws InvalidName if the name has zero length or otherwise invalid.
  145. *
  146. * @specnote since 1.3 this method has moved into NamingContextOperations.
  147. */
  148. void rebind_context(NameComponent[] a_name, NamingContext a_context)
  149. throws NotFound, CannotProceed, InvalidName;
  150. /**
  151. * Get the object, bound to the specified name in this
  152. * context.
  153. *
  154. * @param a_name the object name.
  155. *
  156. * @return the object, matching this name. The client
  157. * usually casts or narrows (using the helper) the returned value
  158. * to the more specific type.
  159. *
  160. * @throws NotFound
  161. * @throws InvalidName if the name has zero length or otherwise invalid.
  162. *
  163. * @specnote since 1.3 this method has moved into NamingContextOperations.
  164. */
  165. org.omg.CORBA.Object resolve(NameComponent[] a_name)
  166. throws NotFound, CannotProceed, InvalidName;
  167. /**
  168. * Removes the name from the binding context.
  169. *
  170. * @param a_name a name to remove.
  171. *
  172. * @throws InvalidName if the name has zero length or otherwise invalid.
  173. *
  174. * @specnote since 1.3 this method has moved into NamingContextOperations.
  175. */
  176. void unbind(NameComponent[] a_name)
  177. throws NotFound, CannotProceed, InvalidName;
  178. }