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