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

Tue, 22 Oct 2013 11:40:27 +0100

author
alanb
date
Tue, 22 Oct 2013 11:40:27 +0100
changeset 533
52ad44f9a3ec
parent 240
f90b3e014e83
child 545
fe781b3badd6
permissions
-rw-r--r--

8021257: com.sun.corba.se.** should be on restricted package list
Reviewed-by: chegar, coffeys, smarks
Contributed-by: alan.bateman@oralce.com, mark.sheppard@oracle.com

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

mercurial