1. package org.omg.CosNaming;
  2. /**
  3. * org/omg/CosNaming/_NamingContextExtStub.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. * <code>NamingContextExt</code> is the extension of <code>NamingContext</code>
  10. * which
  11. * contains a set of name bindings in which each name is unique and is
  12. * part of Interoperable Naming Service.
  13. * Different names can be bound to an object in the same or different
  14. * contexts at the same time. Using <tt>NamingContextExt</tt>, you can use
  15. * URL-based names to bind and resolve. <p>
  16. *
  17. * See <a href="http://www.omg.org/technology/documents/formal/naming_service.htm">
  18. * CORBA COS
  19. * Naming Specification.</a>
  20. */
  21. public class _NamingContextExtStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CosNaming.NamingContextExt
  22. {
  23. /**
  24. * This operation creates a stringified name from the array of Name
  25. * components.
  26. *
  27. * @param n Name of the object <p>
  28. *
  29. * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName
  30. * Indicates the name does not identify a binding.<p>
  31. *
  32. */
  33. public String to_string (org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.InvalidName
  34. {
  35. org.omg.CORBA.portable.InputStream $in = null;
  36. try {
  37. org.omg.CORBA.portable.OutputStream $out = _request ("to_string", true);
  38. org.omg.CosNaming.NameHelper.write ($out, n);
  39. $in = _invoke ($out);
  40. String $result = org.omg.CosNaming.NamingContextExtPackage.StringNameHelper.read ($in);
  41. return $result;
  42. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  43. $in = $ex.getInputStream ();
  44. String _id = $ex.getId ();
  45. if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
  46. throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
  47. else
  48. throw new org.omg.CORBA.MARSHAL (_id);
  49. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  50. return to_string (n );
  51. } finally {
  52. _releaseReply ($in);
  53. }
  54. } // to_string
  55. /**
  56. * This operation converts a Stringified Name into an equivalent array
  57. * of Name Components.
  58. *
  59. * @param sn Stringified Name of the object <p>
  60. *
  61. * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName
  62. * Indicates the name does not identify a binding.<p>
  63. *
  64. */
  65. public org.omg.CosNaming.NameComponent[] to_name (String sn) throws org.omg.CosNaming.NamingContextPackage.InvalidName
  66. {
  67. org.omg.CORBA.portable.InputStream $in = null;
  68. try {
  69. org.omg.CORBA.portable.OutputStream $out = _request ("to_name", true);
  70. org.omg.CosNaming.NamingContextExtPackage.StringNameHelper.write ($out, sn);
  71. $in = _invoke ($out);
  72. org.omg.CosNaming.NameComponent $result[] = org.omg.CosNaming.NameHelper.read ($in);
  73. return $result;
  74. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  75. $in = $ex.getInputStream ();
  76. String _id = $ex.getId ();
  77. if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
  78. throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
  79. else
  80. throw new org.omg.CORBA.MARSHAL (_id);
  81. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  82. return to_name (sn );
  83. } finally {
  84. _releaseReply ($in);
  85. }
  86. } // to_name
  87. /**
  88. * This operation creates a URL based "iiopname://" format name
  89. * from the Stringified Name of the object.
  90. *
  91. * @param addr internet based address of the host machine where Name Service is running <p>
  92. * @param sn Stringified Name of the object <p>
  93. *
  94. * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName
  95. * Indicates the name does not identify a binding.<p>
  96. * @exception org.omg.CosNaming.NamingContextPackage.InvalidAddress
  97. * Indicates the internet based address of the host machine is
  98. * incorrect <p>
  99. *
  100. */
  101. public String to_url (String addr, String sn) throws org.omg.CosNaming.NamingContextExtPackage.InvalidAddress, org.omg.CosNaming.NamingContextPackage.InvalidName
  102. {
  103. org.omg.CORBA.portable.InputStream $in = null;
  104. try {
  105. org.omg.CORBA.portable.OutputStream $out = _request ("to_url", true);
  106. org.omg.CosNaming.NamingContextExtPackage.AddressHelper.write ($out, addr);
  107. org.omg.CosNaming.NamingContextExtPackage.StringNameHelper.write ($out, sn);
  108. $in = _invoke ($out);
  109. String $result = org.omg.CosNaming.NamingContextExtPackage.URLStringHelper.read ($in);
  110. return $result;
  111. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  112. $in = $ex.getInputStream ();
  113. String _id = $ex.getId ();
  114. if (_id.equals ("IDL:omg.org/CosNaming/NamingContextExt/InvalidAddress:1.0"))
  115. throw org.omg.CosNaming.NamingContextExtPackage.InvalidAddressHelper.read ($in);
  116. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
  117. throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
  118. else
  119. throw new org.omg.CORBA.MARSHAL (_id);
  120. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  121. return to_url (addr, sn );
  122. } finally {
  123. _releaseReply ($in);
  124. }
  125. } // to_url
  126. /**
  127. * This operation resolves the Stringified name into the object
  128. * reference.
  129. *
  130. * @param sn Stringified Name of the object <p>
  131. *
  132. * @exception org.omg.CosNaming.NamingContextPackage.NotFound
  133. * Indicates there is no object reference for the given name. <p>
  134. * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
  135. * Indicates that the given compound name is incorrect <p>
  136. * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName
  137. * Indicates the name does not identify a binding.<p>
  138. *
  139. */
  140. public org.omg.CORBA.Object resolve_str (String sn) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName
  141. {
  142. org.omg.CORBA.portable.InputStream $in = null;
  143. try {
  144. org.omg.CORBA.portable.OutputStream $out = _request ("resolve_str", true);
  145. org.omg.CosNaming.NamingContextExtPackage.StringNameHelper.write ($out, sn);
  146. $in = _invoke ($out);
  147. org.omg.CORBA.Object $result = org.omg.CORBA.ObjectHelper.read ($in);
  148. return $result;
  149. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  150. $in = $ex.getInputStream ();
  151. String _id = $ex.getId ();
  152. if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
  153. throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
  154. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
  155. throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
  156. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
  157. throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
  158. else
  159. throw new org.omg.CORBA.MARSHAL (_id);
  160. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  161. return resolve_str (sn );
  162. } finally {
  163. _releaseReply ($in);
  164. }
  165. } // resolve_str
  166. /**
  167. * Creates a binding of a name and an object in the naming context.
  168. * Naming contexts that are bound using bind do not participate in name
  169. * resolution when compound names are passed to be resolved.
  170. *
  171. * @param n Name of the object <p>
  172. *
  173. * @param obj The Object to bind with the given name<p>
  174. *
  175. * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates
  176. * the name does not identify a binding.<p>
  177. *
  178. * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
  179. * Indicates that the implementation has given up for some reason.
  180. * The client, however, may be able to continue the operation
  181. * at the returned naming context.<p>
  182. *
  183. * @exception org.omg.CosNaming.NamingContextPackage.InvalidName
  184. * Indicates that the name is invalid. <p>
  185. *
  186. * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
  187. * Indicates an object is already bound to the specified name.<p>
  188. */
  189. public void bind (org.omg.CosNaming.NameComponent[] n, org.omg.CORBA.Object obj) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName, org.omg.CosNaming.NamingContextPackage.AlreadyBound
  190. {
  191. org.omg.CORBA.portable.InputStream $in = null;
  192. try {
  193. org.omg.CORBA.portable.OutputStream $out = _request ("bind", true);
  194. org.omg.CosNaming.NameHelper.write ($out, n);
  195. org.omg.CORBA.ObjectHelper.write ($out, obj);
  196. $in = _invoke ($out);
  197. return;
  198. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  199. $in = $ex.getInputStream ();
  200. String _id = $ex.getId ();
  201. if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
  202. throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
  203. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
  204. throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
  205. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
  206. throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
  207. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0"))
  208. throw org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.read ($in);
  209. else
  210. throw new org.omg.CORBA.MARSHAL (_id);
  211. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  212. bind (n, obj );
  213. } finally {
  214. _releaseReply ($in);
  215. }
  216. } // bind
  217. /**
  218. * Names an object that is a naming context. Naming contexts that
  219. * are bound using bind_context() participate in name resolution
  220. * when compound names are passed to be resolved.
  221. *
  222. * @param n Name of the object <p>
  223. *
  224. * @param nc NamingContect object to bind with the given name <p>
  225. *
  226. * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
  227. *
  228. * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
  229. * given up for some reason. The client, however, may be able to
  230. * continue the operation at the returned naming context.<p>
  231. *
  232. * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
  233. *
  234. * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already
  235. * bound to the specified name.<p>
  236. */
  237. public void bind_context (org.omg.CosNaming.NameComponent[] n, org.omg.CosNaming.NamingContext nc) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName, org.omg.CosNaming.NamingContextPackage.AlreadyBound
  238. {
  239. org.omg.CORBA.portable.InputStream $in = null;
  240. try {
  241. org.omg.CORBA.portable.OutputStream $out = _request ("bind_context", true);
  242. org.omg.CosNaming.NameHelper.write ($out, n);
  243. org.omg.CosNaming.NamingContextHelper.write ($out, nc);
  244. $in = _invoke ($out);
  245. return;
  246. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  247. $in = $ex.getInputStream ();
  248. String _id = $ex.getId ();
  249. if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
  250. throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
  251. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
  252. throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
  253. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
  254. throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
  255. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0"))
  256. throw org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.read ($in);
  257. else
  258. throw new org.omg.CORBA.MARSHAL (_id);
  259. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  260. bind_context (n, nc );
  261. } finally {
  262. _releaseReply ($in);
  263. }
  264. } // bind_context
  265. /**
  266. * Creates a binding of a name and an object in the naming context
  267. * even if the name is already bound in the context. Naming contexts
  268. * that are bound using rebind do not participate in name resolution
  269. * when compound names are passed to be resolved.
  270. *
  271. * @param n Name of the object <p>
  272. *
  273. * @parm obj The Object to rebind with the given name <p>
  274. *
  275. * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
  276. *
  277. * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
  278. * given up for some reason. The client, however, may be able to
  279. * continue the operation at the returned naming context.<p>
  280. *
  281. * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
  282. */
  283. public void rebind (org.omg.CosNaming.NameComponent[] n, org.omg.CORBA.Object obj) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName
  284. {
  285. org.omg.CORBA.portable.InputStream $in = null;
  286. try {
  287. org.omg.CORBA.portable.OutputStream $out = _request ("rebind", true);
  288. org.omg.CosNaming.NameHelper.write ($out, n);
  289. org.omg.CORBA.ObjectHelper.write ($out, obj);
  290. $in = _invoke ($out);
  291. return;
  292. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  293. $in = $ex.getInputStream ();
  294. String _id = $ex.getId ();
  295. if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
  296. throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
  297. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
  298. throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
  299. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
  300. throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
  301. else
  302. throw new org.omg.CORBA.MARSHAL (_id);
  303. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  304. rebind (n, obj );
  305. } finally {
  306. _releaseReply ($in);
  307. }
  308. } // rebind
  309. /**
  310. * Creates a binding of a name and a naming context in the naming
  311. * context even if the name is already bound in the context. Naming
  312. * contexts that are bound using rebind_context() participate in name
  313. * resolution when compound names are passed to be resolved.
  314. *
  315. * @param n Name of the object <p>
  316. *
  317. * @param nc NamingContect object to rebind with the given name <p>
  318. *
  319. * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
  320. *
  321. * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
  322. * given up for some reason. The client, however, may be able to
  323. * continue the operation at the returned naming context.<p>
  324. *
  325. * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
  326. */
  327. public void rebind_context (org.omg.CosNaming.NameComponent[] n, org.omg.CosNaming.NamingContext nc) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName
  328. {
  329. org.omg.CORBA.portable.InputStream $in = null;
  330. try {
  331. org.omg.CORBA.portable.OutputStream $out = _request ("rebind_context", true);
  332. org.omg.CosNaming.NameHelper.write ($out, n);
  333. org.omg.CosNaming.NamingContextHelper.write ($out, nc);
  334. $in = _invoke ($out);
  335. return;
  336. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  337. $in = $ex.getInputStream ();
  338. String _id = $ex.getId ();
  339. if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
  340. throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
  341. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
  342. throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
  343. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
  344. throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
  345. else
  346. throw new org.omg.CORBA.MARSHAL (_id);
  347. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  348. rebind_context (n, nc );
  349. } finally {
  350. _releaseReply ($in);
  351. }
  352. } // rebind_context
  353. /**
  354. * The resolve operation is the process of retrieving an object
  355. * bound to a name in a given context. The given name must exactly
  356. * match the bound name. The naming service does not return the type
  357. * of the object. Clients are responsible for "narrowing" the object
  358. * to the appropriate type. That is, clients typically cast the returned
  359. * object from Object to a more specialized interface.
  360. *
  361. * @param n Name of the object <p>
  362. *
  363. * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
  364. *
  365. * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
  366. * given up for some reason. The client, however, may be able to
  367. * continue the operation at the returned naming context.<p>
  368. *
  369. * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
  370. */
  371. public org.omg.CORBA.Object resolve (org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName
  372. {
  373. org.omg.CORBA.portable.InputStream $in = null;
  374. try {
  375. org.omg.CORBA.portable.OutputStream $out = _request ("resolve", true);
  376. org.omg.CosNaming.NameHelper.write ($out, n);
  377. $in = _invoke ($out);
  378. org.omg.CORBA.Object $result = org.omg.CORBA.ObjectHelper.read ($in);
  379. return $result;
  380. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  381. $in = $ex.getInputStream ();
  382. String _id = $ex.getId ();
  383. if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
  384. throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
  385. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
  386. throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
  387. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
  388. throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
  389. else
  390. throw new org.omg.CORBA.MARSHAL (_id);
  391. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  392. return resolve (n );
  393. } finally {
  394. _releaseReply ($in);
  395. }
  396. } // resolve
  397. /**
  398. * The unbind operation removes a name binding from a context.
  399. *
  400. * @param n Name of the object <p>
  401. *
  402. * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
  403. *
  404. * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
  405. * given up for some reason. The client, however, may be able to
  406. * continue the operation at the returned naming context.<p>
  407. *
  408. * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
  409. */
  410. public void unbind (org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName
  411. {
  412. org.omg.CORBA.portable.InputStream $in = null;
  413. try {
  414. org.omg.CORBA.portable.OutputStream $out = _request ("unbind", true);
  415. org.omg.CosNaming.NameHelper.write ($out, n);
  416. $in = _invoke ($out);
  417. return;
  418. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  419. $in = $ex.getInputStream ();
  420. String _id = $ex.getId ();
  421. if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
  422. throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
  423. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
  424. throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
  425. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
  426. throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
  427. else
  428. throw new org.omg.CORBA.MARSHAL (_id);
  429. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  430. unbind (n );
  431. } finally {
  432. _releaseReply ($in);
  433. }
  434. } // unbind
  435. /**
  436. * The list operation allows a client to iterate through a set of
  437. * bindings in a naming context. <p>
  438. *
  439. * The list operation returns at most the requested number of
  440. * bindings in BindingList bl.
  441. * <ul>
  442. * <li>If the naming context contains additional
  443. * bindings, the list operation returns a BindingIterator with the
  444. * additional bindings.
  445. * <li>If the naming context does not contain additional
  446. * bindings, the binding iterator is a nil object reference.
  447. * </ul>
  448. *
  449. * @param how_many the maximum number of bindings to return <p>
  450. *
  451. * @param bl the returned list of bindings <p>
  452. *
  453. * @param bi the returned binding iterator <p>
  454. */
  455. public void list (int how_many, org.omg.CosNaming.BindingListHolder bl, org.omg.CosNaming.BindingIteratorHolder bi)
  456. {
  457. org.omg.CORBA.portable.InputStream $in = null;
  458. try {
  459. org.omg.CORBA.portable.OutputStream $out = _request ("list", true);
  460. $out.write_ulong (how_many);
  461. $in = _invoke ($out);
  462. bl.value = org.omg.CosNaming.BindingListHelper.read ($in);
  463. bi.value = org.omg.CosNaming.BindingIteratorHelper.read ($in);
  464. return;
  465. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  466. $in = $ex.getInputStream ();
  467. String _id = $ex.getId ();
  468. throw new org.omg.CORBA.MARSHAL (_id);
  469. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  470. list (how_many, bl, bi );
  471. } finally {
  472. _releaseReply ($in);
  473. }
  474. } // list
  475. /**
  476. * This operation returns a naming context implemented by the same
  477. * naming server as the context on which the operation was invoked.
  478. * The new context is not bound to any name.
  479. */
  480. public org.omg.CosNaming.NamingContext new_context ()
  481. {
  482. org.omg.CORBA.portable.InputStream $in = null;
  483. try {
  484. org.omg.CORBA.portable.OutputStream $out = _request ("new_context", true);
  485. $in = _invoke ($out);
  486. org.omg.CosNaming.NamingContext $result = org.omg.CosNaming.NamingContextHelper.read ($in);
  487. return $result;
  488. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  489. $in = $ex.getInputStream ();
  490. String _id = $ex.getId ();
  491. throw new org.omg.CORBA.MARSHAL (_id);
  492. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  493. return new_context ( );
  494. } finally {
  495. _releaseReply ($in);
  496. }
  497. } // new_context
  498. /**
  499. * This operation creates a new context and binds it to the name
  500. * supplied as an argument. The newly-created context is implemented
  501. * by the same naming server as the context in which it was bound (that
  502. * is, the naming server that implements the context denoted by the
  503. * name argument excluding the last component).
  504. *
  505. * @param n Name of the object <p>
  506. *
  507. * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
  508. *
  509. * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already
  510. * bound to the specified name.<p>
  511. *
  512. * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
  513. * given up for some reason. The client, however, may be able to
  514. * continue the operation at the returned naming context.<p>
  515. *
  516. * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
  517. */
  518. public org.omg.CosNaming.NamingContext bind_new_context (org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.AlreadyBound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName
  519. {
  520. org.omg.CORBA.portable.InputStream $in = null;
  521. try {
  522. org.omg.CORBA.portable.OutputStream $out = _request ("bind_new_context", true);
  523. org.omg.CosNaming.NameHelper.write ($out, n);
  524. $in = _invoke ($out);
  525. org.omg.CosNaming.NamingContext $result = org.omg.CosNaming.NamingContextHelper.read ($in);
  526. return $result;
  527. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  528. $in = $ex.getInputStream ();
  529. String _id = $ex.getId ();
  530. if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
  531. throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
  532. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0"))
  533. throw org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.read ($in);
  534. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
  535. throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
  536. else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
  537. throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
  538. else
  539. throw new org.omg.CORBA.MARSHAL (_id);
  540. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  541. return bind_new_context (n );
  542. } finally {
  543. _releaseReply ($in);
  544. }
  545. } // bind_new_context
  546. /**
  547. * The destroy operation deletes a naming context. If the naming
  548. * context contains bindings, the NotEmpty exception is raised.
  549. *
  550. * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty Indicates that the Naming Context contains bindings.
  551. */
  552. public void destroy () throws org.omg.CosNaming.NamingContextPackage.NotEmpty
  553. {
  554. org.omg.CORBA.portable.InputStream $in = null;
  555. try {
  556. org.omg.CORBA.portable.OutputStream $out = _request ("destroy", true);
  557. $in = _invoke ($out);
  558. return;
  559. } catch (org.omg.CORBA.portable.ApplicationException $ex) {
  560. $in = $ex.getInputStream ();
  561. String _id = $ex.getId ();
  562. if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotEmpty:1.0"))
  563. throw org.omg.CosNaming.NamingContextPackage.NotEmptyHelper.read ($in);
  564. else
  565. throw new org.omg.CORBA.MARSHAL (_id);
  566. } catch (org.omg.CORBA.portable.RemarshalException $rm) {
  567. destroy ( );
  568. } finally {
  569. _releaseReply ($in);
  570. }
  571. } // destroy
  572. // Type-specific CORBA::Object operations
  573. private static String[] __ids = {
  574. "IDL:omg.org/CosNaming/NamingContextExt:1.0",
  575. "IDL:omg.org/CosNaming/NamingContext:1.0"};
  576. public String[] _ids ()
  577. {
  578. return (String[])__ids.clone ();
  579. }
  580. private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  581. {
  582. String str = s.readUTF ();
  583. String[] args = null;
  584. java.util.Properties props = null;
  585. org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
  586. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
  587. _set_delegate (delegate);
  588. }
  589. private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  590. {
  591. String[] args = null;
  592. java.util.Properties props = null;
  593. String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
  594. s.writeUTF (str);
  595. }
  596. } // class _NamingContextExtStub