001    package org.omg.CosNaming;
002    
003    
004    /**
005    * org/omg/CosNaming/_NamingContextStub.java .
006    * Generated by the IDL-to-Java compiler (portable), version "3.2"
007    * from /builddir/build/BUILD/geronimo-specs-1.6/geronimo-spec-corba/src/main/idl/CosNaming.idl
008    * Saturday, September 22, 2012 10:56:38 AM CEST
009    */
010    
011    
012    /** 
013       * A naming context is an object that contains a set of name bindings in 
014       * which each name is unique. Different names can be bound to an object 
015       * in the same or different contexts at the same time. <p>
016       * 
017       * See <a href=" http://www.omg.org/corba/sectrans.htm#nam">CORBA COS 
018       * Naming Specification.</a>
019       */
020    public class _NamingContextStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CosNaming.NamingContext
021    {
022    
023    
024      /**
025           * Creates a binding of a name and an object in the naming context.
026           * Naming contexts that are bound using bind do not participate in name
027           * resolution when compound names are passed to be resolved. 
028           * 
029           * @param n Name of the object <p>
030           * 
031           * @param obj The Object to bind with the given name<p>
032           * 
033           * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
034           * 
035           * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
036           * given up for some reason. The client, however, may be able to 
037           * continue the operation at the returned naming context.<p>
038           * 
039           * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
040           *
041           * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already 
042           * bound to the specified name.<p>
043           */
044      public void bind (org.omg.CosNaming.NameComponent[] n, org.omg.CORBA.Object obj) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName, org.omg.CosNaming.NamingContextPackage.AlreadyBound
045      {
046                org.omg.CORBA.portable.InputStream $in = null;
047                try {
048                    org.omg.CORBA.portable.OutputStream $out = _request ("bind", true);
049                    org.omg.CosNaming.NameHelper.write ($out, n);
050                    org.omg.CORBA.ObjectHelper.write ($out, obj);
051                    $in = _invoke ($out);
052                    return;
053                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
054                    $in = $ex.getInputStream ();
055                    String _id = $ex.getId ();
056                    if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
057                        throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
058                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
059                        throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
060                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
061                        throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
062                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0"))
063                        throw org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.read ($in);
064                    else
065                        throw new org.omg.CORBA.MARSHAL (_id);
066                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
067                    bind (n, obj        );
068                } finally {
069                    _releaseReply ($in);
070                }
071      } // bind
072    
073    
074      /**
075           * Names an object that is a naming context. Naming contexts that
076           * are bound using bind_context() participate in name resolution 
077           * when compound names are passed to be resolved.
078           * 
079           * @param n Name of the object <p>
080           * 
081           * @param nc NamingContect object to bind with the given name <p>
082           * 
083           * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
084           * 
085           * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
086           * given up for some reason. The client, however, may be able to 
087           * continue the operation at the returned naming context.<p>
088           * 
089           * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
090           *
091           * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already 
092           * bound to the specified name.<p>
093           */
094      public void bind_context (org.omg.CosNaming.NameComponent[] n, org.omg.CosNaming.NamingContext nc) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName, org.omg.CosNaming.NamingContextPackage.AlreadyBound
095      {
096                org.omg.CORBA.portable.InputStream $in = null;
097                try {
098                    org.omg.CORBA.portable.OutputStream $out = _request ("bind_context", true);
099                    org.omg.CosNaming.NameHelper.write ($out, n);
100                    org.omg.CosNaming.NamingContextHelper.write ($out, nc);
101                    $in = _invoke ($out);
102                    return;
103                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
104                    $in = $ex.getInputStream ();
105                    String _id = $ex.getId ();
106                    if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
107                        throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
108                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
109                        throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
110                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
111                        throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
112                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0"))
113                        throw org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.read ($in);
114                    else
115                        throw new org.omg.CORBA.MARSHAL (_id);
116                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
117                    bind_context (n, nc        );
118                } finally {
119                    _releaseReply ($in);
120                }
121      } // bind_context
122    
123    
124      /**
125           * Creates a binding of a name and an object in the naming context
126           * even if the name is already bound in the context. Naming contexts 
127           * that are bound using rebind do not participate in name resolution 
128           * when compound names are passed to be resolved.
129           * 
130           * @param  n Name of the object <p>
131           * 
132           * @parm obj The Object to rebind with the given name <p>
133           * 
134           * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
135           * 
136           * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
137           * given up for some reason. The client, however, may be able to 
138           * continue the operation at the returned naming context.<p>
139           * 
140           * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
141           */
142      public void rebind (org.omg.CosNaming.NameComponent[] n, org.omg.CORBA.Object obj) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName
143      {
144                org.omg.CORBA.portable.InputStream $in = null;
145                try {
146                    org.omg.CORBA.portable.OutputStream $out = _request ("rebind", true);
147                    org.omg.CosNaming.NameHelper.write ($out, n);
148                    org.omg.CORBA.ObjectHelper.write ($out, obj);
149                    $in = _invoke ($out);
150                    return;
151                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
152                    $in = $ex.getInputStream ();
153                    String _id = $ex.getId ();
154                    if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
155                        throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
156                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
157                        throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
158                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
159                        throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
160                    else
161                        throw new org.omg.CORBA.MARSHAL (_id);
162                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
163                    rebind (n, obj        );
164                } finally {
165                    _releaseReply ($in);
166                }
167      } // rebind
168    
169    
170      /** 
171           * Creates a binding of a name and a naming context in the naming
172           * context even if the name is already bound in the context. Naming 
173           * contexts that are bound using rebind_context() participate in name 
174           * resolution when compound names are passed to be resolved.
175           * 
176           * @param n Name of the object <p>
177           * 
178           * @param nc NamingContect object to rebind with the given name <p>
179           * 
180           * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
181           * 
182           * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
183           * given up for some reason. The client, however, may be able to 
184           * continue the operation at the returned naming context.<p>
185           * 
186           * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
187           */
188      public void rebind_context (org.omg.CosNaming.NameComponent[] n, org.omg.CosNaming.NamingContext nc) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName
189      {
190                org.omg.CORBA.portable.InputStream $in = null;
191                try {
192                    org.omg.CORBA.portable.OutputStream $out = _request ("rebind_context", true);
193                    org.omg.CosNaming.NameHelper.write ($out, n);
194                    org.omg.CosNaming.NamingContextHelper.write ($out, nc);
195                    $in = _invoke ($out);
196                    return;
197                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
198                    $in = $ex.getInputStream ();
199                    String _id = $ex.getId ();
200                    if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
201                        throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
202                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
203                        throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
204                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
205                        throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
206                    else
207                        throw new org.omg.CORBA.MARSHAL (_id);
208                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
209                    rebind_context (n, nc        );
210                } finally {
211                    _releaseReply ($in);
212                }
213      } // rebind_context
214    
215    
216      /** 
217           * The resolve operation is the process of retrieving an object
218           * bound to a name in a given context. The given name must exactly 
219           * match the bound name. The naming service does not return the type 
220           * of the object. Clients are responsible for "narrowing" the object 
221           * to the appropriate type. That is, clients typically cast the returned 
222           * object from Object to a more specialized interface.
223           * 
224           * @param n Name of the object <p>
225           * 
226           * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
227           * 
228           * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
229           * given up for some reason. The client, however, may be able to 
230           * continue the operation at the returned naming context.<p>
231           * 
232           * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
233           */
234      public org.omg.CORBA.Object resolve (org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName
235      {
236                org.omg.CORBA.portable.InputStream $in = null;
237                try {
238                    org.omg.CORBA.portable.OutputStream $out = _request ("resolve", true);
239                    org.omg.CosNaming.NameHelper.write ($out, n);
240                    $in = _invoke ($out);
241                    org.omg.CORBA.Object $result = org.omg.CORBA.ObjectHelper.read ($in);
242                    return $result;
243                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
244                    $in = $ex.getInputStream ();
245                    String _id = $ex.getId ();
246                    if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
247                        throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
248                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
249                        throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
250                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
251                        throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
252                    else
253                        throw new org.omg.CORBA.MARSHAL (_id);
254                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
255                    return resolve (n        );
256                } finally {
257                    _releaseReply ($in);
258                }
259      } // resolve
260    
261    
262      /** 
263           * The unbind operation removes a name binding from a context.
264           * 
265           * @param n Name of the object <p>
266           * 
267           * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
268           * 
269           * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
270           * given up for some reason. The client, however, may be able to 
271           * continue the operation at the returned naming context.<p>
272           * 
273           * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
274           */
275      public void unbind (org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName
276      {
277                org.omg.CORBA.portable.InputStream $in = null;
278                try {
279                    org.omg.CORBA.portable.OutputStream $out = _request ("unbind", true);
280                    org.omg.CosNaming.NameHelper.write ($out, n);
281                    $in = _invoke ($out);
282                    return;
283                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
284                    $in = $ex.getInputStream ();
285                    String _id = $ex.getId ();
286                    if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
287                        throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
288                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
289                        throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
290                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
291                        throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
292                    else
293                        throw new org.omg.CORBA.MARSHAL (_id);
294                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
295                    unbind (n        );
296                } finally {
297                    _releaseReply ($in);
298                }
299      } // unbind
300    
301    
302      /**
303           * The list operation allows a client to iterate through a set of
304           * bindings in a naming context. <p>
305           * 
306           * The list operation returns at most the requested number of
307           * bindings in BindingList bl. 
308           * <ul>
309           * <li>If the naming context contains additional 
310           * bindings, the list operation returns a BindingIterator with the 
311           * additional bindings. 
312           * <li>If the naming context does not contain additional 
313           * bindings, the binding iterator is a nil object reference.
314           * </ul>
315           * 
316           * @param how_many the maximum number of bindings to return <p>
317           * 
318           * @param bl the returned list of bindings <p>
319           * 
320           * @param bi the returned binding iterator <p>
321           */
322      public void list (int how_many, org.omg.CosNaming.BindingListHolder bl, org.omg.CosNaming.BindingIteratorHolder bi)
323      {
324                org.omg.CORBA.portable.InputStream $in = null;
325                try {
326                    org.omg.CORBA.portable.OutputStream $out = _request ("list", true);
327                    $out.write_ulong (how_many);
328                    $in = _invoke ($out);
329                    bl.value = org.omg.CosNaming.BindingListHelper.read ($in);
330                    bi.value = org.omg.CosNaming.BindingIteratorHelper.read ($in);
331                    return;
332                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
333                    $in = $ex.getInputStream ();
334                    String _id = $ex.getId ();
335                    throw new org.omg.CORBA.MARSHAL (_id);
336                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
337                    list (how_many, bl, bi        );
338                } finally {
339                    _releaseReply ($in);
340                }
341      } // list
342    
343    
344      /**
345           * This operation returns a naming context implemented by the same
346           * naming server as the context on which the operation was invoked. 
347           * The new context is not bound to any name.
348           */
349      public org.omg.CosNaming.NamingContext new_context ()
350      {
351                org.omg.CORBA.portable.InputStream $in = null;
352                try {
353                    org.omg.CORBA.portable.OutputStream $out = _request ("new_context", true);
354                    $in = _invoke ($out);
355                    org.omg.CosNaming.NamingContext $result = org.omg.CosNaming.NamingContextHelper.read ($in);
356                    return $result;
357                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
358                    $in = $ex.getInputStream ();
359                    String _id = $ex.getId ();
360                    throw new org.omg.CORBA.MARSHAL (_id);
361                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
362                    return new_context (        );
363                } finally {
364                    _releaseReply ($in);
365                }
366      } // new_context
367    
368    
369      /**
370           * This operation creates a new context and binds it to the name
371           * supplied as an argument. The newly-created context is implemented 
372           * by the same naming server as the context in which it was bound (that 
373           * is, the naming server that implements the context denoted by the 
374           * name argument excluding the last component).
375           * 
376           * @param n Name of the object <p>
377           * 
378           * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
379           * 
380           * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already 
381           * bound to the specified name.<p>
382           * 
383           * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
384           * given up for some reason. The client, however, may be able to 
385           * continue the operation at the returned naming context.<p>
386           * 
387           * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
388           */
389      public org.omg.CosNaming.NamingContext bind_new_context (org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.NotFound, org.omg.CosNaming.NamingContextPackage.AlreadyBound, org.omg.CosNaming.NamingContextPackage.CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName
390      {
391                org.omg.CORBA.portable.InputStream $in = null;
392                try {
393                    org.omg.CORBA.portable.OutputStream $out = _request ("bind_new_context", true);
394                    org.omg.CosNaming.NameHelper.write ($out, n);
395                    $in = _invoke ($out);
396                    org.omg.CosNaming.NamingContext $result = org.omg.CosNaming.NamingContextHelper.read ($in);
397                    return $result;
398                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
399                    $in = $ex.getInputStream ();
400                    String _id = $ex.getId ();
401                    if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"))
402                        throw org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read ($in);
403                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0"))
404                        throw org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.read ($in);
405                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"))
406                        throw org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read ($in);
407                    else if (_id.equals ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"))
408                        throw org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.read ($in);
409                    else
410                        throw new org.omg.CORBA.MARSHAL (_id);
411                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
412                    return bind_new_context (n        );
413                } finally {
414                    _releaseReply ($in);
415                }
416      } // bind_new_context
417    
418      // Type-specific CORBA::Object operations
419      private static String[] __ids = {
420        "IDL:omg.org/CosNaming/NamingContext:1.0"};
421    
422      public String[] _ids ()
423      {
424        return (String[])__ids.clone ();
425      }
426    
427      private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
428      {
429         String str = s.readUTF ();
430         String[] args = null;
431         java.util.Properties props = null;
432         org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
433         org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
434         _set_delegate (delegate);
435      }
436    
437      private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
438      {
439         String[] args = null;
440         java.util.Properties props = null;
441         String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
442         s.writeUTF (str);
443      }
444    } // class _NamingContextStub