KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gcc > rmi > iiop > _NameServiceStub


1 package gcc.rmi.iiop;
2
3
4 /**
5 * gcc/rmi/iiop/_NameServiceStub.java .
6 * Generated by the IDL-to-Java compiler (portable), version "3.1"
7 * from ../idl/gcc-rmi-iiop.idl
8 * Wednesday, December 8, 2004 11:54:46 AM EST
9 */

10
11 public class _NameServiceStub extends org.omg.CORBA.portable.ObjectImpl implements gcc.rmi.iiop.NameService
12 {
13
14   public String resolve_host (String host)
15   {
16             org.omg.CORBA.portable.InputStream $in = null;
17             try {
18                 org.omg.CORBA.portable.OutputStream $out = _request ("resolve_host", true);
19                 $out.write_string (host);
20                 $in = _invoke ($out);
21                 String $result = $in.read_string ();
22                 return $result;
23             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
24                 $in = $ex.getInputStream ();
25                 String _id = $ex.getId ();
26                 throw new org.omg.CORBA.MARSHAL (_id);
27             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
28                 return resolve_host (host );
29             } finally {
30                 _releaseReply ($in);
31             }
32   } // resolve_host
33

34
35   /**
36      * The to_string operation is the process of retrieving a stringified name
37      * from a name object.
38      *
39      * @param n String Name of the object <p>
40      *
41      * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
42      */

43   public String to_string (gcc.org.omg.CosNaming.NameComponent[] n) throws gcc.org.omg.CosNaming.NamingContextPackage.InvalidName
44   {
45             org.omg.CORBA.portable.InputStream $in = null;
46             try {
47                 org.omg.CORBA.portable.OutputStream $out = _request ("to_string", true);
48                 gcc.org.omg.CosNaming.NameHelper.write ($out, n);
49                 $in = _invoke ($out);
50                 String $result = gcc.org.omg.CosNaming.NamingContextExtPackage.StringNameHelper.read ($in);
51                 return $result;
52             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
53                 $in = $ex.getInputStream ();
54                 String _id = $ex.getId ();
55                 if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
56                     throw gcc.org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
57                 else
58                     throw new org.omg.CORBA.MARSHAL (_id);
59             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
60                 return to_string (n );
61             } finally {
62                 _releaseReply ($in);
63             }
64   } // to_string
65

66
67   /**
68      * The to_name operation is the process of retrieving a name object
69      * to a stringified name.
70      *
71      * @param n String Name of the object <p>
72      *
73      * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
74      */

75   public gcc.org.omg.CosNaming.NameComponent[] to_name (String sn) throws gcc.org.omg.CosNaming.NamingContextPackage.InvalidName
76   {
77             org.omg.CORBA.portable.InputStream $in = null;
78             try {
79                 org.omg.CORBA.portable.OutputStream $out = _request ("to_name", true);
80                 gcc.org.omg.CosNaming.NamingContextExtPackage.StringNameHelper.write ($out, sn);
81                 $in = _invoke ($out);
82                 gcc.org.omg.CosNaming.NameComponent $result[] = gcc.org.omg.CosNaming.NameHelper.read ($in);
83                 return $result;
84             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
85                 $in = $ex.getInputStream ();
86                 String _id = $ex.getId ();
87                 if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
88                     throw gcc.org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
89                 else
90                     throw new org.omg.CORBA.MARSHAL (_id);
91             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
92                 return to_name (sn );
93             } finally {
94                 _releaseReply ($in);
95             }
96   } // to_name
97

98
99   /**
100      * The to_url operation is the process of retrieving a url representation from a stringified name and
101      * address.
102      *
103      * @param addr Address of the object <p>
104      *
105      * @param sn String Name of the object <p>
106      *
107      * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
108      *
109      * @exception org.omg.CosNaming.NamingContextPackage.InvalidAddress Indicates that the Address is invalid. <p>
110      */

111   public String to_url (String addr, String sn) throws gcc.org.omg.CosNaming.NamingContextExtPackage.InvalidAddress, gcc.org.omg.CosNaming.NamingContextPackage.InvalidName
112   {
113             org.omg.CORBA.portable.InputStream $in = null;
114             try {
115                 org.omg.CORBA.portable.OutputStream $out = _request ("to_url", true);
116                 gcc.org.omg.CosNaming.NamingContextExtPackage.AddressHelper.write ($out, addr);
117                 gcc.org.omg.CosNaming.NamingContextExtPackage.StringNameHelper.write ($out, sn);
118                 $in = _invoke ($out);
119                 String $result = gcc.org.omg.CosNaming.NamingContextExtPackage.URLStringHelper.read ($in);
120                 return $result;
121             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
122                 $in = $ex.getInputStream ();
123                 String _id = $ex.getId ();
124                 if (_id.equals ("IDL:omg.org/CosNaming/NamingContextExt/InvalidAddress:1.0"))
125                     throw gcc.org.omg.CosNaming.NamingContextExtPackage.InvalidAddressHelper.read ($in);
126                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
127                     throw gcc.org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
128                 else
129                     throw new org.omg.CORBA.MARSHAL (_id);
130             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
131                 return to_url (addr, sn );
132             } finally {
133                 _releaseReply ($in);
134             }
135   } // to_url
136

137
138   /**
139      * The resolve_str operation is the process of retrieving an object
140      * bound to a stringified name in a given context. The given name must exactly
141      * match the bound name. The naming service does not return the type
142      * of the object. Clients are responsible for "narrowing" the object
143      * to the appropriate type. That is, clients typically cast the returned
144      * object from Object to a more specialized interface.
145      *
146      * @param n String Name of the object <p>
147      *
148      * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
149      *
150      * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
151      * given up for some reason. The client, however, may be able to
152      * continue the operation at the returned naming context.<p>
153      *
154      * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
155      */

156   public org.omg.CORBA.Object resolve_str (String n) throws gcc.org.omg.CosNaming.NamingContextPackage.NotFound, gcc.org.omg.CosNaming.NamingContextPackage.CannotProceed, gcc.org.omg.CosNaming.NamingContextPackage.InvalidName
157   {
158             org.omg.CORBA.portable.InputStream $in = null;
159             try {
160                 org.omg.CORBA.portable.OutputStream $out = _request ("resolve_str", true);
161                 gcc.org.omg.CosNaming.NamingContextExtPackage.StringNameHelper.write ($out, n);
162                 $in = _invoke ($out);
163                 org.omg.CORBA.Object $result = org.omg.CORBA.ObjectHelper.read ($in);
164                 return $result;
165             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
166                 $in = $ex.getInputStream ();
167                 String _id = $ex.getId ();
168                 if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
169                     throw gcc.org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
170                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
171                     throw gcc.org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
172                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
173                     throw gcc.org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
174                 else
175                     throw new org.omg.CORBA.MARSHAL (_id);
176             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
177                 return resolve_str (n );
178             } finally {
179                 _releaseReply ($in);
180             }
181   } // resolve_str
182

183
184   /**
185      * Creates a binding of a name and an object in the naming context.
186      * Naming contexts that are bound using bind do not participate in name
187      * resolution when compound names are passed to be resolved.
188      *
189      * @param n Name of the object <p>
190      *
191      * @param obj The Object to bind with the given name<p>
192      *
193      * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
194      *
195      * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
196      * given up for some reason. The client, however, may be able to
197      * continue the operation at the returned naming context.<p>
198      *
199      * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
200      *
201      * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already
202      * bound to the specified name.<p>
203      */

204   public void bind (gcc.org.omg.CosNaming.NameComponent[] n, org.omg.CORBA.Object obj) throws gcc.org.omg.CosNaming.NamingContextPackage.NotFound, gcc.org.omg.CosNaming.NamingContextPackage.CannotProceed, gcc.org.omg.CosNaming.NamingContextPackage.InvalidName, gcc.org.omg.CosNaming.NamingContextPackage.AlreadyBound
205   {
206             org.omg.CORBA.portable.InputStream $in = null;
207             try {
208                 org.omg.CORBA.portable.OutputStream $out = _request ("bind", true);
209                 gcc.org.omg.CosNaming.NameHelper.write ($out, n);
210                 org.omg.CORBA.ObjectHelper.write ($out, obj);
211                 $in = _invoke ($out);
212                 return;
213             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
214                 $in = $ex.getInputStream ();
215                 String _id = $ex.getId ();
216                 if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
217                     throw gcc.org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
218                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
219                     throw gcc.org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
220                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
221                     throw gcc.org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
222                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0"))
223                     throw gcc.org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.read ($in);
224                 else
225                     throw new org.omg.CORBA.MARSHAL (_id);
226             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
227                 bind (n, obj );
228             } finally {
229                 _releaseReply ($in);
230             }
231   } // bind
232

233
234   /**
235      * Names an object that is a naming context. Naming contexts that
236      * are bound using bind_context() participate in name resolution
237      * when compound names are passed to be resolved.
238      *
239      * @param n Name of the object <p>
240      *
241      * @param nc NamingContect object to bind with the given name <p>
242      *
243      * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
244      *
245      * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
246      * given up for some reason. The client, however, may be able to
247      * continue the operation at the returned naming context.<p>
248      *
249      * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
250      *
251      * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already
252      * bound to the specified name.<p>
253      */

254   public void bind_context (gcc.org.omg.CosNaming.NameComponent[] n, gcc.org.omg.CosNaming.NamingContext nc) throws gcc.org.omg.CosNaming.NamingContextPackage.NotFound, gcc.org.omg.CosNaming.NamingContextPackage.CannotProceed, gcc.org.omg.CosNaming.NamingContextPackage.InvalidName, gcc.org.omg.CosNaming.NamingContextPackage.AlreadyBound
255   {
256             org.omg.CORBA.portable.InputStream $in = null;
257             try {
258                 org.omg.CORBA.portable.OutputStream $out = _request ("bind_context", true);
259                 gcc.org.omg.CosNaming.NameHelper.write ($out, n);
260                 gcc.org.omg.CosNaming.NamingContextHelper.write ($out, nc);
261                 $in = _invoke ($out);
262                 return;
263             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
264                 $in = $ex.getInputStream ();
265                 String _id = $ex.getId ();
266                 if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
267                     throw gcc.org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
268                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
269                     throw gcc.org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
270                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
271                     throw gcc.org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
272                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0"))
273                     throw gcc.org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.read ($in);
274                 else
275                     throw new org.omg.CORBA.MARSHAL (_id);
276             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
277                 bind_context (n, nc );
278             } finally {
279                 _releaseReply ($in);
280             }
281   } // bind_context
282

283
284   /**
285      * Creates a binding of a name and an object in the naming context
286      * even if the name is already bound in the context. Naming contexts
287      * that are bound using rebind do not participate in name resolution
288      * when compound names are passed to be resolved.
289      *
290      * @param n Name of the object <p>
291      *
292      * @parm obj The Object to rebind with the given name <p>
293      *
294      * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
295      *
296      * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
297      * given up for some reason. The client, however, may be able to
298      * continue the operation at the returned naming context.<p>
299      *
300      * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
301      */

302   public void rebind (gcc.org.omg.CosNaming.NameComponent[] n, org.omg.CORBA.Object obj) throws gcc.org.omg.CosNaming.NamingContextPackage.NotFound, gcc.org.omg.CosNaming.NamingContextPackage.CannotProceed, gcc.org.omg.CosNaming.NamingContextPackage.InvalidName
303   {
304             org.omg.CORBA.portable.InputStream $in = null;
305             try {
306                 org.omg.CORBA.portable.OutputStream $out = _request ("rebind", true);
307                 gcc.org.omg.CosNaming.NameHelper.write ($out, n);
308                 org.omg.CORBA.ObjectHelper.write ($out, obj);
309                 $in = _invoke ($out);
310                 return;
311             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
312                 $in = $ex.getInputStream ();
313                 String _id = $ex.getId ();
314                 if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
315                     throw gcc.org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
316                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
317                     throw gcc.org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
318                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
319                     throw gcc.org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
320                 else
321                     throw new org.omg.CORBA.MARSHAL (_id);
322             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
323                 rebind (n, obj );
324             } finally {
325                 _releaseReply ($in);
326             }
327   } // rebind
328

329
330   /**
331      * Creates a binding of a name and a naming context in the naming
332      * context even if the name is already bound in the context. Naming
333      * contexts that are bound using rebind_context() participate in name
334      * resolution when compound names are passed to be resolved.
335      *
336      * @param n Name of the object <p>
337      *
338      * @param nc NamingContect object to rebind with the given name <p>
339      *
340      * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
341      *
342      * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
343      * given up for some reason. The client, however, may be able to
344      * continue the operation at the returned naming context.<p>
345      *
346      * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
347      */

348   public void rebind_context (gcc.org.omg.CosNaming.NameComponent[] n, gcc.org.omg.CosNaming.NamingContext nc) throws gcc.org.omg.CosNaming.NamingContextPackage.NotFound, gcc.org.omg.CosNaming.NamingContextPackage.CannotProceed, gcc.org.omg.CosNaming.NamingContextPackage.InvalidName
349   {
350             org.omg.CORBA.portable.InputStream $in = null;
351             try {
352                 org.omg.CORBA.portable.OutputStream $out = _request ("rebind_context", true);
353                 gcc.org.omg.CosNaming.NameHelper.write ($out, n);
354                 gcc.org.omg.CosNaming.NamingContextHelper.write ($out, nc);
355                 $in = _invoke ($out);
356                 return;
357             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
358                 $in = $ex.getInputStream ();
359                 String _id = $ex.getId ();
360                 if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
361                     throw gcc.org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
362                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
363                     throw gcc.org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
364                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
365                     throw gcc.org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
366                 else
367                     throw new org.omg.CORBA.MARSHAL (_id);
368             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
369                 rebind_context (n, nc );
370             } finally {
371                 _releaseReply ($in);
372             }
373   } // rebind_context
374

375
376   /**
377      * The resolve operation is the process of retrieving an object
378      * bound to a name in a given context. The given name must exactly
379      * match the bound name. The naming service does not return the type
380      * of the object. Clients are responsible for "narrowing" the object
381      * to the appropriate type. That is, clients typically cast the returned
382      * object from Object to a more specialized interface.
383      *
384      * @param n Name of the object <p>
385      *
386      * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
387      *
388      * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
389      * given up for some reason. The client, however, may be able to
390      * continue the operation at the returned naming context.<p>
391      *
392      * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
393      */

394   public org.omg.CORBA.Object resolve (gcc.org.omg.CosNaming.NameComponent[] n) throws gcc.org.omg.CosNaming.NamingContextPackage.NotFound, gcc.org.omg.CosNaming.NamingContextPackage.CannotProceed, gcc.org.omg.CosNaming.NamingContextPackage.InvalidName
395   {
396             org.omg.CORBA.portable.InputStream $in = null;
397             try {
398                 org.omg.CORBA.portable.OutputStream $out = _request ("resolve", true);
399                 gcc.org.omg.CosNaming.NameHelper.write ($out, n);
400                 $in = _invoke ($out);
401                 org.omg.CORBA.Object $result = org.omg.CORBA.ObjectHelper.read ($in);
402                 return $result;
403             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
404                 $in = $ex.getInputStream ();
405                 String _id = $ex.getId ();
406                 if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
407                     throw gcc.org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
408                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
409                     throw gcc.org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
410                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
411                     throw gcc.org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
412                 else
413                     throw new org.omg.CORBA.MARSHAL (_id);
414             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
415                 return resolve (n );
416             } finally {
417                 _releaseReply ($in);
418             }
419   } // resolve
420

421
422   /**
423      * The unbind operation removes a name binding from a context.
424      *
425      * @param n Name of the object <p>
426      *
427      * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
428      *
429      * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
430      * given up for some reason. The client, however, may be able to
431      * continue the operation at the returned naming context.<p>
432      *
433      * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
434      */

435   public void unbind (gcc.org.omg.CosNaming.NameComponent[] n) throws gcc.org.omg.CosNaming.NamingContextPackage.NotFound, gcc.org.omg.CosNaming.NamingContextPackage.CannotProceed, gcc.org.omg.CosNaming.NamingContextPackage.InvalidName
436   {
437             org.omg.CORBA.portable.InputStream $in = null;
438             try {
439                 org.omg.CORBA.portable.OutputStream $out = _request ("unbind", true);
440                 gcc.org.omg.CosNaming.NameHelper.write ($out, n);
441                 $in = _invoke ($out);
442                 return;
443             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
444                 $in = $ex.getInputStream ();
445                 String _id = $ex.getId ();
446                 if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
447                     throw gcc.org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
448                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
449                     throw gcc.org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
450                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
451                     throw gcc.org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
452                 else
453                     throw new org.omg.CORBA.MARSHAL (_id);
454             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
455                 unbind (n );
456             } finally {
457                 _releaseReply ($in);
458             }
459   } // unbind
460

461
462   /**
463      * The list operation allows a client to iterate through a set of
464      * bindings in a naming context. <p>
465      *
466      * The list operation returns at most the requested number of
467      * bindings in BindingList bl.
468      * <ul>
469      * <li>If the naming context contains additional
470      * bindings, the list operation returns a BindingIterator with the
471      * additional bindings.
472      * <li>If the naming context does not contain additional
473      * bindings, the binding iterator is a nil object reference.
474      * </ul>
475      *
476      * @param how_many the maximum number of bindings to return <p>
477      *
478      * @param bl the returned list of bindings <p>
479      *
480      * @param bi the returned binding iterator <p>
481      */

482   public void list (int how_many, gcc.org.omg.CosNaming.BindingListHolder bl, gcc.org.omg.CosNaming.BindingIteratorHolder bi)
483   {
484             org.omg.CORBA.portable.InputStream $in = null;
485             try {
486                 org.omg.CORBA.portable.OutputStream $out = _request ("list", true);
487                 $out.write_ulong (how_many);
488                 $in = _invoke ($out);
489                 bl.value = gcc.org.omg.CosNaming.BindingListHelper.read ($in);
490                 bi.value = gcc.org.omg.CosNaming.BindingIteratorHelper.read ($in);
491                 return;
492             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
493                 $in = $ex.getInputStream ();
494                 String _id = $ex.getId ();
495                 throw new org.omg.CORBA.MARSHAL (_id);
496             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
497                 list (how_many, bl, bi );
498             } finally {
499                 _releaseReply ($in);
500             }
501   } // list
502

503
504   /**
505      * This operation returns a naming context implemented by the same
506      * naming server as the context on which the operation was invoked.
507      * The new context is not bound to any name.
508      */

509   public gcc.org.omg.CosNaming.NamingContext new_context ()
510   {
511             org.omg.CORBA.portable.InputStream $in = null;
512             try {
513                 org.omg.CORBA.portable.OutputStream $out = _request ("new_context", true);
514                 $in = _invoke ($out);
515                 gcc.org.omg.CosNaming.NamingContext $result = gcc.org.omg.CosNaming.NamingContextHelper.read ($in);
516                 return $result;
517             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
518                 $in = $ex.getInputStream ();
519                 String _id = $ex.getId ();
520                 throw new org.omg.CORBA.MARSHAL (_id);
521             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
522                 return new_context ( );
523             } finally {
524                 _releaseReply ($in);
525             }
526   } // new_context
527

528
529   /**
530      * This operation creates a new context and binds it to the name
531      * supplied as an argument. The newly-created context is implemented
532      * by the same naming server as the context in which it was bound (that
533      * is, the naming server that implements the context denoted by the
534      * name argument excluding the last component).
535      *
536      * @param n Name of the object <p>
537      *
538      * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
539      *
540      * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already
541      * bound to the specified name.<p>
542      *
543      * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
544      * given up for some reason. The client, however, may be able to
545      * continue the operation at the returned naming context.<p>
546      *
547      * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
548      */

549   public gcc.org.omg.CosNaming.NamingContext bind_new_context (gcc.org.omg.CosNaming.NameComponent[] n) throws gcc.org.omg.CosNaming.NamingContextPackage.NotFound, gcc.org.omg.CosNaming.NamingContextPackage.AlreadyBound, gcc.org.omg.CosNaming.NamingContextPackage.CannotProceed, gcc.org.omg.CosNaming.NamingContextPackage.InvalidName
550   {
551             org.omg.CORBA.portable.InputStream $in = null;
552             try {
553                 org.omg.CORBA.portable.OutputStream $out = _request ("bind_new_context", true);
554                 gcc.org.omg.CosNaming.NameHelper.write ($out, n);
555                 $in = _invoke ($out);
556                 gcc.org.omg.CosNaming.NamingContext $result = gcc.org.omg.CosNaming.NamingContextHelper.read ($in);
557                 return $result;
558             } catch (org.omg.CORBA.portable.ApplicationException $ex) {
559                 $in = $ex.getInputStream ();
560                 String _id = $ex.getId ();
561                 if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
562                     throw gcc.org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
563                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0"))
564                     throw gcc.org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.read ($in);
565                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
566                     throw gcc.org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
567                 else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
568                     throw gcc.org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
569                 else
570                     throw new org.omg.CORBA.MARSHAL (_id);
571             } catch (org.omg.CORBA.portable.RemarshalException $rm) {
572                 return bind_new_context (n );
573             } finally {
574                 _releaseReply ($in);
575             }
576   } // bind_new_context
577

578   // Type-specific CORBA::Object operations
579
private static String[] __ids = {
580     "IDL:gcc/rmi/iiop/NameService:1.0",
581     "IDL:omg.org/CosNaming/NamingContextExt:1.0",
582     "IDL:omg.org/CosNaming/NamingContext:1.0"};
583
584   public String[] _ids ()
585   {
586     return (String[])__ids.clone ();
587   }
588
589   private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
590   {
591      String str = s.readUTF ();
592      String[] args = null;
593      java.util.Properties props = null;
594      org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
595      org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
596      _set_delegate (delegate);
597   }
598
599   private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
600   {
601      String[] args = null;
602      java.util.Properties props = null;
603      String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
604      s.writeUTF (str);
605   }
606 } // class _NameServiceStub
607
Popular Tags