1 /* 2 * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package org.omg.CORBA; 27 28 import org.omg.CORBA.portable.*; 29 import org.omg.CORBA.ORBPackage.InvalidName; 30 31 import java.util.Properties; 32 import java.applet.Applet; 33 import java.io.File; 34 import java.io.FileInputStream; 35 36 import java.security.AccessController; 37 import java.security.PrivilegedAction; 38 39 /** 40 * A class providing APIs for the CORBA Object Request Broker 41 * features. The {@code ORB} class also provides 42 * "pluggable ORB implementation" APIs that allow another vendor's ORB 43 * implementation to be used. 44 * <P> 45 * An ORB makes it possible for CORBA objects to communicate 46 * with each other by connecting objects making requests (clients) with 47 * objects servicing requests (servers). 48 * <P> 49 * 50 * The {@code ORB} class, which 51 * encapsulates generic CORBA functionality, does the following: 52 * (Note that items 5 and 6, which include most of the methods in 53 * the class {@code ORB}, are typically used with the 54 * {@code Dynamic Invocation Interface} (DII) and 55 * the {@code Dynamic Skeleton Interface} (DSI). 56 * These interfaces may be used by a developer directly, but 57 * most commonly they are used by the ORB internally and are 58 * not seen by the general programmer.) 59 * <OL> 60 * <li> initializes the ORB implementation by supplying values for 61 * predefined properties and environmental parameters 62 * <li> obtains initial object references to services such as 63 * the NameService using the method {@code resolve_initial_references} 64 * <li> converts object references to strings and back 65 * <li> connects the ORB to a servant (an instance of a CORBA object 66 * implementation) and disconnects the ORB from a servant 67 * <li> creates objects such as 68 * <ul> 69 * <li>{@code TypeCode} 70 * <li>{@code Any} 71 * <li>{@code NamedValue} 72 * <li>{@code Context} 73 * <li>{@code Environment} 74 * <li>lists (such as {@code NVList}) containing these objects 75 * </ul> 76 * <li> sends multiple messages in the DII 77 * </OL> 78 * 79 * <P> 80 * The {@code ORB} class can be used to obtain references to objects 81 * implemented anywhere on the network. 82 * <P> 83 * An application or applet gains access to the CORBA environment 84 * by initializing itself into an {@code ORB} using one of 85 * three {@code init} methods. Two of the three methods use the properties 86 * (associations of a name with a value) shown in the 87 * table below.<BR> 88 * <TABLE BORDER=1 SUMMARY="Standard Java CORBA Properties"> 89 * <TR><TH>Property Name</TH> <TH>Property Value</TH></TR> 90 * <CAPTION>Standard Java CORBA Properties:</CAPTION> 91 * <TR><TD>org.omg.CORBA.ORBClass</TD> 92 * <TD>class name of an ORB implementation</TD></TR> 93 * <TR><TD>org.omg.CORBA.ORBSingletonClass</TD> 94 * <TD>class name of the ORB returned by {@code init()}</TD></TR> 95 * </TABLE> 96 * <P> 97 * These properties allow a different vendor's {@code ORB} 98 * implementation to be "plugged in." 99 * <P> 100 * When an ORB instance is being created, the class name of the ORB 101 * implementation is located using 102 * the following standard search order: 103 * 104 * <OL> 105 * <LI>check in Applet parameter or application string array, if any 106 * 107 * <LI>check in properties parameter, if any 108 * 109 * <LI>check in the System properties 110 * 111 * <LI>check in the orb.properties file located in the user.home 112 * directory (if any) 113 * 114 * <LI>check in the orb.properties file located in the java.home/lib 115 * directory (if any) 116 * 117 * <LI>fall back on a hardcoded default behavior (use the Java IDL 118 * implementation) 119 * </OL> 120 * <P> 121 * Note that Java IDL provides a default implementation for the 122 * fully-functional ORB and for the Singleton ORB. When the method 123 * {@code init} is given no parameters, the default Singleton 124 * ORB is returned. When the method {@code init} is given parameters 125 * but no ORB class is specified, the Java IDL ORB implementation 126 * is returned. 127 * <P> 128 * The following code fragment creates an {@code ORB} object 129 * initialized with the default ORB Singleton. 130 * This ORB has a 131 * restricted implementation to prevent malicious applets from doing 132 * anything beyond creating typecodes. 133 * It is called a singleton 134 * because there is only one instance for an entire virtual machine. 135 * <PRE> 136 * ORB orb = ORB.init(); 137 * </PRE> 138 * <P> 139 * The following code fragment creates an {@code ORB} object 140 * for an application. The parameter {@code args} 141 * represents the arguments supplied to the application's {@code main} 142 * method. Since the property specifies the ORB class to be 143 * "SomeORBImplementation", the new ORB will be initialized with 144 * that ORB implementation. If p had been null, 145 * and the arguments had not specified an ORB class, 146 * the new ORB would have been 147 * initialized with the default Java IDL implementation. 148 * <PRE> 149 * Properties p = new Properties(); 150 * p.put("org.omg.CORBA.ORBClass", "SomeORBImplementation"); 151 * ORB orb = ORB.init(args, p); 152 * </PRE> 153 * <P> 154 * The following code fragment creates an {@code ORB} object 155 * for the applet supplied as the first parameter. If the given 156 * applet does not specify an ORB class, the new ORB will be 157 * initialized with the default Java IDL implementation. 158 * <PRE> 159 * ORB orb = ORB.init(myApplet, null); 160 * </PRE> 161 * <P> 162 * An application or applet can be initialized in one or more ORBs. 163 * ORB initialization is a bootstrap call into the CORBA world. 164 * 165 * 166 * @implNote 167 * When a singleton ORB is configured via the system property, 168 * or orb.properties, it will be 169 * located, and loaded via the system class loader. 170 * Thus, where appropriate, it is necessary that 171 * the classes for this alternative ORBSingleton are available on the application's class path. 172 * It should be noted that the singleton ORB is system wide. 173 * 174 * When a per-application ORB is created via the 2-arg init methods, 175 * then it will be located using the thread context class loader. 176 * 177 * The IDL to Java Language OMG specification documents the ${java.home}/lib directory as the location, 178 * in the Java run-time image, to search for orb.properties. 179 * This location is not intended for user editable configuration files. 180 * Therefore, the implementation first checks the ${java.home}/conf directory for orb.properties, 181 * and thereafter the ${java.home}/lib directory. 182 * 183 * @since JDK1.2 184 */ 185 abstract public class ORB { 186 187 // 188 // This is the ORB implementation used when nothing else is specified. 189 // Whoever provides this class customizes this string to 190 // point at their ORB implementation. 191 // 192 private static final String ORBClassKey = "org.omg.CORBA.ORBClass"; 193 private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass"; 194 195 // check that access to the class is not restricted by the security manager. 196 private static void checkPackageAccess(String name) { 197 SecurityManager s = System.getSecurityManager(); 198 if (s != null) { 199 String cname = name.replace('/', '.'); 200 if (cname.startsWith("[")) { 201 int b = cname.lastIndexOf('[') + 2; 202 if (b > 1 && b < cname.length()) { 203 cname = cname.substring(b); 204 } 205 } 206 int i = cname.lastIndexOf('.'); 207 if (i != -1) { 208 s.checkPackageAccess(cname.substring(0, i)); 209 } 210 } 211 } 212 213 // 214 // The global instance of the singleton ORB implementation which 215 // acts as a factory for typecodes for generated Helper classes. 216 // TypeCodes should be immutable since they may be shared across 217 // different security contexts (applets). There should be no way to 218 // use a TypeCode as a storage depot for illicitly passing 219 // information or Java objects between different security contexts. 220 // 221 static private ORB singleton; 222 223 // Get System property 224 private static String getSystemProperty(final String name) { 225 226 // This will not throw a SecurityException because this 227 // class was loaded from rt.jar using the bootstrap classloader. 228 String propValue = (String) AccessController.doPrivileged( 229 new PrivilegedAction() { 230 public java.lang.Object run() { 231 return System.getProperty(name); 232 } 233 } 234 ); 235 236 return propValue; 237 } 238 239 // Get property from orb.properties in either <user.home> or <java-home>/lib 240 // directories. 241 private static String getPropertyFromFile(final String name) { 242 // This will not throw a SecurityException because this 243 // class was loaded from rt.jar using the bootstrap classloader. 244 245 String propValue = (String) AccessController.doPrivileged( 246 new PrivilegedAction() { 247 private Properties getFileProperties( String fileName ) { 248 try { 249 File propFile = new File( fileName ) ; 250 if (!propFile.exists()) 251 return null ; 252 253 Properties props = new Properties() ; 254 FileInputStream fis = new FileInputStream(propFile); 255 try { 256 props.load( fis ); 257 } finally { 258 fis.close() ; 259 } 260 261 return props ; 262 } catch (Exception exc) { 263 return null ; 264 } 265 } 266 267 public java.lang.Object run() { 268 String userHome = System.getProperty("user.home"); 269 String fileName = userHome + File.separator + 270 "orb.properties" ; 271 Properties props = getFileProperties( fileName ) ; 272 273 if (props != null) { 274 String value = props.getProperty( name ) ; 275 if (value != null) 276 return value ; 277 } 278 279 String javaHome = System.getProperty("java.home"); 280 281 fileName = javaHome + File.separator + "conf" 282 + File.separator + "orb.properties"; 283 props = getFileProperties(fileName); 284 285 if (props != null) { 286 String value = props.getProperty(name); 287 if (value != null) 288 return value; 289 } 290 291 fileName = javaHome + File.separator + "lib" 292 + File.separator + "orb.properties"; 293 props = getFileProperties(fileName); 294 295 if (props == null) 296 return null; 297 else 298 return props.getProperty(name); 299 } 300 } 301 ); 302 303 return propValue; 304 } 305 306 /** 307 * Returns the {@code ORB} singleton object. This method always returns the 308 * same ORB instance, which is an instance of the class described by the 309 * {@code org.omg.CORBA.ORBSingletonClass} system property. 310 * <P> 311 * This no-argument version of the method {@code init} is used primarily 312 * as a factory for {@code TypeCode} objects, which are used by 313 * {@code Helper} classes to implement the method {@code type}. 314 * It is also used to create {@code Any} objects that are used to 315 * describe {@code union} labels (as part of creating a 316 * {@code TypeCode} object for a {@code union}). 317 * <P> 318 * This method is not intended to be used by applets, and in the event 319 * that it is called in an applet environment, the ORB it returns 320 * is restricted so that it can be used only as a factory for 321 * {@code TypeCode} objects. Any {@code TypeCode} objects 322 * it produces can be safely shared among untrusted applets. 323 * <P> 324 * If an ORB is created using this method from an applet, 325 * a system exception will be thrown if 326 * methods other than those for 327 * creating {@code TypeCode} objects are invoked. 328 * 329 * @return the singleton ORB 330 * 331 * @implNote 332 * When configured via the system property, or orb.properties, 333 * the system-wide singleton ORB is located via the 334 * system class loader. 335 */ 336 public static synchronized ORB init() { 337 if (singleton == null) { 338 String className = getSystemProperty(ORBSingletonClassKey); 339 if (className == null) 340 className = getPropertyFromFile(ORBSingletonClassKey); 341 if ((className == null) || 342 (className.equals("com.sun.corba.se.impl.orb.ORBSingleton"))) { 343 singleton = new com.sun.corba.se.impl.orb.ORBSingleton(); 344 } else { 345 singleton = create_impl_with_systemclassloader(className); 346 } 347 } 348 return singleton; 349 } 350 351 private static ORB create_impl_with_systemclassloader(String className) { 352 353 try { 354 checkPackageAccess(className); 355 ClassLoader cl = ClassLoader.getSystemClassLoader(); 356 Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class; 357 Class<?> singletonOrbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass); 358 return (ORB)singletonOrbClass.newInstance(); 359 } catch (Throwable ex) { 360 SystemException systemException = new INITIALIZE( 361 "can't instantiate default ORB implementation " + className); 362 systemException.initCause(ex); 363 throw systemException; 364 } 365 } 366 367 private static ORB create_impl(String className) { 368 ClassLoader cl = Thread.currentThread().getContextClassLoader(); 369 if (cl == null) 370 cl = ClassLoader.getSystemClassLoader(); 371 372 try { 373 checkPackageAccess(className); 374 Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class; 375 Class<?> orbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass); 376 return (ORB)orbClass.newInstance(); 377 } catch (Throwable ex) { 378 SystemException systemException = new INITIALIZE( 379 "can't instantiate default ORB implementation " + className); 380 systemException.initCause(ex); 381 throw systemException; 382 } 383 } 384 385 /** 386 * Creates a new {@code ORB} instance for a standalone 387 * application. This method may be called from applications 388 * only and returns a new fully functional {@code ORB} object 389 * each time it is called. 390 * @param args command-line arguments for the application's {@code main} 391 * method; may be {@code null} 392 * @param props application-specific properties; may be {@code null} 393 * @return the newly-created ORB instance 394 * 395 * @implNote 396 * When configured via the system property, or orb.properties, 397 * the ORB is located via the thread context class loader. 398 */ 399 public static ORB init(String[] args, Properties props) { 400 // 401 // Note that there is no standard command-line argument for 402 // specifying the default ORB implementation. For an 403 // application you can choose an implementation either by 404 // setting the CLASSPATH to pick a different org.omg.CORBA 405 // and it's baked-in ORB implementation default or by 406 // setting an entry in the properties object or in the 407 // system properties. 408 // 409 String className = null; 410 ORB orb; 411 412 if (props != null) 413 className = props.getProperty(ORBClassKey); 414 if (className == null) 415 className = getSystemProperty(ORBClassKey); 416 if (className == null) 417 className = getPropertyFromFile(ORBClassKey); 418 if ((className == null) || 419 (className.equals("com.sun.corba.se.impl.orb.ORBImpl"))) { 420 orb = new com.sun.corba.se.impl.orb.ORBImpl(); 421 } else { 422 orb = create_impl(className); 423 } 424 orb.set_parameters(args, props); 425 return orb; 426 } 427 428 429 /** 430 * Creates a new {@code ORB} instance for an applet. This 431 * method may be called from applets only and returns a new 432 * fully-functional {@code ORB} object each time it is called. 433 * @param app the applet; may be {@code null} 434 * @param props applet-specific properties; may be {@code null} 435 * @return the newly-created ORB instance 436 * 437 * @implNote 438 * When configured via the system property, or orb.properties, 439 * the ORB is located via the thread context class loader. 440 */ 441 public static ORB init(Applet app, Properties props) { 442 String className; 443 ORB orb; 444 445 className = app.getParameter(ORBClassKey); 446 if (className == null && props != null) 447 className = props.getProperty(ORBClassKey); 448 if (className == null) 449 className = getSystemProperty(ORBClassKey); 450 if (className == null) 451 className = getPropertyFromFile(ORBClassKey); 452 if ((className == null) || 453 (className.equals("com.sun.corba.se.impl.orb.ORBImpl"))) { 454 orb = new com.sun.corba.se.impl.orb.ORBImpl(); 455 } else { 456 orb = create_impl(className); 457 } 458 orb.set_parameters(app, props); 459 return orb; 460 } 461 462 /** 463 * Allows the ORB implementation to be initialized with the given 464 * parameters and properties. This method, used in applications only, 465 * is implemented by subclass ORB implementations and called 466 * by the appropriate {@code init} method to pass in its parameters. 467 * 468 * @param args command-line arguments for the application's {@code main} 469 * method; may be {@code null} 470 * @param props application-specific properties; may be {@code null} 471 */ 472 abstract protected void set_parameters(String[] args, Properties props); 473 474 /** 475 * Allows the ORB implementation to be initialized with the given 476 * applet and parameters. This method, used in applets only, 477 * is implemented by subclass ORB implementations and called 478 * by the appropriate {@code init} method to pass in its parameters. 479 * 480 * @param app the applet; may be {@code null} 481 * @param props applet-specific properties; may be {@code null} 482 */ 483 abstract protected void set_parameters(Applet app, Properties props); 484 485 /** 486 * Connects the given servant object (a Java object that is 487 * an instance of the server implementation class) 488 * to the ORB. The servant class must 489 * extend the {@code ImplBase} class corresponding to the interface that is 490 * supported by the server. The servant must thus be a CORBA object 491 * reference, and inherit from {@code org.omg.CORBA.Object}. 492 * Servants created by the user can start receiving remote invocations 493 * after the method {@code connect} has been called. A servant may also be 494 * automatically and implicitly connected to the ORB if it is passed as 495 * an IDL parameter in an IDL method invocation on a non-local object, 496 * that is, if the servant object has to be marshalled and sent outside of the 497 * process address space. 498 * <P> 499 * Calling the method {@code connect} has no effect 500 * when the servant object is already connected to the ORB. 501 * <P> 502 * Deprecated by the OMG in favor of the Portable Object Adapter APIs. 503 * 504 * @param obj The servant object reference 505 */ 506 public void connect(org.omg.CORBA.Object obj) { 507 throw new NO_IMPLEMENT(); 508 } 509 510 /** 511 * Destroys the ORB so that its resources can be reclaimed. 512 * Any operation invoked on a destroyed ORB reference will throw the 513 * {@code OBJECT_NOT_EXIST} exception. 514 * Once an ORB has been destroyed, another call to {@code init} 515 * with the same ORBid will return a reference to a newly constructed ORB.<p> 516 * If {@code destroy} is called on an ORB that has not been shut down, 517 * it will start the shut down process and block until the ORB has shut down 518 * before it destroys the ORB.<br> 519 * If an application calls {@code destroy} in a thread that is currently servicing 520 * an invocation, the {@code BAD_INV_ORDER} system exception will be thrown 521 * with the OMG minor code 3, since blocking would result in a deadlock.<p> 522 * For maximum portability and to avoid resource leaks, an application should 523 * always call {@code shutdown} and {@code destroy} 524 * on all ORB instances before exiting. 525 * 526 * @throws org.omg.CORBA.BAD_INV_ORDER if the current thread is servicing an invocation 527 */ 528 public void destroy( ) { 529 throw new NO_IMPLEMENT(); 530 } 531 532 /** 533 * Disconnects the given servant object from the ORB. After this method returns, 534 * the ORB will reject incoming remote requests for the disconnected 535 * servant and will send the exception 536 * {@code org.omg.CORBA.OBJECT_NOT_EXIST} back to the 537 * remote client. Thus the object appears to be destroyed from the 538 * point of view of remote clients. Note, however, that local requests issued 539 * using the servant directly do not 540 * pass through the ORB; hence, they will continue to be processed by the 541 * servant. 542 * <P> 543 * Calling the method {@code disconnect} has no effect 544 * if the servant is not connected to the ORB. 545 * <P> 546 * Deprecated by the OMG in favor of the Portable Object Adapter APIs. 547 * 548 * @param obj The servant object to be disconnected from the ORB 549 */ 550 public void disconnect(org.omg.CORBA.Object obj) { 551 throw new NO_IMPLEMENT(); 552 } 553 554 // 555 // ORB method implementations. 556 // 557 // We are trying to accomplish 2 things at once in this class. 558 // It can act as a default ORB implementation front-end, 559 // creating an actual ORB implementation object which is a 560 // subclass of this ORB class and then delegating the method 561 // implementations. 562 // 563 // To accomplish the delegation model, the 'delegate' private instance 564 // variable is set if an instance of this class is created directly. 565 // 566 567 /** 568 * Returns a list of the initially available CORBA object references, 569 * such as "NameService" and "InterfaceRepository". 570 * 571 * @return an array of {@code String} objects that represent 572 * the object references for CORBA services 573 * that are initially available with this ORB 574 */ 575 abstract public String[] list_initial_services(); 576 577 /** 578 * Resolves a specific object reference from the set of available 579 * initial service names. 580 * 581 * @param object_name the name of the initial service as a string 582 * @return the object reference associated with the given name 583 * @exception InvalidName if the given name is not associated with a 584 * known service 585 */ 586 abstract public org.omg.CORBA.Object resolve_initial_references(String object_name) 587 throws InvalidName; 588 589 /** 590 * Converts the given CORBA object reference to a string. 591 * Note that the format of this string is predefined by IIOP, allowing 592 * strings generated by a different ORB to be converted back into an object 593 * reference. 594 * <P> 595 * The resulting {@code String} object may be stored or communicated 596 * in any way that a {@code String} object can be manipulated. 597 * 598 * @param obj the object reference to stringify 599 * @return the string representing the object reference 600 */ 601 abstract public String object_to_string(org.omg.CORBA.Object obj); 602 603 /** 604 * Converts a string produced by the method {@code object_to_string} 605 * back to a CORBA object reference. 606 * 607 * @param str the string to be converted back to an object reference. It must 608 * be the result of converting an object reference to a string using the 609 * method {@code object_to_string}. 610 * @return the object reference 611 */ 612 abstract public org.omg.CORBA.Object string_to_object(String str); 613 614 /** 615 * Allocates an {@code NVList} with (probably) enough 616 * space for the specified number of {@code NamedValue} objects. 617 * Note that the specified size is only a hint to help with 618 * storage allocation and does not imply the maximum size of the list. 619 * 620 * @param count suggested number of {@code NamedValue} objects for 621 * which to allocate space 622 * @return the newly-created {@code NVList} 623 * 624 * @see NVList 625 */ 626 abstract public NVList create_list(int count); 627 628 /** 629 * Creates an {@code NVList} initialized with argument 630 * descriptions for the operation described in the given 631 * {@code OperationDef} object. This {@code OperationDef} object 632 * is obtained from an Interface Repository. The arguments in the 633 * returned {@code NVList} object are in the same order as in the 634 * original IDL operation definition, which makes it possible for the list 635 * to be used in dynamic invocation requests. 636 * 637 * @param oper the {@code OperationDef} object to use to create the list 638 * @return a newly-created {@code NVList} object containing 639 * descriptions of the arguments to the method described in the given 640 * {@code OperationDef} object 641 * 642 * @see NVList 643 */ 644 public NVList create_operation_list(org.omg.CORBA.Object oper) 645 { 646 // If we came here, it means that the actual ORB implementation 647 // did not have a create_operation_list(...CORBA.Object oper) method, 648 // so lets check if it has a create_operation_list(OperationDef oper) 649 // method. 650 try { 651 // First try to load the OperationDef class 652 String opDefClassName = "org.omg.CORBA.OperationDef"; 653 Class<?> opDefClass = null; 654 655 ClassLoader cl = Thread.currentThread().getContextClassLoader(); 656 if ( cl == null ) 657 cl = ClassLoader.getSystemClassLoader(); 658 // if this throws a ClassNotFoundException, it will be caught below. 659 opDefClass = Class.forName(opDefClassName, true, cl); 660 661 // OK, we loaded OperationDef. Now try to get the 662 // create_operation_list(OperationDef oper) method. 663 Class<?>[] argc = { opDefClass }; 664 java.lang.reflect.Method meth = 665 this.getClass().getMethod("create_operation_list", argc); 666 667 // OK, the method exists, so invoke it and be happy. 668 java.lang.Object[] argx = { oper }; 669 return (org.omg.CORBA.NVList)meth.invoke(this, argx); 670 } 671 catch( java.lang.reflect.InvocationTargetException exs ) { 672 Throwable t = exs.getTargetException(); 673 if (t instanceof Error) { 674 throw (Error) t; 675 } 676 else if (t instanceof RuntimeException) { 677 throw (RuntimeException) t; 678 } 679 else { 680 throw new org.omg.CORBA.NO_IMPLEMENT(); 681 } 682 } 683 catch( RuntimeException ex ) { 684 throw ex; 685 } 686 catch( Exception exr ) { 687 throw new org.omg.CORBA.NO_IMPLEMENT(); 688 } 689 } 690 691 692 /** 693 * Creates a {@code NamedValue} object 694 * using the given name, value, and argument mode flags. 695 * <P> 696 * A {@code NamedValue} object serves as (1) a parameter or return 697 * value or (2) a context property. 698 * It may be used by itself or 699 * as an element in an {@code NVList} object. 700 * 701 * @param s the name of the {@code NamedValue} object 702 * @param any the {@code Any} value to be inserted into the 703 * {@code NamedValue} object 704 * @param flags the argument mode flags for the {@code NamedValue}: one of 705 * {@code ARG_IN.value}, {@code ARG_OUT.value}, 706 * or {@code ARG_INOUT.value}. 707 * 708 * @return the newly-created {@code NamedValue} object 709 * @see NamedValue 710 */ 711 abstract public NamedValue create_named_value(String s, Any any, int flags); 712 713 /** 714 * Creates an empty {@code ExceptionList} object. 715 * 716 * @return the newly-created {@code ExceptionList} object 717 */ 718 abstract public ExceptionList create_exception_list(); 719 720 /** 721 * Creates an empty {@code ContextList} object. 722 * 723 * @return the newly-created {@code ContextList} object 724 * @see ContextList 725 * @see Context 726 */ 727 abstract public ContextList create_context_list(); 728 729 /** 730 * Gets the default {@code Context} object. 731 * 732 * @return the default {@code Context} object 733 * @see Context 734 */ 735 abstract public Context get_default_context(); 736 737 /** 738 * Creates an {@code Environment} object. 739 * 740 * @return the newly-created {@code Environment} object 741 * @see Environment 742 */ 743 abstract public Environment create_environment(); 744 745 /** 746 * Creates a new {@code org.omg.CORBA.portable.OutputStream} into which 747 * IDL method parameters can be marshalled during method invocation. 748 * @return the newly-created 749 * {@code org.omg.CORBA.portable.OutputStream} object 750 */ 751 abstract public org.omg.CORBA.portable.OutputStream create_output_stream(); 752 753 /** 754 * Sends multiple dynamic (DII) requests asynchronously without expecting 755 * any responses. Note that oneway invocations are not guaranteed to 756 * reach the server. 757 * 758 * @param req an array of request objects 759 */ 760 abstract public void send_multiple_requests_oneway(Request[] req); 761 762 /** 763 * Sends multiple dynamic (DII) requests asynchronously. 764 * 765 * @param req an array of {@code Request} objects 766 */ 767 abstract public void send_multiple_requests_deferred(Request[] req); 768 769 /** 770 * Finds out if any of the deferred (asynchronous) invocations have 771 * a response yet. 772 * @return {@code true} if there is a response available; 773 * {@code false} otherwise 774 */ 775 abstract public boolean poll_next_response(); 776 777 /** 778 * Gets the next {@code Request} instance for which a response 779 * has been received. 780 * 781 * @return the next {@code Request} object ready with a response 782 * @exception WrongTransaction if the method {@code get_next_response} 783 * is called from a transaction scope different 784 * from the one from which the original request was sent. See the 785 * OMG Transaction Service specification for details. 786 */ 787 abstract public Request get_next_response() throws WrongTransaction; 788 789 /** 790 * Retrieves the {@code TypeCode} object that represents 791 * the given primitive IDL type. 792 * 793 * @param tcKind the {@code TCKind} instance corresponding to the 794 * desired primitive type 795 * @return the requested {@code TypeCode} object 796 */ 797 abstract public TypeCode get_primitive_tc(TCKind tcKind); 798 799 /** 800 * Creates a {@code TypeCode} object representing an IDL {@code struct}. 801 * The {@code TypeCode} object is initialized with the given id, 802 * name, and members. 803 * 804 * @param id the repository id for the {@code struct} 805 * @param name the name of the {@code struct} 806 * @param members an array describing the members of the {@code struct} 807 * @return a newly-created {@code TypeCode} object describing 808 * an IDL {@code struct} 809 */ 810 abstract public TypeCode create_struct_tc(String id, String name, 811 StructMember[] members); 812 813 /** 814 * Creates a {@code TypeCode} object representing an IDL {@code union}. 815 * The {@code TypeCode} object is initialized with the given id, 816 * name, discriminator type, and members. 817 * 818 * @param id the repository id of the {@code union} 819 * @param name the name of the {@code union} 820 * @param discriminator_type the type of the {@code union} discriminator 821 * @param members an array describing the members of the {@code union} 822 * @return a newly-created {@code TypeCode} object describing 823 * an IDL {@code union} 824 */ 825 abstract public TypeCode create_union_tc(String id, String name, 826 TypeCode discriminator_type, 827 UnionMember[] members); 828 829 /** 830 * Creates a {@code TypeCode} object representing an IDL {@code enum}. 831 * The {@code TypeCode} object is initialized with the given id, 832 * name, and members. 833 * 834 * @param id the repository id for the {@code enum} 835 * @param name the name for the {@code enum} 836 * @param members an array describing the members of the {@code enum} 837 * @return a newly-created {@code TypeCode} object describing 838 * an IDL {@code enum} 839 */ 840 abstract public TypeCode create_enum_tc(String id, String name, String[] members); 841 842 /** 843 * Creates a {@code TypeCode} object representing an IDL {@code alias} 844 * ({@code typedef}). 845 * The {@code TypeCode} object is initialized with the given id, 846 * name, and original type. 847 * 848 * @param id the repository id for the alias 849 * @param name the name for the alias 850 * @param original_type 851 * the {@code TypeCode} object describing the original type 852 * for which this is an alias 853 * @return a newly-created {@code TypeCode} object describing 854 * an IDL {@code alias} 855 */ 856 abstract public TypeCode create_alias_tc(String id, String name, 857 TypeCode original_type); 858 859 /** 860 * Creates a {@code TypeCode} object representing an IDL {@code exception}. 861 * The {@code TypeCode} object is initialized with the given id, 862 * name, and members. 863 * 864 * @param id the repository id for the {@code exception} 865 * @param name the name for the {@code exception} 866 * @param members an array describing the members of the {@code exception} 867 * @return a newly-created {@code TypeCode} object describing 868 * an IDL {@code exception} 869 */ 870 abstract public TypeCode create_exception_tc(String id, String name, 871 StructMember[] members); 872 873 /** 874 * Creates a {@code TypeCode} object representing an IDL {@code interface}. 875 * The {@code TypeCode} object is initialized with the given id 876 * and name. 877 * 878 * @param id the repository id for the interface 879 * @param name the name for the interface 880 * @return a newly-created {@code TypeCode} object describing 881 * an IDL {@code interface} 882 */ 883 884 abstract public TypeCode create_interface_tc(String id, String name); 885 886 /** 887 * Creates a {@code TypeCode} object representing a bounded IDL 888 * {@code string}. 889 * The {@code TypeCode} object is initialized with the given bound, 890 * which represents the maximum length of the string. Zero indicates 891 * that the string described by this type code is unbounded. 892 * 893 * @param bound the bound for the {@code string}; cannot be negative 894 * @return a newly-created {@code TypeCode} object describing 895 * a bounded IDL {@code string} 896 * @exception BAD_PARAM if bound is a negative value 897 */ 898 899 abstract public TypeCode create_string_tc(int bound); 900 901 /** 902 * Creates a {@code TypeCode} object representing a bounded IDL 903 * {@code wstring} (wide string). 904 * The {@code TypeCode} object is initialized with the given bound, 905 * which represents the maximum length of the wide string. Zero indicates 906 * that the string described by this type code is unbounded. 907 * 908 * @param bound the bound for the {@code wstring}; cannot be negative 909 * @return a newly-created {@code TypeCode} object describing 910 * a bounded IDL {@code wstring} 911 * @exception BAD_PARAM if bound is a negative value 912 */ 913 abstract public TypeCode create_wstring_tc(int bound); 914 915 /** 916 * Creates a {@code TypeCode} object representing an IDL {@code sequence}. 917 * The {@code TypeCode} object is initialized with the given bound and 918 * element type. 919 * 920 * @param bound the bound for the {@code sequence}, 0 if unbounded 921 * @param element_type the {@code TypeCode} object describing 922 * the elements contained in the {@code sequence} 923 * 924 * @return a newly-created {@code TypeCode} object describing 925 * an IDL {@code sequence} 926 */ 927 abstract public TypeCode create_sequence_tc(int bound, TypeCode element_type); 928 929 /** 930 * Creates a {@code TypeCode} object representing a 931 * a recursive IDL {@code sequence}. 932 * <P> 933 * For the IDL {@code struct} Node in following code fragment, 934 * the offset parameter for creating its sequence would be 1: 935 * <PRE> 936 * Struct Node { 937 * long value; 938 * Sequence <Node> subnodes; 939 * }; 940 * </PRE> 941 * 942 * @param bound the bound for the sequence, 0 if unbounded 943 * @param offset the index to the enclosing {@code TypeCode} object 944 * that describes the elements of this sequence 945 * @return a newly-created {@code TypeCode} object describing 946 * a recursive sequence 947 * @deprecated Use a combination of create_recursive_tc and create_sequence_tc instead 948 * @see #create_recursive_tc(String) create_recursive_tc 949 * @see #create_sequence_tc(int, TypeCode) create_sequence_tc 950 */ 951 @Deprecated 952 abstract public TypeCode create_recursive_sequence_tc(int bound, int offset); 953 954 /** 955 * Creates a {@code TypeCode} object representing an IDL {@code array}. 956 * The {@code TypeCode} object is initialized with the given length and 957 * element type. 958 * 959 * @param length the length of the {@code array} 960 * @param element_type a {@code TypeCode} object describing the type 961 * of element contained in the {@code array} 962 * @return a newly-created {@code TypeCode} object describing 963 * an IDL {@code array} 964 */ 965 abstract public TypeCode create_array_tc(int length, TypeCode element_type); 966 967 /** 968 * Create a {@code TypeCode} object for an IDL native type. 969 * 970 * @param id the logical id for the native type. 971 * @param name the name of the native type. 972 * @return the requested TypeCode. 973 */ 974 public org.omg.CORBA.TypeCode create_native_tc(String id, 975 String name) 976 { 977 throw new org.omg.CORBA.NO_IMPLEMENT(); 978 } 979 980 /** 981 * Create a {@code TypeCode} object for an IDL abstract interface. 982 * 983 * @param id the logical id for the abstract interface type. 984 * @param name the name of the abstract interface type. 985 * @return the requested TypeCode. 986 */ 987 public org.omg.CORBA.TypeCode create_abstract_interface_tc( 988 String id, 989 String name) 990 { 991 throw new org.omg.CORBA.NO_IMPLEMENT(); 992 } 993 994 995 /** 996 * Create a {@code TypeCode} object for an IDL fixed type. 997 * 998 * @param digits specifies the total number of decimal digits in the number 999 * and must be from 1 to 31 inclusive. 1000 * @param scale specifies the position of the decimal point. 1001 * @return the requested TypeCode. 1002 */ 1003 public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) 1004 { 1005 throw new org.omg.CORBA.NO_IMPLEMENT(); 1006 } 1007 1008 1009 // orbos 98-01-18: Objects By Value -- begin 1010 1011 1012 /** 1013 * Create a {@code TypeCode} object for an IDL value type. 1014 * The concrete_base parameter is the TypeCode for the immediate 1015 * concrete valuetype base of the valuetype for which the TypeCode 1016 * is being created. 1017 * It may be null if the valuetype does not have a concrete base. 1018 * 1019 * @param id the logical id for the value type. 1020 * @param name the name of the value type. 1021 * @param type_modifier one of the value type modifier constants: 1022 * VM_NONE, VM_CUSTOM, VM_ABSTRACT or VM_TRUNCATABLE 1023 * @param concrete_base a {@code TypeCode} object 1024 * describing the concrete valuetype base 1025 * @param members an array containing the members of the value type 1026 * @return the requested TypeCode 1027 */ 1028 public org.omg.CORBA.TypeCode create_value_tc(String id, 1029 String name, 1030 short type_modifier, 1031 TypeCode concrete_base, 1032 ValueMember[] members) 1033 { 1034 throw new org.omg.CORBA.NO_IMPLEMENT(); 1035 } 1036 1037 /** 1038 * Create a recursive {@code TypeCode} object which 1039 * serves as a placeholder for a concrete TypeCode during the process of creating 1040 * TypeCodes which contain recursion. The id parameter specifies the repository id of 1041 * the type for which the recursive TypeCode is serving as a placeholder. Once the 1042 * recursive TypeCode has been properly embedded in the enclosing TypeCode which 1043 * corresponds to the specified repository id, it will function as a normal TypeCode. 1044 * Invoking operations on the recursive TypeCode before it has been embedded in the 1045 * enclosing TypeCode will result in a {@code BAD_TYPECODE} exception. 1046 * <P> 1047 * For example, the following IDL type declaration contains recursion: 1048 * <PRE> 1049 * Struct Node { 1050 * Sequence<Node> subnodes; 1051 * }; 1052 * </PRE> 1053 * <P> 1054 * To create a TypeCode for struct Node, you would invoke the TypeCode creation 1055 * operations as shown below: 1056 * <PRE> 1057 * String nodeID = "IDL:Node:1.0"; 1058 * TypeCode recursiveSeqTC = orb.create_sequence_tc(0, orb.create_recursive_tc(nodeID)); 1059 * StructMember[] members = { new StructMember("subnodes", recursiveSeqTC, null) }; 1060 * TypeCode structNodeTC = orb.create_struct_tc(nodeID, "Node", members); 1061 * </PRE> 1062 * <P> 1063 * Also note that the following is an illegal IDL type declaration: 1064 * <PRE> 1065 * Struct Node { 1066 * Node next; 1067 * }; 1068 * </PRE> 1069 * <P> 1070 * Recursive types can only appear within sequences which can be empty. 1071 * That way marshaling problems, when transmitting the struct in an Any, are avoided. 1072 * 1073 * @param id the logical id of the referenced type 1074 * @return the requested TypeCode 1075 */ 1076 public org.omg.CORBA.TypeCode create_recursive_tc(String id) { 1077 // implemented in subclass 1078 throw new org.omg.CORBA.NO_IMPLEMENT(); 1079 } 1080 1081 /** 1082 * Creates a {@code TypeCode} object for an IDL value box. 1083 * 1084 * @param id the logical id for the value type 1085 * @param name the name of the value type 1086 * @param boxed_type the TypeCode for the type 1087 * @return the requested TypeCode 1088 */ 1089 public org.omg.CORBA.TypeCode create_value_box_tc(String id, 1090 String name, 1091 TypeCode boxed_type) 1092 { 1093 // implemented in subclass 1094 throw new org.omg.CORBA.NO_IMPLEMENT(); 1095 } 1096 1097 // orbos 98-01-18: Objects By Value -- end 1098 1099 /** 1100 * Creates an IDL {@code Any} object initialized to 1101 * contain a {@code Typecode} object whose {@code kind} field 1102 * is set to {@code TCKind.tc_null}. 1103 * 1104 * @return a newly-created {@code Any} object 1105 */ 1106 abstract public Any create_any(); 1107 1108 1109 1110 1111 /** 1112 * Retrieves a {@code Current} object. 1113 * The {@code Current} interface is used to manage thread-specific 1114 * information for use by services such as transactions and security. 1115 * 1116 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1117 * comments for unimplemented features</a> 1118 * 1119 * @return a newly-created {@code Current} object 1120 * @deprecated use {@code resolve_initial_references}. 1121 */ 1122 @Deprecated 1123 public org.omg.CORBA.Current get_current() 1124 { 1125 throw new org.omg.CORBA.NO_IMPLEMENT(); 1126 } 1127 1128 /** 1129 * This operation blocks the current thread until the ORB has 1130 * completed the shutdown process, initiated when some thread calls 1131 * {@code shutdown}. It may be used by multiple threads which 1132 * get all notified when the ORB shuts down. 1133 * 1134 */ 1135 public void run() 1136 { 1137 throw new org.omg.CORBA.NO_IMPLEMENT(); 1138 } 1139 1140 /** 1141 * Instructs the ORB to shut down, which causes all 1142 * object adapters to shut down, in preparation for destruction.<br> 1143 * If the {@code wait_for_completion} parameter 1144 * is true, this operation blocks until all ORB processing (including 1145 * processing of currently executing requests, object deactivation, 1146 * and other object adapter operations) has completed. 1147 * If an application does this in a thread that is currently servicing 1148 * an invocation, the {@code BAD_INV_ORDER} system exception 1149 * will be thrown with the OMG minor code 3, 1150 * since blocking would result in a deadlock.<br> 1151 * If the {@code wait_for_completion} parameter is {@code FALSE}, 1152 * then shutdown may not have completed upon return.<p> 1153 * While the ORB is in the process of shutting down, the ORB operates as normal, 1154 * servicing incoming and outgoing requests until all requests have been completed. 1155 * Once an ORB has shutdown, only object reference management operations 1156 * may be invoked on the ORB or any object reference obtained from it. 1157 * An application may also invoke the {@code destroy} operation on the ORB itself. 1158 * Invoking any other operation will throw the {@code BAD_INV_ORDER} 1159 * system exception with the OMG minor code 4.<p> 1160 * The {@code ORB.run} method will return after 1161 * {@code shutdown} has been called. 1162 * 1163 * @param wait_for_completion {@code true} if the call 1164 * should block until the shutdown is complete; 1165 * {@code false} if it should return immediately 1166 * @throws org.omg.CORBA.BAD_INV_ORDER if the current thread is servicing 1167 * an invocation 1168 */ 1169 public void shutdown(boolean wait_for_completion) 1170 { 1171 throw new org.omg.CORBA.NO_IMPLEMENT(); 1172 } 1173 1174 /** 1175 * Returns {@code true} if the ORB needs the main thread to 1176 * perform some work, and {@code false} if the ORB does not 1177 * need the main thread. 1178 * 1179 * @return {@code true} if there is work pending, meaning that the ORB 1180 * needs the main thread to perform some work; {@code false} 1181 * if there is no work pending and thus the ORB does not need the 1182 * main thread 1183 * 1184 */ 1185 public boolean work_pending() 1186 { 1187 throw new org.omg.CORBA.NO_IMPLEMENT(); 1188 } 1189 1190 /** 1191 * Performs an implementation-dependent unit of work if called 1192 * by the main thread. Otherwise it does nothing. 1193 * The methods {@code work_pending} and {@code perform_work} 1194 * can be used in 1195 * conjunction to implement a simple polling loop that multiplexes 1196 * the main thread among the ORB and other activities. 1197 * 1198 */ 1199 public void perform_work() 1200 { 1201 throw new org.omg.CORBA.NO_IMPLEMENT(); 1202 } 1203 1204 /** 1205 * Used to obtain information about CORBA facilities and services 1206 * that are supported by this ORB. The service type for which 1207 * information is being requested is passed in as the in 1208 * parameter {@code service_type}, the values defined by 1209 * constants in the CORBA module. If service information is 1210 * available for that type, that is returned in the out parameter 1211 * {@code service_info}, and the operation returns the 1212 * value {@code true}. If no information for the requested 1213 * services type is available, the operation returns {@code false} 1214 * (i.e., the service is not supported by this ORB). 1215 * 1216 * @param service_type a {@code short} indicating the 1217 * service type for which information is being requested 1218 * @param service_info a {@code ServiceInformationHolder} object 1219 * that will hold the {@code ServiceInformation} object 1220 * produced by this method 1221 * @return {@code true} if service information is available 1222 * for the {@code service_type}; 1223 * {@code false} if no information for the 1224 * requested services type is available 1225 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1226 * comments for unimplemented features</a> 1227 */ 1228 public boolean get_service_information(short service_type, 1229 ServiceInformationHolder service_info) 1230 { 1231 throw new org.omg.CORBA.NO_IMPLEMENT(); 1232 } 1233 1234 // orbos 98-01-18: Objects By Value -- begin 1235 1236 /** 1237 * Creates a new {@code DynAny} object from the given 1238 * {@code Any} object. 1239 * 1240 * @param value the {@code Any} object from which to create a new 1241 * {@code DynAny} object 1242 * @return the new {@code DynAny} object created from the given 1243 * {@code Any} object 1244 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1245 * comments for unimplemented features</a> 1246 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1247 */ 1248 @Deprecated 1249 public org.omg.CORBA.DynAny create_dyn_any(org.omg.CORBA.Any value) 1250 { 1251 throw new org.omg.CORBA.NO_IMPLEMENT(); 1252 } 1253 1254 /** 1255 * Creates a basic {@code DynAny} object from the given 1256 * {@code TypeCode} object. 1257 * 1258 * @param type the {@code TypeCode} object from which to create a new 1259 * {@code DynAny} object 1260 * @return the new {@code DynAny} object created from the given 1261 * {@code TypeCode} object 1262 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1263 * {@code TypeCode} object is not consistent with the operation. 1264 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1265 * comments for unimplemented features</a> 1266 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1267 */ 1268 @Deprecated 1269 public org.omg.CORBA.DynAny create_basic_dyn_any(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1270 { 1271 throw new org.omg.CORBA.NO_IMPLEMENT(); 1272 } 1273 1274 /** 1275 * Creates a new {@code DynStruct} object from the given 1276 * {@code TypeCode} object. 1277 * 1278 * @param type the {@code TypeCode} object from which to create a new 1279 * {@code DynStruct} object 1280 * @return the new {@code DynStruct} object created from the given 1281 * {@code TypeCode} object 1282 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1283 * {@code TypeCode} object is not consistent with the operation. 1284 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1285 * comments for unimplemented features</a> 1286 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1287 */ 1288 @Deprecated 1289 public org.omg.CORBA.DynStruct create_dyn_struct(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1290 { 1291 throw new org.omg.CORBA.NO_IMPLEMENT(); 1292 } 1293 1294 /** 1295 * Creates a new {@code DynSequence} object from the given 1296 * {@code TypeCode} object. 1297 * 1298 * @param type the {@code TypeCode} object from which to create a new 1299 * {@code DynSequence} object 1300 * @return the new {@code DynSequence} object created from the given 1301 * {@code TypeCode} object 1302 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1303 * {@code TypeCode} object is not consistent with the operation. 1304 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1305 * comments for unimplemented features</a> 1306 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1307 */ 1308 @Deprecated 1309 public org.omg.CORBA.DynSequence create_dyn_sequence(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1310 { 1311 throw new org.omg.CORBA.NO_IMPLEMENT(); 1312 } 1313 1314 1315 /** 1316 * Creates a new {@code DynArray} object from the given 1317 * {@code TypeCode} object. 1318 * 1319 * @param type the {@code TypeCode} object from which to create a new 1320 * {@code DynArray} object 1321 * @return the new {@code DynArray} object created from the given 1322 * {@code TypeCode} object 1323 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1324 * {@code TypeCode} object is not consistent with the operation. 1325 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1326 * comments for unimplemented features</a> 1327 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1328 */ 1329 @Deprecated 1330 public org.omg.CORBA.DynArray create_dyn_array(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1331 { 1332 throw new org.omg.CORBA.NO_IMPLEMENT(); 1333 } 1334 1335 /** 1336 * Creates a new {@code DynUnion} object from the given 1337 * {@code TypeCode} object. 1338 * 1339 * @param type the {@code TypeCode} object from which to create a new 1340 * {@code DynUnion} object 1341 * @return the new {@code DynUnion} object created from the given 1342 * {@code TypeCode} object 1343 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1344 * {@code TypeCode} object is not consistent with the operation. 1345 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1346 * comments for unimplemented features</a> 1347 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1348 */ 1349 @Deprecated 1350 public org.omg.CORBA.DynUnion create_dyn_union(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1351 { 1352 throw new org.omg.CORBA.NO_IMPLEMENT(); 1353 } 1354 1355 /** 1356 * Creates a new {@code DynEnum} object from the given 1357 * {@code TypeCode} object. 1358 * 1359 * @param type the {@code TypeCode} object from which to create a new 1360 * {@code DynEnum} object 1361 * @return the new {@code DynEnum} object created from the given 1362 * {@code TypeCode} object 1363 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1364 * {@code TypeCode} object is not consistent with the operation. 1365 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1366 * comments for unimplemented features</a> 1367 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1368 */ 1369 @Deprecated 1370 public org.omg.CORBA.DynEnum create_dyn_enum(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1371 { 1372 throw new org.omg.CORBA.NO_IMPLEMENT(); 1373 } 1374 1375 /** 1376 * Can be invoked to create new instances of policy objects 1377 * of a specific type with specified initial state. If 1378 * {@code create_policy} fails to instantiate a new Policy 1379 * object due to its inability to interpret the requested type 1380 * and content of the policy, it raises the {@code PolicyError} 1381 * exception with the appropriate reason. 1382 * @param type the {@code PolicyType} of the policy object to 1383 * be created 1384 * @param val the value that will be used to set the initial 1385 * state of the {@code Policy} object that is created 1386 * @return Reference to a newly created {@code Policy} object 1387 * of type specified by the {@code type} parameter and 1388 * initialized to a state specified by the {@code val} 1389 * parameter 1390 * @throws org.omg.CORBA.PolicyError when the requested 1391 * policy is not supported or a requested initial state 1392 * for the policy is not supported. 1393 */ 1394 public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) 1395 throws org.omg.CORBA.PolicyError 1396 { 1397 // Currently not implemented until PIORB. 1398 throw new org.omg.CORBA.NO_IMPLEMENT(); 1399 } 1400 }