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