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

Tue, 21 Jan 2014 16:26:59 +0000

author
msheppar
date
Tue, 21 Jan 2014 16:26:59 +0000
changeset 615
8b0b643ffd42
parent 545
fe781b3badd6
child 660
009fc3f785a9
permissions
-rw-r--r--

8025005: Enhance CORBA initializations
Summary: restructure ORB.init() processing flow.
Reviewed-by: alanb, coffeys, skoivu

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

mercurial