001 package org.omg.CosNaming;
002
003
004 /**
005 * org/omg/CosNaming/_NamingContextExtImplBase.java .
006 * Generated by the IDL-to-Java compiler (portable), version "3.2"
007 * from /home/iurt/rpm/BUILD/geronimo-spec-corba/src/main/idl/CosNaming.idl
008 * Saturday, November 26, 2011 9:53:36 PM UTC
009 */
010
011
012 /**
013 * A naming context extension is an extenrion to naming context 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 abstract class _NamingContextExtImplBase extends org.omg.CORBA.portable.ObjectImpl
021 implements org.omg.CosNaming.NamingContextExt, org.omg.CORBA.portable.InvokeHandler
022 {
023
024 // Constructors
025 public _NamingContextExtImplBase ()
026 {
027 }
028
029 private static java.util.Hashtable _methods = new java.util.Hashtable ();
030 static
031 {
032 _methods.put ("to_string", new java.lang.Integer (0));
033 _methods.put ("to_name", new java.lang.Integer (1));
034 _methods.put ("to_url", new java.lang.Integer (2));
035 _methods.put ("resolve_str", new java.lang.Integer (3));
036 _methods.put ("bind", new java.lang.Integer (4));
037 _methods.put ("bind_context", new java.lang.Integer (5));
038 _methods.put ("rebind", new java.lang.Integer (6));
039 _methods.put ("rebind_context", new java.lang.Integer (7));
040 _methods.put ("resolve", new java.lang.Integer (8));
041 _methods.put ("unbind", new java.lang.Integer (9));
042 _methods.put ("list", new java.lang.Integer (10));
043 _methods.put ("new_context", new java.lang.Integer (11));
044 _methods.put ("bind_new_context", new java.lang.Integer (12));
045 }
046
047 public org.omg.CORBA.portable.OutputStream _invoke (String $method,
048 org.omg.CORBA.portable.InputStream in,
049 org.omg.CORBA.portable.ResponseHandler $rh)
050 {
051 org.omg.CORBA.portable.OutputStream out = null;
052 java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
053 if (__method == null)
054 throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
055
056 switch (__method.intValue ())
057 {
058
059 /**
060 * The to_string operation is the process of retrieving a stringified name
061 * from a name object.
062 *
063 * @param n String Name of the object <p>
064 *
065 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
066 */
067 case 0: // CosNaming/NamingContextExt/to_string
068 {
069 try {
070 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in);
071 String $result = null;
072 $result = this.to_string (n);
073 out = $rh.createReply();
074 out.write_string ($result);
075 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) {
076 out = $rh.createExceptionReply ();
077 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex);
078 }
079 break;
080 }
081
082
083 /**
084 * The to_name operation is the process of retrieving a name object
085 * to a stringified name.
086 *
087 * @param n String Name of the object <p>
088 *
089 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
090 */
091 case 1: // CosNaming/NamingContextExt/to_name
092 {
093 try {
094 String sn = org.omg.CosNaming.NamingContextExtPackage.StringNameHelper.read (in);
095 org.omg.CosNaming.NameComponent $result[] = null;
096 $result = this.to_name (sn);
097 out = $rh.createReply();
098 org.omg.CosNaming.NameHelper.write (out, $result);
099 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) {
100 out = $rh.createExceptionReply ();
101 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex);
102 }
103 break;
104 }
105
106
107 /**
108 * The to_url operation is the process of retrieving a url representation from a stringified name and
109 * address.
110 *
111 * @param addr Address of the object <p>
112 *
113 * @param sn String Name of the object <p>
114 *
115 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
116 *
117 * @exception org.omg.CosNaming.NamingContextPackage.InvalidAddress Indicates that the Address is invalid. <p>
118 */
119 case 2: // CosNaming/NamingContextExt/to_url
120 {
121 try {
122 String addr = org.omg.CosNaming.NamingContextExtPackage.AddressHelper.read (in);
123 String sn = org.omg.CosNaming.NamingContextExtPackage.StringNameHelper.read (in);
124 String $result = null;
125 $result = this.to_url (addr, sn);
126 out = $rh.createReply();
127 out.write_string ($result);
128 } catch (org.omg.CosNaming.NamingContextExtPackage.InvalidAddress $ex) {
129 out = $rh.createExceptionReply ();
130 org.omg.CosNaming.NamingContextExtPackage.InvalidAddressHelper.write (out, $ex);
131 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) {
132 out = $rh.createExceptionReply ();
133 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex);
134 }
135 break;
136 }
137
138
139 /**
140 * The resolve_str operation is the process of retrieving an object
141 * bound to a stringified name in a given context. The given name must exactly
142 * match the bound name. The naming service does not return the type
143 * of the object. Clients are responsible for "narrowing" the object
144 * to the appropriate type. That is, clients typically cast the returned
145 * object from Object to a more specialized interface.
146 *
147 * @param n String Name of the object <p>
148 *
149 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
150 *
151 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
152 * given up for some reason. The client, however, may be able to
153 * continue the operation at the returned naming context.<p>
154 *
155 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
156 */
157 case 3: // CosNaming/NamingContextExt/resolve_str
158 {
159 try {
160 String n = org.omg.CosNaming.NamingContextExtPackage.StringNameHelper.read (in);
161 org.omg.CORBA.Object $result = null;
162 $result = this.resolve_str (n);
163 out = $rh.createReply();
164 org.omg.CORBA.ObjectHelper.write (out, $result);
165 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) {
166 out = $rh.createExceptionReply ();
167 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex);
168 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) {
169 out = $rh.createExceptionReply ();
170 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex);
171 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) {
172 out = $rh.createExceptionReply ();
173 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex);
174 }
175 break;
176 }
177
178
179 /**
180 * Creates a binding of a name and an object in the naming context.
181 * Naming contexts that are bound using bind do not participate in name
182 * resolution when compound names are passed to be resolved.
183 *
184 * @param n Name of the object <p>
185 *
186 * @param obj The Object to bind with the given name<p>
187 *
188 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
189 *
190 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
191 * given up for some reason. The client, however, may be able to
192 * continue the operation at the returned naming context.<p>
193 *
194 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
195 *
196 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already
197 * bound to the specified name.<p>
198 */
199 case 4: // CosNaming/NamingContext/bind
200 {
201 try {
202 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in);
203 org.omg.CORBA.Object obj = org.omg.CORBA.ObjectHelper.read (in);
204 this.bind (n, obj);
205 out = $rh.createReply();
206 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) {
207 out = $rh.createExceptionReply ();
208 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex);
209 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) {
210 out = $rh.createExceptionReply ();
211 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex);
212 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) {
213 out = $rh.createExceptionReply ();
214 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex);
215 } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound $ex) {
216 out = $rh.createExceptionReply ();
217 org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.write (out, $ex);
218 }
219 break;
220 }
221
222
223 /**
224 * Names an object that is a naming context. Naming contexts that
225 * are bound using bind_context() participate in name resolution
226 * when compound names are passed to be resolved.
227 *
228 * @param n Name of the object <p>
229 *
230 * @param nc NamingContect object to bind with the given name <p>
231 *
232 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
233 *
234 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
235 * given up for some reason. The client, however, may be able to
236 * continue the operation at the returned naming context.<p>
237 *
238 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
239 *
240 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already
241 * bound to the specified name.<p>
242 */
243 case 5: // CosNaming/NamingContext/bind_context
244 {
245 try {
246 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in);
247 org.omg.CosNaming.NamingContext nc = org.omg.CosNaming.NamingContextHelper.read (in);
248 this.bind_context (n, nc);
249 out = $rh.createReply();
250 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) {
251 out = $rh.createExceptionReply ();
252 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex);
253 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) {
254 out = $rh.createExceptionReply ();
255 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex);
256 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) {
257 out = $rh.createExceptionReply ();
258 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex);
259 } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound $ex) {
260 out = $rh.createExceptionReply ();
261 org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.write (out, $ex);
262 }
263 break;
264 }
265
266
267 /**
268 * Creates a binding of a name and an object in the naming context
269 * even if the name is already bound in the context. Naming contexts
270 * that are bound using rebind do not participate in name resolution
271 * when compound names are passed to be resolved.
272 *
273 * @param n Name of the object <p>
274 *
275 * @parm obj The Object to rebind with the given name <p>
276 *
277 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
278 *
279 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
280 * given up for some reason. The client, however, may be able to
281 * continue the operation at the returned naming context.<p>
282 *
283 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
284 */
285 case 6: // CosNaming/NamingContext/rebind
286 {
287 try {
288 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in);
289 org.omg.CORBA.Object obj = org.omg.CORBA.ObjectHelper.read (in);
290 this.rebind (n, obj);
291 out = $rh.createReply();
292 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) {
293 out = $rh.createExceptionReply ();
294 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex);
295 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) {
296 out = $rh.createExceptionReply ();
297 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex);
298 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) {
299 out = $rh.createExceptionReply ();
300 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex);
301 }
302 break;
303 }
304
305
306 /**
307 * Creates a binding of a name and a naming context in the naming
308 * context even if the name is already bound in the context. Naming
309 * contexts that are bound using rebind_context() participate in name
310 * resolution when compound names are passed to be resolved.
311 *
312 * @param n Name of the object <p>
313 *
314 * @param nc NamingContect object to rebind with the given name <p>
315 *
316 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
317 *
318 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
319 * given up for some reason. The client, however, may be able to
320 * continue the operation at the returned naming context.<p>
321 *
322 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
323 */
324 case 7: // CosNaming/NamingContext/rebind_context
325 {
326 try {
327 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in);
328 org.omg.CosNaming.NamingContext nc = org.omg.CosNaming.NamingContextHelper.read (in);
329 this.rebind_context (n, nc);
330 out = $rh.createReply();
331 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) {
332 out = $rh.createExceptionReply ();
333 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex);
334 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) {
335 out = $rh.createExceptionReply ();
336 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex);
337 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) {
338 out = $rh.createExceptionReply ();
339 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex);
340 }
341 break;
342 }
343
344
345 /**
346 * The resolve operation is the process of retrieving an object
347 * bound to a name in a given context. The given name must exactly
348 * match the bound name. The naming service does not return the type
349 * of the object. Clients are responsible for "narrowing" the object
350 * to the appropriate type. That is, clients typically cast the returned
351 * object from Object to a more specialized interface.
352 *
353 * @param n Name of the object <p>
354 *
355 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
356 *
357 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
358 * given up for some reason. The client, however, may be able to
359 * continue the operation at the returned naming context.<p>
360 *
361 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
362 */
363 case 8: // CosNaming/NamingContext/resolve
364 {
365 try {
366 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in);
367 org.omg.CORBA.Object $result = null;
368 $result = this.resolve (n);
369 out = $rh.createReply();
370 org.omg.CORBA.ObjectHelper.write (out, $result);
371 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) {
372 out = $rh.createExceptionReply ();
373 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex);
374 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) {
375 out = $rh.createExceptionReply ();
376 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex);
377 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) {
378 out = $rh.createExceptionReply ();
379 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex);
380 }
381 break;
382 }
383
384
385 /**
386 * The unbind operation removes a name binding from a context.
387 *
388 * @param n Name of the object <p>
389 *
390 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
391 *
392 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
393 * given up for some reason. The client, however, may be able to
394 * continue the operation at the returned naming context.<p>
395 *
396 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
397 */
398 case 9: // CosNaming/NamingContext/unbind
399 {
400 try {
401 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in);
402 this.unbind (n);
403 out = $rh.createReply();
404 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) {
405 out = $rh.createExceptionReply ();
406 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex);
407 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) {
408 out = $rh.createExceptionReply ();
409 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex);
410 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) {
411 out = $rh.createExceptionReply ();
412 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex);
413 }
414 break;
415 }
416
417
418 /**
419 * The list operation allows a client to iterate through a set of
420 * bindings in a naming context. <p>
421 *
422 * The list operation returns at most the requested number of
423 * bindings in BindingList bl.
424 * <ul>
425 * <li>If the naming context contains additional
426 * bindings, the list operation returns a BindingIterator with the
427 * additional bindings.
428 * <li>If the naming context does not contain additional
429 * bindings, the binding iterator is a nil object reference.
430 * </ul>
431 *
432 * @param how_many the maximum number of bindings to return <p>
433 *
434 * @param bl the returned list of bindings <p>
435 *
436 * @param bi the returned binding iterator <p>
437 */
438 case 10: // CosNaming/NamingContext/list
439 {
440 int how_many = in.read_ulong ();
441 org.omg.CosNaming.BindingListHolder bl = new org.omg.CosNaming.BindingListHolder ();
442 org.omg.CosNaming.BindingIteratorHolder bi = new org.omg.CosNaming.BindingIteratorHolder ();
443 this.list (how_many, bl, bi);
444 out = $rh.createReply();
445 org.omg.CosNaming.BindingListHelper.write (out, bl.value);
446 org.omg.CosNaming.BindingIteratorHelper.write (out, bi.value);
447 break;
448 }
449
450
451 /**
452 * This operation returns a naming context implemented by the same
453 * naming server as the context on which the operation was invoked.
454 * The new context is not bound to any name.
455 */
456 case 11: // CosNaming/NamingContext/new_context
457 {
458 org.omg.CosNaming.NamingContext $result = null;
459 $result = this.new_context ();
460 out = $rh.createReply();
461 org.omg.CosNaming.NamingContextHelper.write (out, $result);
462 break;
463 }
464
465
466 /**
467 * This operation creates a new context and binds it to the name
468 * supplied as an argument. The newly-created context is implemented
469 * by the same naming server as the context in which it was bound (that
470 * is, the naming server that implements the context denoted by the
471 * name argument excluding the last component).
472 *
473 * @param n Name of the object <p>
474 *
475 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p>
476 *
477 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already
478 * bound to the specified name.<p>
479 *
480 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has
481 * given up for some reason. The client, however, may be able to
482 * continue the operation at the returned naming context.<p>
483 *
484 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p>
485 */
486 case 12: // CosNaming/NamingContext/bind_new_context
487 {
488 try {
489 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in);
490 org.omg.CosNaming.NamingContext $result = null;
491 $result = this.bind_new_context (n);
492 out = $rh.createReply();
493 org.omg.CosNaming.NamingContextHelper.write (out, $result);
494 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) {
495 out = $rh.createExceptionReply ();
496 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex);
497 } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound $ex) {
498 out = $rh.createExceptionReply ();
499 org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.write (out, $ex);
500 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) {
501 out = $rh.createExceptionReply ();
502 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex);
503 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) {
504 out = $rh.createExceptionReply ();
505 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex);
506 }
507 break;
508 }
509
510 default:
511 throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
512 }
513
514 return out;
515 } // _invoke
516
517 // Type-specific CORBA::Object operations
518 private static String[] __ids = {
519 "IDL:omg.org/CosNaming/NamingContextExt:1.0",
520 "IDL:omg.org/CosNaming/NamingContext:1.0"};
521
522 public String[] _ids ()
523 {
524 return (String[])__ids.clone ();
525 }
526
527
528 } // class _NamingContextExtImplBase