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:
60:
67: public class _NamingContextStub
68: extends ObjectImpl
69: implements NamingContext
70: {
71:
74: private static final long serialVersionUID = 6835430958405349379L;
75:
76:
79: public _NamingContextStub()
80: {
81: super();
82: }
83:
84:
87: _NamingContextStub(Delegate delegate)
88: {
89: super();
90: _set_delegate(delegate);
91: }
92:
93:
96: public String[] _ids()
97: {
98: return new String[] { NamingContextHelper.id() };
99: }
100:
101:
102: public void bind(NameComponent[] a_name, org.omg.CORBA.Object an_object)
103: throws NotFound, CannotProceed, InvalidName, AlreadyBound
104: {
105: InputStream in = null;
106: try
107: {
108: OutputStream out = _request("bind", true);
109: NameHelper.write(out, a_name);
110: ObjectHelper.write(out, an_object);
111: in = _invoke(out);
112: }
113: catch (ApplicationException ex)
114: {
115: in = ex.getInputStream();
116:
117: String id = ex.getId();
118: throw5(in, id);
119: }
120: catch (RemarshalException remarsh)
121: {
122: bind(a_name, an_object);
123: }
124: finally
125: {
126: _releaseReply(in);
127: }
128: }
129:
130:
131: public void bind_context(NameComponent[] a_name, NamingContext a_context)
132: throws NotFound, CannotProceed, InvalidName, AlreadyBound
133: {
134: InputStream in = null;
135: try
136: {
137: OutputStream out = _request("bind_context", true);
138: NameHelper.write(out, a_name);
139: NamingContextHelper.write(out, a_context);
140: in = _invoke(out);
141: }
142: catch (ApplicationException ex)
143: {
144: in = ex.getInputStream();
145:
146: String id = ex.getId();
147: throw5(in, id);
148: }
149: catch (RemarshalException remarsh)
150: {
151: bind_context(a_name, a_context);
152: }
153: finally
154: {
155: _releaseReply(in);
156: }
157: }
158:
159:
160: public NamingContext bind_new_context(NameComponent[] a_name)
161: throws NotFound, AlreadyBound, CannotProceed,
162: InvalidName
163: {
164: InputStream in = null;
165: try
166: {
167: OutputStream out = _request("bind_new_context", true);
168: NameHelper.write(out, a_name);
169: in = _invoke(out);
170:
171: NamingContext __result = NamingContextHelper.read(in);
172: return __result;
173: }
174: catch (ApplicationException ex)
175: {
176: in = ex.getInputStream();
177:
178: String id = ex.getId();
179: throw5(in, id);
180: throw new InternalError();
181: }
182: catch (RemarshalException remarsh)
183: {
184: return bind_new_context(a_name);
185: }
186: finally
187: {
188: _releaseReply(in);
189: }
190: }
191:
192:
193: public void destroy()
194: throws NotEmpty
195: {
196: InputStream in = null;
197: try
198: {
199: OutputStream out = _request("destroy", true);
200: in = _invoke(out);
201: }
202: catch (ApplicationException ex)
203: {
204: in = ex.getInputStream();
205:
206: String id = ex.getId();
207: if (id.equals(NotEmptyHelper.id()))
208: throw NotEmptyHelper.read(in);
209: else
210: throw new MARSHAL(id);
211: }
212: catch (RemarshalException remarsh)
213: {
214: destroy();
215: }
216: finally
217: {
218: _releaseReply(in);
219: }
220: }
221:
222:
223: public void list(int amount, BindingListHolder a_list,
224: BindingIteratorHolder an_iter
225: )
226: {
227: InputStream in = null;
228: try
229: {
230: OutputStream out = _request("list", true);
231: out.write_ulong(amount);
232: in = _invoke(out);
233: a_list.value = BindingListHelper.read(in);
234: an_iter.value = BindingIteratorHelper.read(in);
235: }
236: catch (ApplicationException ex)
237: {
238: in = ex.getInputStream();
239: throw new MARSHAL(ex.getId());
240: }
241: catch (RemarshalException remarsh)
242: {
243: list(amount, a_list, an_iter);
244: }
245: finally
246: {
247: _releaseReply(in);
248: }
249: }
250:
251:
252: public NamingContext new_context()
253: {
254: InputStream in = null;
255: try
256: {
257: OutputStream out = _request("new_context", true);
258: in = _invoke(out);
259:
260: NamingContext __result = NamingContextHelper.read(in);
261: return __result;
262: }
263: catch (ApplicationException ex)
264: {
265: in = ex.getInputStream();
266: throw new MARSHAL(ex.getId());
267: }
268: catch (RemarshalException remarsh)
269: {
270: return new_context();
271: }
272: finally
273: {
274: _releaseReply(in);
275: }
276: }
277:
278:
279: public void rebind(NameComponent[] a_name, org.omg.CORBA.Object an_object)
280: throws NotFound, CannotProceed, InvalidName
281: {
282: InputStream in = null;
283: try
284: {
285: OutputStream out = _request("rebind", true);
286: NameHelper.write(out, a_name);
287: ObjectHelper.write(out, an_object);
288: in = _invoke(out);
289: }
290: catch (ApplicationException ex)
291: {
292: in = ex.getInputStream();
293:
294: String id = ex.getId();
295: throw4(in, id);
296: }
297: catch (RemarshalException remarsh)
298: {
299: rebind(a_name, an_object);
300: }
301: finally
302: {
303: _releaseReply(in);
304: }
305: }
306:
307:
308: public void rebind_context(NameComponent[] a_name, NamingContext a_context)
309: throws NotFound, CannotProceed, InvalidName
310: {
311: InputStream in = null;
312: try
313: {
314: OutputStream out = _request("rebind_context", true);
315: NameHelper.write(out, a_name);
316: NamingContextHelper.write(out, a_context);
317: in = _invoke(out);
318: }
319: catch (ApplicationException ex)
320: {
321: in = ex.getInputStream();
322:
323: String id = ex.getId();
324: throw4(in, id);
325: }
326: catch (RemarshalException remarsh)
327: {
328: rebind_context(a_name, a_context);
329: }
330: finally
331: {
332: _releaseReply(in);
333: }
334: }
335:
336:
337: public org.omg.CORBA.Object resolve(NameComponent[] a_name)
338: throws NotFound, CannotProceed, InvalidName
339: {
340: InputStream in = null;
341: try
342: {
343: OutputStream out = _request("resolve", true);
344: NameHelper.write(out, a_name);
345: in = _invoke(out);
346:
347: org.omg.CORBA.Object __result = ObjectHelper.read(in);
348: return __result;
349: }
350: catch (ApplicationException ex)
351: {
352: in = ex.getInputStream();
353:
354: String id = ex.getId();
355: throw4(in, id);
356: throw new InternalError();
357: }
358: catch (RemarshalException remarsh)
359: {
360: return resolve(a_name);
361: }
362: finally
363: {
364: _releaseReply(in);
365: }
366: }
367:
368:
369: public void unbind(NameComponent[] a_name)
370: throws NotFound, CannotProceed, InvalidName
371: {
372: InputStream in = null;
373: try
374: {
375: OutputStream out = _request("unbind", true);
376: NameHelper.write(out, a_name);
377: in = _invoke(out);
378: }
379: catch (ApplicationException ex)
380: {
381: in = ex.getInputStream();
382:
383: String id = ex.getId();
384: if (id.equals(NotFoundHelper.id()))
385: throw NotFoundHelper.read(in);
386: else if (id.equals(CannotProceedHelper.id()))
387: throw CannotProceedHelper.read(in);
388: else if (id.equals(InvalidNameHelper.id()))
389: throw InvalidNameHelper.read(in);
390: else
391: throw new MARSHAL(id);
392: }
393: catch (RemarshalException remarsh)
394: {
395: unbind(a_name);
396: }
397: finally
398: {
399: _releaseReply(in);
400: }
401: }
402:
403:
417: void throw4(InputStream in, String id)
418: throws MARSHAL, InvalidName, CannotProceed, NotFound
419: {
420: if (id.equals(NotFoundHelper.id()))
421: throw NotFoundHelper.read(in);
422: else if (id.equals(CannotProceedHelper.id()))
423: throw CannotProceedHelper.read(in);
424: else if (id.equals(InvalidNameHelper.id()))
425: throw InvalidNameHelper.read(in);
426: else
427: throw new MARSHAL(id);
428: }
429:
430:
445: void throw5(InputStream in, String id)
446: throws MARSHAL, AlreadyBound, InvalidName, CannotProceed,
447: NotFound
448: {
449: if (id.equals(AlreadyBoundHelper.id()))
450: throw AlreadyBoundHelper.read(in);
451: else
452: throw4(in, id);
453: }
454: }