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

Sat, 07 Jun 2014 10:09:30 +0100

author
coffeys
date
Sat, 07 Jun 2014 10:09:30 +0100
changeset 660
009fc3f785a9
parent 615
8b0b643ffd42
child 748
6845b95cba6b
permissions
-rw-r--r--

8042789: org.omg.CORBA.ORBSingletonClass loading no longer uses context class loader
Reviewed-by: alanb, lancea

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

mercurial