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

Tue, 28 Dec 2010 15:52:36 -0800

author
ohair
date
Tue, 28 Dec 2010 15:52:36 -0800
changeset 240
f90b3e014e83
parent 173
032585ad970d
child 533
52ad44f9a3ec
permissions
-rw-r--r--

6962318: Update copyright year
Reviewed-by: xdono

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

mercurial