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