1. /*
  2. * @(#)_NamingContextImplBase.java 1.10 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. /*
  11. * File: ./org/omg/CosNaming/_NamingContextImplBase.java
  12. * From: nameservice.idl
  13. * Date: Tue Aug 11 03:12:09 1998
  14. * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
  15. */
  16. package org.omg.CosNaming;
  17. public abstract class _NamingContextImplBase extends org.omg.CORBA.DynamicImplementation implements org.omg.CosNaming.NamingContext {
  18. // Constructor
  19. public _NamingContextImplBase() {
  20. super();
  21. }
  22. // Type strings for this class and its superclases
  23. private static final String _type_ids[] = {
  24. "IDL:omg.org/CosNaming/NamingContext:1.0"
  25. };
  26. public String[] _ids() { return (String[]) _type_ids.clone(); }
  27. private static java.util.Dictionary _methods = new java.util.Hashtable();
  28. static {
  29. _methods.put("bind", new java.lang.Integer(0));
  30. _methods.put("bind_context", new java.lang.Integer(1));
  31. _methods.put("rebind", new java.lang.Integer(2));
  32. _methods.put("rebind_context", new java.lang.Integer(3));
  33. _methods.put("resolve", new java.lang.Integer(4));
  34. _methods.put("unbind", new java.lang.Integer(5));
  35. _methods.put("list", new java.lang.Integer(6));
  36. _methods.put("new_context", new java.lang.Integer(7));
  37. _methods.put("bind_new_context", new java.lang.Integer(8));
  38. _methods.put("destroy", new java.lang.Integer(9));
  39. }
  40. // DSI Dispatch call
  41. public void invoke(org.omg.CORBA.ServerRequest r) {
  42. switch (((java.lang.Integer) _methods.get(r.op_name())).intValue()) {
  43. case 0: // org.omg.CosNaming.NamingContext.bind
  44. {
  45. org.omg.CORBA.NVList _list = _orb().create_list(0);
  46. org.omg.CORBA.Any _n = _orb().create_any();
  47. _n.type(org.omg.CosNaming.NameHelper.type());
  48. _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value);
  49. org.omg.CORBA.Any _obj = _orb().create_any();
  50. _obj.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_objref));
  51. _list.add_value("obj", _obj, org.omg.CORBA.ARG_IN.value);
  52. r.params(_list);
  53. org.omg.CosNaming.NameComponent[] n;
  54. n = org.omg.CosNaming.NameHelper.extract(_n);
  55. org.omg.CORBA.Object obj;
  56. obj = _obj.extract_Object();
  57. try {
  58. this.bind(n, obj);
  59. }
  60. catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) {
  61. org.omg.CORBA.Any _except = _orb().create_any();
  62. org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0);
  63. r.except(_except);
  64. return;
  65. }
  66. catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) {
  67. org.omg.CORBA.Any _except = _orb().create_any();
  68. org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1);
  69. r.except(_except);
  70. return;
  71. }
  72. catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) {
  73. org.omg.CORBA.Any _except = _orb().create_any();
  74. org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2);
  75. r.except(_except);
  76. return;
  77. }
  78. catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound e3) {
  79. org.omg.CORBA.Any _except = _orb().create_any();
  80. org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.insert(_except, e3);
  81. r.except(_except);
  82. return;
  83. }
  84. org.omg.CORBA.Any __return = _orb().create_any();
  85. __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void));
  86. r.result(__return);
  87. }
  88. break;
  89. case 1: // org.omg.CosNaming.NamingContext.bind_context
  90. {
  91. org.omg.CORBA.NVList _list = _orb().create_list(0);
  92. org.omg.CORBA.Any _n = _orb().create_any();
  93. _n.type(org.omg.CosNaming.NameHelper.type());
  94. _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value);
  95. org.omg.CORBA.Any _nc = _orb().create_any();
  96. _nc.type(org.omg.CosNaming.NamingContextHelper.type());
  97. _list.add_value("nc", _nc, org.omg.CORBA.ARG_IN.value);
  98. r.params(_list);
  99. org.omg.CosNaming.NameComponent[] n;
  100. n = org.omg.CosNaming.NameHelper.extract(_n);
  101. org.omg.CosNaming.NamingContext nc;
  102. nc = org.omg.CosNaming.NamingContextHelper.extract(_nc);
  103. try {
  104. this.bind_context(n, nc);
  105. }
  106. catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) {
  107. org.omg.CORBA.Any _except = _orb().create_any();
  108. org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0);
  109. r.except(_except);
  110. return;
  111. }
  112. catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) {
  113. org.omg.CORBA.Any _except = _orb().create_any();
  114. org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1);
  115. r.except(_except);
  116. return;
  117. }
  118. catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) {
  119. org.omg.CORBA.Any _except = _orb().create_any();
  120. org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2);
  121. r.except(_except);
  122. return;
  123. }
  124. catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound e3) {
  125. org.omg.CORBA.Any _except = _orb().create_any();
  126. org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.insert(_except, e3);
  127. r.except(_except);
  128. return;
  129. }
  130. org.omg.CORBA.Any __return = _orb().create_any();
  131. __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void));
  132. r.result(__return);
  133. }
  134. break;
  135. case 2: // org.omg.CosNaming.NamingContext.rebind
  136. {
  137. org.omg.CORBA.NVList _list = _orb().create_list(0);
  138. org.omg.CORBA.Any _n = _orb().create_any();
  139. _n.type(org.omg.CosNaming.NameHelper.type());
  140. _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value);
  141. org.omg.CORBA.Any _obj = _orb().create_any();
  142. _obj.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_objref));
  143. _list.add_value("obj", _obj, org.omg.CORBA.ARG_IN.value);
  144. r.params(_list);
  145. org.omg.CosNaming.NameComponent[] n;
  146. n = org.omg.CosNaming.NameHelper.extract(_n);
  147. org.omg.CORBA.Object obj;
  148. obj = _obj.extract_Object();
  149. try {
  150. this.rebind(n, obj);
  151. }
  152. catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) {
  153. org.omg.CORBA.Any _except = _orb().create_any();
  154. org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0);
  155. r.except(_except);
  156. return;
  157. }
  158. catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) {
  159. org.omg.CORBA.Any _except = _orb().create_any();
  160. org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1);
  161. r.except(_except);
  162. return;
  163. }
  164. catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) {
  165. org.omg.CORBA.Any _except = _orb().create_any();
  166. org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2);
  167. r.except(_except);
  168. return;
  169. }
  170. org.omg.CORBA.Any __return = _orb().create_any();
  171. __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void));
  172. r.result(__return);
  173. }
  174. break;
  175. case 3: // org.omg.CosNaming.NamingContext.rebind_context
  176. {
  177. org.omg.CORBA.NVList _list = _orb().create_list(0);
  178. org.omg.CORBA.Any _n = _orb().create_any();
  179. _n.type(org.omg.CosNaming.NameHelper.type());
  180. _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value);
  181. org.omg.CORBA.Any _nc = _orb().create_any();
  182. _nc.type(org.omg.CosNaming.NamingContextHelper.type());
  183. _list.add_value("nc", _nc, org.omg.CORBA.ARG_IN.value);
  184. r.params(_list);
  185. org.omg.CosNaming.NameComponent[] n;
  186. n = org.omg.CosNaming.NameHelper.extract(_n);
  187. org.omg.CosNaming.NamingContext nc;
  188. nc = org.omg.CosNaming.NamingContextHelper.extract(_nc);
  189. try {
  190. this.rebind_context(n, nc);
  191. }
  192. catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) {
  193. org.omg.CORBA.Any _except = _orb().create_any();
  194. org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0);
  195. r.except(_except);
  196. return;
  197. }
  198. catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) {
  199. org.omg.CORBA.Any _except = _orb().create_any();
  200. org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1);
  201. r.except(_except);
  202. return;
  203. }
  204. catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) {
  205. org.omg.CORBA.Any _except = _orb().create_any();
  206. org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2);
  207. r.except(_except);
  208. return;
  209. }
  210. org.omg.CORBA.Any __return = _orb().create_any();
  211. __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void));
  212. r.result(__return);
  213. }
  214. break;
  215. case 4: // org.omg.CosNaming.NamingContext.resolve
  216. {
  217. org.omg.CORBA.NVList _list = _orb().create_list(0);
  218. org.omg.CORBA.Any _n = _orb().create_any();
  219. _n.type(org.omg.CosNaming.NameHelper.type());
  220. _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value);
  221. r.params(_list);
  222. org.omg.CosNaming.NameComponent[] n;
  223. n = org.omg.CosNaming.NameHelper.extract(_n);
  224. org.omg.CORBA.Object ___result;
  225. try {
  226. ___result = this.resolve(n);
  227. }
  228. catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) {
  229. org.omg.CORBA.Any _except = _orb().create_any();
  230. org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0);
  231. r.except(_except);
  232. return;
  233. }
  234. catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) {
  235. org.omg.CORBA.Any _except = _orb().create_any();
  236. org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1);
  237. r.except(_except);
  238. return;
  239. }
  240. catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) {
  241. org.omg.CORBA.Any _except = _orb().create_any();
  242. org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2);
  243. r.except(_except);
  244. return;
  245. }
  246. org.omg.CORBA.Any __result = _orb().create_any();
  247. __result.insert_Object(___result);
  248. r.result(__result);
  249. }
  250. break;
  251. case 5: // org.omg.CosNaming.NamingContext.unbind
  252. {
  253. org.omg.CORBA.NVList _list = _orb().create_list(0);
  254. org.omg.CORBA.Any _n = _orb().create_any();
  255. _n.type(org.omg.CosNaming.NameHelper.type());
  256. _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value);
  257. r.params(_list);
  258. org.omg.CosNaming.NameComponent[] n;
  259. n = org.omg.CosNaming.NameHelper.extract(_n);
  260. try {
  261. this.unbind(n);
  262. }
  263. catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) {
  264. org.omg.CORBA.Any _except = _orb().create_any();
  265. org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0);
  266. r.except(_except);
  267. return;
  268. }
  269. catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e1) {
  270. org.omg.CORBA.Any _except = _orb().create_any();
  271. org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e1);
  272. r.except(_except);
  273. return;
  274. }
  275. catch (org.omg.CosNaming.NamingContextPackage.InvalidName e2) {
  276. org.omg.CORBA.Any _except = _orb().create_any();
  277. org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e2);
  278. r.except(_except);
  279. return;
  280. }
  281. org.omg.CORBA.Any __return = _orb().create_any();
  282. __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void));
  283. r.result(__return);
  284. }
  285. break;
  286. case 6: // org.omg.CosNaming.NamingContext.list
  287. {
  288. org.omg.CORBA.NVList _list = _orb().create_list(0);
  289. org.omg.CORBA.Any _how_many = _orb().create_any();
  290. _how_many.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong));
  291. _list.add_value("how_many", _how_many, org.omg.CORBA.ARG_IN.value);
  292. org.omg.CORBA.Any _bl = _orb().create_any();
  293. _bl.type(org.omg.CosNaming.BindingListHelper.type());
  294. _list.add_value("bl", _bl, org.omg.CORBA.ARG_OUT.value);
  295. org.omg.CORBA.Any _bi = _orb().create_any();
  296. _bi.type(org.omg.CosNaming.BindingIteratorHelper.type());
  297. _list.add_value("bi", _bi, org.omg.CORBA.ARG_OUT.value);
  298. r.params(_list);
  299. int how_many;
  300. how_many = _how_many.extract_ulong();
  301. org.omg.CosNaming.BindingListHolder bl;
  302. bl = new org.omg.CosNaming.BindingListHolder();
  303. org.omg.CosNaming.BindingIteratorHolder bi;
  304. bi = new org.omg.CosNaming.BindingIteratorHolder();
  305. this.list(how_many, bl, bi);
  306. org.omg.CosNaming.BindingListHelper.insert(_bl, bl.value);
  307. org.omg.CosNaming.BindingIteratorHelper.insert(_bi, bi.value);
  308. org.omg.CORBA.Any __return = _orb().create_any();
  309. __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void));
  310. r.result(__return);
  311. }
  312. break;
  313. case 7: // org.omg.CosNaming.NamingContext.new_context
  314. {
  315. org.omg.CORBA.NVList _list = _orb().create_list(0);
  316. r.params(_list);
  317. org.omg.CosNaming.NamingContext ___result;
  318. ___result = this.new_context();
  319. org.omg.CORBA.Any __result = _orb().create_any();
  320. org.omg.CosNaming.NamingContextHelper.insert(__result, ___result);
  321. r.result(__result);
  322. }
  323. break;
  324. case 8: // org.omg.CosNaming.NamingContext.bind_new_context
  325. {
  326. org.omg.CORBA.NVList _list = _orb().create_list(0);
  327. org.omg.CORBA.Any _n = _orb().create_any();
  328. _n.type(org.omg.CosNaming.NameHelper.type());
  329. _list.add_value("n", _n, org.omg.CORBA.ARG_IN.value);
  330. r.params(_list);
  331. org.omg.CosNaming.NameComponent[] n;
  332. n = org.omg.CosNaming.NameHelper.extract(_n);
  333. org.omg.CosNaming.NamingContext ___result;
  334. try {
  335. ___result = this.bind_new_context(n);
  336. }
  337. catch (org.omg.CosNaming.NamingContextPackage.NotFound e0) {
  338. org.omg.CORBA.Any _except = _orb().create_any();
  339. org.omg.CosNaming.NamingContextPackage.NotFoundHelper.insert(_except, e0);
  340. r.except(_except);
  341. return;
  342. }
  343. catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound e1) {
  344. org.omg.CORBA.Any _except = _orb().create_any();
  345. org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.insert(_except, e1);
  346. r.except(_except);
  347. return;
  348. }
  349. catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e2) {
  350. org.omg.CORBA.Any _except = _orb().create_any();
  351. org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.insert(_except, e2);
  352. r.except(_except);
  353. return;
  354. }
  355. catch (org.omg.CosNaming.NamingContextPackage.InvalidName e3) {
  356. org.omg.CORBA.Any _except = _orb().create_any();
  357. org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.insert(_except, e3);
  358. r.except(_except);
  359. return;
  360. }
  361. org.omg.CORBA.Any __result = _orb().create_any();
  362. org.omg.CosNaming.NamingContextHelper.insert(__result, ___result);
  363. r.result(__result);
  364. }
  365. break;
  366. case 9: // org.omg.CosNaming.NamingContext.destroy
  367. {
  368. org.omg.CORBA.NVList _list = _orb().create_list(0);
  369. r.params(_list);
  370. try {
  371. this.destroy();
  372. }
  373. catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e0) {
  374. org.omg.CORBA.Any _except = _orb().create_any();
  375. org.omg.CosNaming.NamingContextPackage.NotEmptyHelper.insert(_except, e0);
  376. r.except(_except);
  377. return;
  378. }
  379. org.omg.CORBA.Any __return = _orb().create_any();
  380. __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void));
  381. r.result(__return);
  382. }
  383. break;
  384. default:
  385. throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  386. }
  387. }
  388. }