001 package org.omg.CosNaming; 002 003 004 /** 005 * org/omg/CosNaming/_NamingContextImplBase.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 * Monday, June 18, 2012 10:36:14 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 abstract class _NamingContextImplBase extends org.omg.CORBA.portable.ObjectImpl 021 implements org.omg.CosNaming.NamingContext, org.omg.CORBA.portable.InvokeHandler 022 { 023 024 // Constructors 025 public _NamingContextImplBase () 026 { 027 } 028 029 private static java.util.Hashtable _methods = new java.util.Hashtable (); 030 static 031 { 032 _methods.put ("bind", new java.lang.Integer (0)); 033 _methods.put ("bind_context", new java.lang.Integer (1)); 034 _methods.put ("rebind", new java.lang.Integer (2)); 035 _methods.put ("rebind_context", new java.lang.Integer (3)); 036 _methods.put ("resolve", new java.lang.Integer (4)); 037 _methods.put ("unbind", new java.lang.Integer (5)); 038 _methods.put ("list", new java.lang.Integer (6)); 039 _methods.put ("new_context", new java.lang.Integer (7)); 040 _methods.put ("bind_new_context", new java.lang.Integer (8)); 041 } 042 043 public org.omg.CORBA.portable.OutputStream _invoke (String $method, 044 org.omg.CORBA.portable.InputStream in, 045 org.omg.CORBA.portable.ResponseHandler $rh) 046 { 047 org.omg.CORBA.portable.OutputStream out = null; 048 java.lang.Integer __method = (java.lang.Integer)_methods.get ($method); 049 if (__method == null) 050 throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); 051 052 switch (__method.intValue ()) 053 { 054 055 /** 056 * Creates a binding of a name and an object in the naming context. 057 * Naming contexts that are bound using bind do not participate in name 058 * resolution when compound names are passed to be resolved. 059 * 060 * @param n Name of the object <p> 061 * 062 * @param obj The Object to bind with the given name<p> 063 * 064 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p> 065 * 066 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has 067 * given up for some reason. The client, however, may be able to 068 * continue the operation at the returned naming context.<p> 069 * 070 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p> 071 * 072 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already 073 * bound to the specified name.<p> 074 */ 075 case 0: // CosNaming/NamingContext/bind 076 { 077 try { 078 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in); 079 org.omg.CORBA.Object obj = org.omg.CORBA.ObjectHelper.read (in); 080 this.bind (n, obj); 081 out = $rh.createReply(); 082 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) { 083 out = $rh.createExceptionReply (); 084 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex); 085 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) { 086 out = $rh.createExceptionReply (); 087 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex); 088 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) { 089 out = $rh.createExceptionReply (); 090 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex); 091 } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound $ex) { 092 out = $rh.createExceptionReply (); 093 org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.write (out, $ex); 094 } 095 break; 096 } 097 098 099 /** 100 * Names an object that is a naming context. Naming contexts that 101 * are bound using bind_context() participate in name resolution 102 * when compound names are passed to be resolved. 103 * 104 * @param n Name of the object <p> 105 * 106 * @param nc NamingContect object to bind with the given name <p> 107 * 108 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p> 109 * 110 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has 111 * given up for some reason. The client, however, may be able to 112 * continue the operation at the returned naming context.<p> 113 * 114 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p> 115 * 116 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already 117 * bound to the specified name.<p> 118 */ 119 case 1: // CosNaming/NamingContext/bind_context 120 { 121 try { 122 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in); 123 org.omg.CosNaming.NamingContext nc = org.omg.CosNaming.NamingContextHelper.read (in); 124 this.bind_context (n, nc); 125 out = $rh.createReply(); 126 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) { 127 out = $rh.createExceptionReply (); 128 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex); 129 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) { 130 out = $rh.createExceptionReply (); 131 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex); 132 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) { 133 out = $rh.createExceptionReply (); 134 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex); 135 } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound $ex) { 136 out = $rh.createExceptionReply (); 137 org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.write (out, $ex); 138 } 139 break; 140 } 141 142 143 /** 144 * Creates a binding of a name and an object in the naming context 145 * even if the name is already bound in the context. Naming contexts 146 * that are bound using rebind do not participate in name resolution 147 * when compound names are passed to be resolved. 148 * 149 * @param n Name of the object <p> 150 * 151 * @parm obj The Object to rebind with the given name <p> 152 * 153 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p> 154 * 155 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has 156 * given up for some reason. The client, however, may be able to 157 * continue the operation at the returned naming context.<p> 158 * 159 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p> 160 */ 161 case 2: // CosNaming/NamingContext/rebind 162 { 163 try { 164 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in); 165 org.omg.CORBA.Object obj = org.omg.CORBA.ObjectHelper.read (in); 166 this.rebind (n, obj); 167 out = $rh.createReply(); 168 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) { 169 out = $rh.createExceptionReply (); 170 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex); 171 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) { 172 out = $rh.createExceptionReply (); 173 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex); 174 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) { 175 out = $rh.createExceptionReply (); 176 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex); 177 } 178 break; 179 } 180 181 182 /** 183 * Creates a binding of a name and a naming context in the naming 184 * context even if the name is already bound in the context. Naming 185 * contexts that are bound using rebind_context() participate in name 186 * resolution when compound names are passed to be resolved. 187 * 188 * @param n Name of the object <p> 189 * 190 * @param nc NamingContect object to rebind with the given name <p> 191 * 192 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p> 193 * 194 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has 195 * given up for some reason. The client, however, may be able to 196 * continue the operation at the returned naming context.<p> 197 * 198 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p> 199 */ 200 case 3: // CosNaming/NamingContext/rebind_context 201 { 202 try { 203 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in); 204 org.omg.CosNaming.NamingContext nc = org.omg.CosNaming.NamingContextHelper.read (in); 205 this.rebind_context (n, nc); 206 out = $rh.createReply(); 207 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) { 208 out = $rh.createExceptionReply (); 209 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex); 210 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) { 211 out = $rh.createExceptionReply (); 212 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex); 213 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) { 214 out = $rh.createExceptionReply (); 215 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex); 216 } 217 break; 218 } 219 220 221 /** 222 * The resolve operation is the process of retrieving an object 223 * bound to a name in a given context. The given name must exactly 224 * match the bound name. The naming service does not return the type 225 * of the object. Clients are responsible for "narrowing" the object 226 * to the appropriate type. That is, clients typically cast the returned 227 * object from Object to a more specialized interface. 228 * 229 * @param n Name of the object <p> 230 * 231 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p> 232 * 233 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has 234 * given up for some reason. The client, however, may be able to 235 * continue the operation at the returned naming context.<p> 236 * 237 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p> 238 */ 239 case 4: // CosNaming/NamingContext/resolve 240 { 241 try { 242 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in); 243 org.omg.CORBA.Object $result = null; 244 $result = this.resolve (n); 245 out = $rh.createReply(); 246 org.omg.CORBA.ObjectHelper.write (out, $result); 247 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) { 248 out = $rh.createExceptionReply (); 249 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex); 250 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) { 251 out = $rh.createExceptionReply (); 252 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex); 253 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) { 254 out = $rh.createExceptionReply (); 255 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex); 256 } 257 break; 258 } 259 260 261 /** 262 * The unbind operation removes a name binding from a context. 263 * 264 * @param n Name of the object <p> 265 * 266 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p> 267 * 268 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has 269 * given up for some reason. The client, however, may be able to 270 * continue the operation at the returned naming context.<p> 271 * 272 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p> 273 */ 274 case 5: // CosNaming/NamingContext/unbind 275 { 276 try { 277 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in); 278 this.unbind (n); 279 out = $rh.createReply(); 280 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) { 281 out = $rh.createExceptionReply (); 282 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex); 283 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) { 284 out = $rh.createExceptionReply (); 285 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex); 286 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) { 287 out = $rh.createExceptionReply (); 288 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex); 289 } 290 break; 291 } 292 293 294 /** 295 * The list operation allows a client to iterate through a set of 296 * bindings in a naming context. <p> 297 * 298 * The list operation returns at most the requested number of 299 * bindings in BindingList bl. 300 * <ul> 301 * <li>If the naming context contains additional 302 * bindings, the list operation returns a BindingIterator with the 303 * additional bindings. 304 * <li>If the naming context does not contain additional 305 * bindings, the binding iterator is a nil object reference. 306 * </ul> 307 * 308 * @param how_many the maximum number of bindings to return <p> 309 * 310 * @param bl the returned list of bindings <p> 311 * 312 * @param bi the returned binding iterator <p> 313 */ 314 case 6: // CosNaming/NamingContext/list 315 { 316 int how_many = in.read_ulong (); 317 org.omg.CosNaming.BindingListHolder bl = new org.omg.CosNaming.BindingListHolder (); 318 org.omg.CosNaming.BindingIteratorHolder bi = new org.omg.CosNaming.BindingIteratorHolder (); 319 this.list (how_many, bl, bi); 320 out = $rh.createReply(); 321 org.omg.CosNaming.BindingListHelper.write (out, bl.value); 322 org.omg.CosNaming.BindingIteratorHelper.write (out, bi.value); 323 break; 324 } 325 326 327 /** 328 * This operation returns a naming context implemented by the same 329 * naming server as the context on which the operation was invoked. 330 * The new context is not bound to any name. 331 */ 332 case 7: // CosNaming/NamingContext/new_context 333 { 334 org.omg.CosNaming.NamingContext $result = null; 335 $result = this.new_context (); 336 out = $rh.createReply(); 337 org.omg.CosNaming.NamingContextHelper.write (out, $result); 338 break; 339 } 340 341 342 /** 343 * This operation creates a new context and binds it to the name 344 * supplied as an argument. The newly-created context is implemented 345 * by the same naming server as the context in which it was bound (that 346 * is, the naming server that implements the context denoted by the 347 * name argument excluding the last component). 348 * 349 * @param n Name of the object <p> 350 * 351 * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.<p> 352 * 353 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound Indicates an object is already 354 * bound to the specified name.<p> 355 * 356 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Indicates that the implementation has 357 * given up for some reason. The client, however, may be able to 358 * continue the operation at the returned naming context.<p> 359 * 360 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName Indicates that the name is invalid. <p> 361 */ 362 case 8: // CosNaming/NamingContext/bind_new_context 363 { 364 try { 365 org.omg.CosNaming.NameComponent n[] = org.omg.CosNaming.NameHelper.read (in); 366 org.omg.CosNaming.NamingContext $result = null; 367 $result = this.bind_new_context (n); 368 out = $rh.createReply(); 369 org.omg.CosNaming.NamingContextHelper.write (out, $result); 370 } catch (org.omg.CosNaming.NamingContextPackage.NotFound $ex) { 371 out = $rh.createExceptionReply (); 372 org.omg.CosNaming.NamingContextPackage.NotFoundHelper.write (out, $ex); 373 } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound $ex) { 374 out = $rh.createExceptionReply (); 375 org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.write (out, $ex); 376 } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed $ex) { 377 out = $rh.createExceptionReply (); 378 org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.write (out, $ex); 379 } catch (org.omg.CosNaming.NamingContextPackage.InvalidName $ex) { 380 out = $rh.createExceptionReply (); 381 org.omg.CosNaming.NamingContextPackage.InvalidNameHelper.write (out, $ex); 382 } 383 break; 384 } 385 386 default: 387 throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); 388 } 389 390 return out; 391 } // _invoke 392 393 // Type-specific CORBA::Object operations 394 private static String[] __ids = { 395 "IDL:omg.org/CosNaming/NamingContext:1.0"}; 396 397 public String[] _ids () 398 { 399 return (String[])__ids.clone (); 400 } 401 402 403 } // class _NamingContextImplBase