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