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