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