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:
63:
71: public abstract class NamingContextPOA
72: extends Servant
73: implements NamingContextOperations, InvokeHandler
74: {
75:
76: public String[] _all_interfaces(POA poa, byte[] object_ID)
77: {
78: return new String[] { NamingContextHelper.id() };
79: }
80:
81:
92: public OutputStream _invoke(String method, InputStream in, ResponseHandler rh)
93: {
94: OutputStream out = null;
95: Integer call_method = _NamingContextImplBase.methods.get(method);
96: if (call_method == null)
97: throw new BAD_OPERATION(Minor.Method, CompletionStatus.COMPLETED_MAYBE);
98:
99: switch (call_method.intValue())
100: {
101: case 0:
102: {
103: try
104: {
105: NameComponent[] a_name = NameHelper.read(in);
106: org.omg.CORBA.Object an_object = ObjectHelper.read(in);
107: bind(a_name, an_object);
108: out = rh.createReply();
109: }
110: catch (NotFound ex)
111: {
112: out = rh.createExceptionReply();
113: NotFoundHelper.write(out, ex);
114: }
115: catch (CannotProceed ex)
116: {
117: out = rh.createExceptionReply();
118: CannotProceedHelper.write(out, ex);
119: }
120: catch (InvalidName ex)
121: {
122: out = rh.createExceptionReply();
123: InvalidNameHelper.write(out, ex);
124: }
125: catch (AlreadyBound ex)
126: {
127: out = rh.createExceptionReply();
128: AlreadyBoundHelper.write(out, ex);
129: }
130: break;
131: }
132:
133: case 1:
134: {
135: try
136: {
137: NameComponent[] a_name = NameHelper.read(in);
138: org.omg.CORBA.Object an_object = ObjectHelper.read(in);
139: rebind(a_name, an_object);
140: out = rh.createReply();
141: }
142: catch (NotFound ex)
143: {
144: out = rh.createExceptionReply();
145: NotFoundHelper.write(out, ex);
146: }
147: catch (CannotProceed ex)
148: {
149: out = rh.createExceptionReply();
150: CannotProceedHelper.write(out, ex);
151: }
152: catch (InvalidName ex)
153: {
154: out = rh.createExceptionReply();
155: InvalidNameHelper.write(out, ex);
156: }
157: break;
158: }
159:
160: case 2:
161: {
162: try
163: {
164: NameComponent[] a_name = NameHelper.read(in);
165: NamingContext a_context = NamingContextHelper.read(in);
166: bind_context(a_name, a_context);
167: out = rh.createReply();
168: }
169: catch (NotFound ex)
170: {
171: out = rh.createExceptionReply();
172: NotFoundHelper.write(out, ex);
173: }
174: catch (CannotProceed ex)
175: {
176: out = rh.createExceptionReply();
177: CannotProceedHelper.write(out, ex);
178: }
179: catch (InvalidName ex)
180: {
181: out = rh.createExceptionReply();
182: InvalidNameHelper.write(out, ex);
183: }
184: catch (AlreadyBound ex)
185: {
186: out = rh.createExceptionReply();
187: AlreadyBoundHelper.write(out, ex);
188: }
189: break;
190: }
191:
192: case 3:
193: {
194: try
195: {
196: NameComponent[] a_name = NameHelper.read(in);
197: NamingContext a_context = NamingContextHelper.read(in);
198: rebind_context(a_name, a_context);
199: out = rh.createReply();
200: }
201: catch (NotFound ex)
202: {
203: out = rh.createExceptionReply();
204: NotFoundHelper.write(out, ex);
205: }
206: catch (CannotProceed ex)
207: {
208: out = rh.createExceptionReply();
209: CannotProceedHelper.write(out, ex);
210: }
211: catch (InvalidName ex)
212: {
213: out = rh.createExceptionReply();
214: InvalidNameHelper.write(out, ex);
215: }
216: break;
217: }
218:
219: case 4:
220: {
221: try
222: {
223: NameComponent[] a_name = NameHelper.read(in);
224: org.omg.CORBA.Object __result = null;
225: __result = resolve(a_name);
226: out = rh.createReply();
227: ObjectHelper.write(out, __result);
228: }
229: catch (NotFound ex)
230: {
231: out = rh.createExceptionReply();
232: NotFoundHelper.write(out, ex);
233: }
234: catch (CannotProceed ex)
235: {
236: out = rh.createExceptionReply();
237: CannotProceedHelper.write(out, ex);
238: }
239: catch (InvalidName ex)
240: {
241: out = rh.createExceptionReply();
242: InvalidNameHelper.write(out, ex);
243: }
244: break;
245: }
246:
247: case 5:
248: {
249: try
250: {
251: NameComponent[] a_name = NameHelper.read(in);
252: unbind(a_name);
253: out = rh.createReply();
254: }
255: catch (NotFound ex)
256: {
257: out = rh.createExceptionReply();
258: NotFoundHelper.write(out, ex);
259: }
260: catch (CannotProceed ex)
261: {
262: out = rh.createExceptionReply();
263: CannotProceedHelper.write(out, ex);
264: }
265: catch (InvalidName ex)
266: {
267: out = rh.createExceptionReply();
268: InvalidNameHelper.write(out, ex);
269: }
270: break;
271: }
272:
273: case 6:
274: {
275: NamingContext __result = null;
276: __result = new_context();
277: out = rh.createReply();
278: NamingContextHelper.write(out, __result);
279: break;
280: }
281:
282: case 7:
283: {
284: try
285: {
286: NameComponent[] a_name = NameHelper.read(in);
287: NamingContext __result = null;
288: __result = bind_new_context(a_name);
289: out = rh.createReply();
290: NamingContextHelper.write(out, __result);
291: }
292: catch (NotFound ex)
293: {
294: out = rh.createExceptionReply();
295: NotFoundHelper.write(out, ex);
296: }
297: catch (AlreadyBound ex)
298: {
299: out = rh.createExceptionReply();
300: AlreadyBoundHelper.write(out, ex);
301: }
302: catch (CannotProceed ex)
303: {
304: out = rh.createExceptionReply();
305: CannotProceedHelper.write(out, ex);
306: }
307: catch (InvalidName ex)
308: {
309: out = rh.createExceptionReply();
310: InvalidNameHelper.write(out, ex);
311: }
312: break;
313: }
314:
315: case 8:
316: {
317: try
318: {
319: destroy();
320: out = rh.createReply();
321: }
322: catch (NotEmpty ex)
323: {
324: out = rh.createExceptionReply();
325: NotEmptyHelper.write(out, ex);
326: }
327: break;
328: }
329:
330: case 9:
331: {
332: int amount = in.read_ulong();
333: BindingListHolder a_list = new BindingListHolder();
334: BindingIteratorHolder an_iter = new BindingIteratorHolder();
335: list(amount, a_list, an_iter);
336: out = rh.createReply();
337: BindingListHelper.write(out, a_list.value);
338: BindingIteratorHelper.write(out, an_iter.value);
339: break;
340: }
341:
342: default:
343: throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE);
344: }
345:
346: return out;
347: }
348:
349:
353: public NamingContext _this()
354: {
355: return NamingContextHelper.narrow(super._this_object());
356: }
357:
358:
362: public NamingContext _this(org.omg.CORBA.ORB orb)
363: {
364: return NamingContextHelper.narrow(super._this_object(orb));
365: }
366:
367: }