1:
37:
38:
39: package ;
40:
41: import ;
42: import ;
43: import ;
44: import ;
45: import ;
46: import ;
47: import ;
48: import ;
49: import ;
50: import ;
51: import ;
52: import ;
53: import ;
54: import ;
55: import ;
56: import ;
57: import ;
58: import ;
59: import ;
60: import ;
61: import ;
62:
63:
71: public abstract class NamingContextExtPOA
72: extends Servant
73: implements NamingContextExtOperations, InvokeHandler
74:
75: {
76:
77: public String[] _all_interfaces(POA poa, byte[] object_ID)
78: {
79: return new String[] { NamingContextExtHelper.id(), NamingContextHelper.id() };
80: }
81:
82:
83: public OutputStream _invoke(String method, InputStream in, ResponseHandler rh)
84: {
85: Integer call_method = (Integer) _NamingContextExtImplBase._methods.get(method);
86:
87: if (call_method == null)
88:
89: return super_invoke(method, in, rh);
90:
91: OutputStream out = null;
92:
93: switch (call_method.intValue())
94: {
95: case 0:
96: {
97: try
98: {
99: NameComponent[] a_name = NameHelper.read(in);
100: String result = null;
101: result = this.to_string(a_name);
102: out = rh.createReply();
103: out.write_string(result);
104: }
105: catch (InvalidName ex)
106: {
107: out = rh.createExceptionReply();
108: InvalidNameHelper.write(out, ex);
109: }
110: break;
111: }
112:
113: case 1:
114: {
115: try
116: {
117: String a_name_string = in.read_string();
118: NameComponent[] result = to_name(a_name_string);
119: out = rh.createReply();
120: NameHelper.write(out, result);
121: }
122: catch (InvalidName ex)
123: {
124: out = rh.createExceptionReply();
125: InvalidNameHelper.write(out, ex);
126: }
127: break;
128: }
129:
130: case 2:
131: {
132: try
133: {
134: String an_address = in.read_string();
135: String a_name_string = in.read_string();
136: String result = to_url(an_address, a_name_string);
137: out = rh.createReply();
138: out.write_string(result);
139: }
140: catch (InvalidAddress ex)
141: {
142: out = rh.createExceptionReply();
143: InvalidAddressHelper.write(out, ex);
144: }
145: catch (InvalidName ex)
146: {
147: out = rh.createExceptionReply();
148: InvalidNameHelper.write(out, ex);
149: }
150: break;
151: }
152:
153: case 3:
154: {
155: try
156: {
157: String a_name_string = in.read_string();
158: org.omg.CORBA.Object result = resolve_str(a_name_string);
159: out = rh.createReply();
160: org.omg.CORBA.ObjectHelper.write(out, result);
161: }
162: catch (NotFound ex)
163: {
164: out = rh.createExceptionReply();
165: NotFoundHelper.write(out, ex);
166: }
167: catch (CannotProceed ex)
168: {
169: out = rh.createExceptionReply();
170: CannotProceedHelper.write(out, ex);
171: }
172: catch (InvalidName ex)
173: {
174: out = rh.createExceptionReply();
175: InvalidNameHelper.write(out, ex);
176: }
177: break;
178: }
179: }
180: return out;
181: }
182:
183:
187: OutputStream super_invoke(String method, InputStream in, ResponseHandler rh)
188: {
189: OutputStream out = null;
190: Integer call_method = (Integer) _NamingContextImplBase.methods.get(method);
191: if (call_method == null)
192: throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE);
193:
194: switch (call_method.intValue())
195: {
196: case 0:
197: {
198: try
199: {
200: NameComponent[] a_name = NameHelper.read(in);
201: org.omg.CORBA.Object an_object = ObjectHelper.read(in);
202: bind(a_name, an_object);
203: out = rh.createReply();
204: }
205: catch (NotFound ex)
206: {
207: out = rh.createExceptionReply();
208: NotFoundHelper.write(out, ex);
209: }
210: catch (CannotProceed ex)
211: {
212: out = rh.createExceptionReply();
213: CannotProceedHelper.write(out, ex);
214: }
215: catch (InvalidName ex)
216: {
217: out = rh.createExceptionReply();
218: InvalidNameHelper.write(out, ex);
219: }
220: catch (AlreadyBound ex)
221: {
222: out = rh.createExceptionReply();
223: AlreadyBoundHelper.write(out, ex);
224: }
225: break;
226: }
227:
228: case 1:
229: {
230: try
231: {
232: NameComponent[] a_name = NameHelper.read(in);
233: org.omg.CORBA.Object an_object = ObjectHelper.read(in);
234: rebind(a_name, an_object);
235: out = rh.createReply();
236: }
237: catch (NotFound ex)
238: {
239: out = rh.createExceptionReply();
240: NotFoundHelper.write(out, ex);
241: }
242: catch (CannotProceed ex)
243: {
244: out = rh.createExceptionReply();
245: CannotProceedHelper.write(out, ex);
246: }
247: catch (InvalidName ex)
248: {
249: out = rh.createExceptionReply();
250: InvalidNameHelper.write(out, ex);
251: }
252: break;
253: }
254:
255: case 2:
256: {
257: try
258: {
259: NameComponent[] a_name = NameHelper.read(in);
260: NamingContext a_context = NamingContextHelper.read(in);
261: bind_context(a_name, a_context);
262: out = rh.createReply();
263: }
264: catch (NotFound ex)
265: {
266: out = rh.createExceptionReply();
267: NotFoundHelper.write(out, ex);
268: }
269: catch (CannotProceed ex)
270: {
271: out = rh.createExceptionReply();
272: CannotProceedHelper.write(out, ex);
273: }
274: catch (InvalidName ex)
275: {
276: out = rh.createExceptionReply();
277: InvalidNameHelper.write(out, ex);
278: }
279: catch (AlreadyBound ex)
280: {
281: out = rh.createExceptionReply();
282: AlreadyBoundHelper.write(out, ex);
283: }
284: break;
285: }
286:
287: case 3:
288: {
289: try
290: {
291: NameComponent[] a_name = NameHelper.read(in);
292: NamingContext a_context = NamingContextHelper.read(in);
293: rebind_context(a_name, a_context);
294: out = rh.createReply();
295: }
296: catch (NotFound ex)
297: {
298: out = rh.createExceptionReply();
299: NotFoundHelper.write(out, ex);
300: }
301: catch (CannotProceed ex)
302: {
303: out = rh.createExceptionReply();
304: CannotProceedHelper.write(out, ex);
305: }
306: catch (InvalidName ex)
307: {
308: out = rh.createExceptionReply();
309: InvalidNameHelper.write(out, ex);
310: }
311: break;
312: }
313:
314: case 4:
315: {
316: try
317: {
318: NameComponent[] a_name = NameHelper.read(in);
319: org.omg.CORBA.Object __result = null;
320: __result = resolve(a_name);
321: out = rh.createReply();
322: ObjectHelper.write(out, __result);
323: }
324: catch (NotFound ex)
325: {
326: out = rh.createExceptionReply();
327: NotFoundHelper.write(out, ex);
328: }
329: catch (CannotProceed ex)
330: {
331: out = rh.createExceptionReply();
332: CannotProceedHelper.write(out, ex);
333: }
334: catch (InvalidName ex)
335: {
336: out = rh.createExceptionReply();
337: InvalidNameHelper.write(out, ex);
338: }
339: break;
340: }
341:
342: case 5:
343: {
344: try
345: {
346: NameComponent[] a_name = NameHelper.read(in);
347: unbind(a_name);
348: out = rh.createReply();
349: }
350: catch (NotFound ex)
351: {
352: out = rh.createExceptionReply();
353: NotFoundHelper.write(out, ex);
354: }
355: catch (CannotProceed ex)
356: {
357: out = rh.createExceptionReply();
358: CannotProceedHelper.write(out, ex);
359: }
360: catch (InvalidName ex)
361: {
362: out = rh.createExceptionReply();
363: InvalidNameHelper.write(out, ex);
364: }
365: break;
366: }
367:
368: case 6:
369: {
370: NamingContext __result = null;
371: __result = new_context();
372: out = rh.createReply();
373: NamingContextHelper.write(out, __result);
374: break;
375: }
376:
377: case 7:
378: {
379: try
380: {
381: NameComponent[] a_name = NameHelper.read(in);
382: NamingContext __result = null;
383: __result = bind_new_context(a_name);
384: out = rh.createReply();
385: NamingContextHelper.write(out, __result);
386: }
387: catch (NotFound ex)
388: {
389: out = rh.createExceptionReply();
390: NotFoundHelper.write(out, ex);
391: }
392: catch (AlreadyBound ex)
393: {
394: out = rh.createExceptionReply();
395: AlreadyBoundHelper.write(out, ex);
396: }
397: catch (CannotProceed ex)
398: {
399: out = rh.createExceptionReply();
400: CannotProceedHelper.write(out, ex);
401: }
402: catch (InvalidName ex)
403: {
404: out = rh.createExceptionReply();
405: InvalidNameHelper.write(out, ex);
406: }
407: break;
408: }
409:
410: case 8:
411: {
412: try
413: {
414: destroy();
415: out = rh.createReply();
416: }
417: catch (NotEmpty ex)
418: {
419: out = rh.createExceptionReply();
420: NotEmptyHelper.write(out, ex);
421: }
422: break;
423: }
424:
425: case 9:
426: {
427: int amount = in.read_ulong();
428: BindingListHolder a_list = new BindingListHolder();
429: BindingIteratorHolder an_iter = new BindingIteratorHolder();
430: list(amount, a_list, an_iter);
431: out = rh.createReply();
432: BindingListHelper.write(out, a_list.value);
433: BindingIteratorHelper.write(out, an_iter.value);
434: break;
435: }
436:
437: default:
438: throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE);
439: }
440:
441: return out;
442: }
443:
444:
448: public NamingContextExt _this()
449: {
450: return NamingContextExtHelper.narrow(super._this_object());
451: }
452:
453:
457: public NamingContextExt _this(org.omg.CORBA.ORB orb)
458: {
459: return NamingContextExtHelper.narrow(super._this_object(orb));
460: }
461: }