src/share/classes/org/omg/CORBA/ORB.java

Thu, 21 Nov 2013 11:30:39 +0000

author
msheppar
date
Thu, 21 Nov 2013 11:30:39 +0000
changeset 545
fe781b3badd6
parent 533
52ad44f9a3ec
child 615
8b0b643ffd42
permissions
-rw-r--r--

8028215: ORB.init fails with SecurityException if properties select the JDK default ORB
Summary: check for default ORBImpl and ORBSingleton set via properties or System properties
Reviewed-by: alanb, coffeys, mchung

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

mercurial