ORB.java revision 832:a545f54babfa
1218466Sjilles/* 2218466Sjilles * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. 3218466Sjilles * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4218466Sjilles * 5218466Sjilles * This code is free software; you can redistribute it and/or modify it 6218466Sjilles * under the terms of the GNU General Public License version 2 only, as 7218466Sjilles * published by the Free Software Foundation. Oracle designates this 8218466Sjilles * particular file as subject to the "Classpath" exception as provided 9218466Sjilles * by Oracle in the LICENSE file that accompanied this code. 10218466Sjilles * 11218466Sjilles * This code is distributed in the hope that it will be useful, but WITHOUT 12218466Sjilles * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13218466Sjilles * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14218466Sjilles * version 2 for more details (a copy is included in the LICENSE file that 15218466Sjilles * accompanied this code). 16218466Sjilles * 17218466Sjilles * You should have received a copy of the GNU General Public License version 18218466Sjilles * 2 along with this work; if not, write to the Free Software Foundation, 19218466Sjilles * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20218466Sjilles * 21218466Sjilles * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22218466Sjilles * or visit www.oracle.com if you need additional information or have any 23218466Sjilles * questions. 24218466Sjilles */ 25218466Sjilles 26218466Sjillespackage org.omg.CORBA; 27218466Sjilles 28218466Sjillesimport org.omg.CORBA.portable.*; 29218466Sjillesimport org.omg.CORBA.ORBPackage.InvalidName; 30218466Sjilles 31218466Sjillesimport java.util.Properties; 32218466Sjillesimport java.applet.Applet; 33218466Sjillesimport java.io.File; 34218466Sjillesimport java.io.FileInputStream; 35218466Sjilles 36218466Sjillesimport java.security.AccessController; 37218466Sjillesimport java.security.PrivilegedAction; 38223580Sjilles 39218466Sjilles/** 40218466Sjilles * A class providing APIs for the CORBA Object Request Broker 41218466Sjilles * features. The {@code ORB} class also provides 42218466Sjilles * "pluggable ORB implementation" APIs that allow another vendor's ORB 43218466Sjilles * implementation to be used. 44218466Sjilles * <P> 45218466Sjilles * An ORB makes it possible for CORBA objects to communicate 46218466Sjilles * with each other by connecting objects making requests (clients) with 47218466Sjilles * objects servicing requests (servers). 48218466Sjilles * <P> 49218466Sjilles * 50218466Sjilles * The {@code ORB} class, which 51218466Sjilles * encapsulates generic CORBA functionality, does the following: 52218466Sjilles * (Note that items 5 and 6, which include most of the methods in 53218466Sjilles * the class {@code ORB}, are typically used with the 54218466Sjilles * {@code Dynamic Invocation Interface} (DII) and 55218466Sjilles * the {@code Dynamic Skeleton Interface} (DSI). 56218466Sjilles * These interfaces may be used by a developer directly, but 57218466Sjilles * most commonly they are used by the ORB internally and are 58218466Sjilles * not seen by the general programmer.) 59218466Sjilles * <OL> 60218466Sjilles * <li> initializes the ORB implementation by supplying values for 61218466Sjilles * predefined properties and environmental parameters 62218466Sjilles * <li> obtains initial object references to services such as 63218466Sjilles * the NameService using the method {@code resolve_initial_references} 64218466Sjilles * <li> converts object references to strings and back 65218466Sjilles * <li> connects the ORB to a servant (an instance of a CORBA object 66218466Sjilles * implementation) and disconnects the ORB from a servant 67218466Sjilles * <li> creates objects such as 68218466Sjilles * <ul> 69218466Sjilles * <li>{@code TypeCode} 70218466Sjilles * <li>{@code Any} 71218466Sjilles * <li>{@code NamedValue} 72218466Sjilles * <li>{@code Context} 73218466Sjilles * <li>{@code Environment} 74218466Sjilles * <li>lists (such as {@code NVList}) containing these objects 75218466Sjilles * </ul> 76218466Sjilles * <li> sends multiple messages in the DII 77218466Sjilles * </OL> 78218466Sjilles * 79218466Sjilles * <P> 80218466Sjilles * The {@code ORB} class can be used to obtain references to objects 81218466Sjilles * implemented anywhere on the network. 82218466Sjilles * <P> 83218466Sjilles * An application or applet gains access to the CORBA environment 84218466Sjilles * by initializing itself into an {@code ORB} using one of 85218466Sjilles * three {@code init} methods. Two of the three methods use the properties 86218466Sjilles * (associations of a name with a value) shown in the 87230530Scharnier * table below.<BR> 88230530Scharnier * <TABLE BORDER=1 SUMMARY="Standard Java CORBA Properties"> 89218466Sjilles * <TR><TH>Property Name</TH> <TH>Property Value</TH></TR> 90218466Sjilles * <CAPTION>Standard Java CORBA Properties:</CAPTION> 91218466Sjilles * <TR><TD>org.omg.CORBA.ORBClass</TD> 92218466Sjilles * <TD>class name of an ORB implementation</TD></TR> 93218466Sjilles * <TR><TD>org.omg.CORBA.ORBSingletonClass</TD> 94218466Sjilles * <TD>class name of the ORB returned by {@code init()}</TD></TR> 95218466Sjilles * </TABLE> 96218466Sjilles * <P> 97218466Sjilles * These properties allow a different vendor's {@code ORB} 98218466Sjilles * implementation to be "plugged in." 99218466Sjilles * <P> 100218466Sjilles * When an ORB instance is being created, the class name of the ORB 101218466Sjilles * implementation is located using 102221463Sjilles * the following standard search order: 103221463Sjilles * 104218466Sjilles * <OL> 105218466Sjilles * <LI>check in Applet parameter or application string array, if any 106218466Sjilles * 107218466Sjilles * <LI>check in properties parameter, if any 108218466Sjilles * 109218466Sjilles * <LI>check in the System properties 110218466Sjilles * 111218466Sjilles * <LI>check in the orb.properties file located in the user.home 112218466Sjilles * directory (if any) 113218466Sjilles * 114218466Sjilles * <LI>check in the orb.properties file located in the java.home/lib 115218466Sjilles * directory (if any) 116218466Sjilles * 117218466Sjilles * <LI>fall back on a hardcoded default behavior (use the Java IDL 118218466Sjilles * implementation) 119218466Sjilles * </OL> 120218466Sjilles * <P> 121218466Sjilles * Note that Java IDL provides a default implementation for the 122218466Sjilles * fully-functional ORB and for the Singleton ORB. When the method 123218466Sjilles * {@code init} is given no parameters, the default Singleton 124218466Sjilles * ORB is returned. When the method {@code init} is given parameters 125218466Sjilles * but no ORB class is specified, the Java IDL ORB implementation 126218466Sjilles * is returned. 127218466Sjilles * <P> 128218466Sjilles * The following code fragment creates an {@code ORB} object 129218466Sjilles * initialized with the default ORB Singleton. 130218466Sjilles * This ORB has a 131218466Sjilles * restricted implementation to prevent malicious applets from doing 132218626Sjilles * anything beyond creating typecodes. 133218626Sjilles * It is called a singleton 134218466Sjilles * because there is only one instance for an entire virtual machine. 135218466Sjilles * <PRE> 136227369Sjilles * ORB orb = ORB.init(); 137218466Sjilles * </PRE> 138227369Sjilles * <P> 139218466Sjilles * The following code fragment creates an {@code ORB} object 140227369Sjilles * for an application. The parameter {@code args} 141218466Sjilles * represents the arguments supplied to the application's {@code main} 142218466Sjilles * method. Since the property specifies the ORB class to be 143218466Sjilles * "SomeORBImplementation", the new ORB will be initialized with 144218466Sjilles * that ORB implementation. If p had been null, 145218466Sjilles * and the arguments had not specified an ORB class, 146218466Sjilles * the new ORB would have been 147218466Sjilles * initialized with the default Java IDL implementation. 148218466Sjilles * <PRE> 149218466Sjilles * Properties p = new Properties(); 150218466Sjilles * p.put("org.omg.CORBA.ORBClass", "SomeORBImplementation"); 151218466Sjilles * ORB orb = ORB.init(args, p); 152218466Sjilles * </PRE> 153218466Sjilles * <P> 154218466Sjilles * The following code fragment creates an {@code ORB} object 155218466Sjilles * for the applet supplied as the first parameter. If the given 156218466Sjilles * applet does not specify an ORB class, the new ORB will be 157218466Sjilles * initialized with the default Java IDL implementation. 158218466Sjilles * <PRE> 159218466Sjilles * ORB orb = ORB.init(myApplet, null); 160218466Sjilles * </PRE> 161218466Sjilles * <P> 162218466Sjilles * An application or applet can be initialized in one or more ORBs. 163218466Sjilles * ORB initialization is a bootstrap call into the CORBA world. 164218466Sjilles * 165218466Sjilles * 166218466Sjilles * @implNote 167218466Sjilles * When a singleton ORB is configured via the system property, 168218466Sjilles * or orb.properties, it will be 169218466Sjilles * located, and loaded via the system class loader. 170218466Sjilles * Thus, where appropriate, it is necessary that 171218466Sjilles * the classes for this alternative ORBSingleton are available on the application's class path. 172218466Sjilles * It should be noted that the singleton ORB is system wide. 173218466Sjilles * 174218466Sjilles * When a per-application ORB is created via the 2-arg init methods, 175218466Sjilles * then it will be located using the thread context class loader. 176218466Sjilles * 177218466Sjilles * @since JDK1.2 178218466Sjilles */ 179218466Sjillesabstract public class ORB { 180218466Sjilles 181218466Sjilles // 182218466Sjilles // This is the ORB implementation used when nothing else is specified. 183218466Sjilles // Whoever provides this class customizes this string to 184218466Sjilles // point at their ORB implementation. 185218466Sjilles // 186218466Sjilles private static final String ORBClassKey = "org.omg.CORBA.ORBClass"; 187218466Sjilles private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass"; 188218466Sjilles 189218466Sjilles // check that access to the class is not restricted by the security manager. 190218466Sjilles private static void checkPackageAccess(String name) { 191218466Sjilles SecurityManager s = System.getSecurityManager(); 192218466Sjilles if (s != null) { 193218466Sjilles String cname = name.replace('/', '.'); 194218466Sjilles if (cname.startsWith("[")) { 195218466Sjilles int b = cname.lastIndexOf('[') + 2; 196218466Sjilles if (b > 1 && b < cname.length()) { 197218466Sjilles cname = cname.substring(b); 198218466Sjilles } 199218466Sjilles } 200218466Sjilles int i = cname.lastIndexOf('.'); 201218466Sjilles if (i != -1) { 202218466Sjilles s.checkPackageAccess(cname.substring(0, i)); 203218466Sjilles } 204218466Sjilles } 205219306Sjilles } 206218466Sjilles 207218466Sjilles // 208218466Sjilles // The global instance of the singleton ORB implementation which 209218466Sjilles // acts as a factory for typecodes for generated Helper classes. 210218466Sjilles // TypeCodes should be immutable since they may be shared across 211218466Sjilles // different security contexts (applets). There should be no way to 212218466Sjilles // use a TypeCode as a storage depot for illicitly passing 213218466Sjilles // information or Java objects between different security contexts. 214218466Sjilles // 215218466Sjilles static private ORB singleton; 216218466Sjilles 217218466Sjilles // Get System property 218218466Sjilles private static String getSystemProperty(final String name) { 219218466Sjilles 220218466Sjilles // This will not throw a SecurityException because this 221218466Sjilles // class was loaded from rt.jar using the bootstrap classloader. 222218466Sjilles String propValue = (String) AccessController.doPrivileged( 223218466Sjilles new PrivilegedAction() { 224218466Sjilles public java.lang.Object run() { 225218466Sjilles return System.getProperty(name); 226218466Sjilles } 227218466Sjilles } 228219306Sjilles ); 229218466Sjilles 230218466Sjilles return propValue; 231218466Sjilles } 232218466Sjilles 233218466Sjilles // Get property from orb.properties in either <user.home> or <java-home>/lib 234218466Sjilles // directories. 235218466Sjilles private static String getPropertyFromFile(final String name) { 236218466Sjilles // This will not throw a SecurityException because this 237218466Sjilles // class was loaded from rt.jar using the bootstrap classloader. 238218466Sjilles 239218466Sjilles String propValue = (String) AccessController.doPrivileged( 240218466Sjilles new PrivilegedAction() { 241218466Sjilles private Properties getFileProperties( String fileName ) { 242218466Sjilles try { 243218466Sjilles File propFile = new File( fileName ) ; 244218466Sjilles if (!propFile.exists()) 245218466Sjilles return null ; 246218466Sjilles 247218466Sjilles Properties props = new Properties() ; 248218466Sjilles FileInputStream fis = new FileInputStream(propFile); 249218466Sjilles try { 250218466Sjilles props.load( fis ); 251218466Sjilles } finally { 252218466Sjilles fis.close() ; 253218466Sjilles } 254218466Sjilles 255218466Sjilles return props ; 256218466Sjilles } catch (Exception exc) { 257218466Sjilles return null ; 258218466Sjilles } 259218466Sjilles } 260218466Sjilles 261218466Sjilles public java.lang.Object run() { 262218466Sjilles String userHome = System.getProperty("user.home"); 263218466Sjilles String fileName = userHome + File.separator + 264218466Sjilles "orb.properties" ; 265218466Sjilles Properties props = getFileProperties( fileName ) ; 266218466Sjilles 267218466Sjilles if (props != null) { 268218466Sjilles String value = props.getProperty( name ) ; 269218466Sjilles if (value != null) 270218466Sjilles return value ; 271218466Sjilles } 272218466Sjilles 273218466Sjilles String javaHome = System.getProperty("java.home"); 274218466Sjilles fileName = javaHome + File.separator 275218466Sjilles + "lib" + File.separator + "orb.properties"; 276218466Sjilles props = getFileProperties( fileName ) ; 277218466Sjilles 278218466Sjilles if (props == null) 279218466Sjilles return null ; 280218466Sjilles else 281218466Sjilles return props.getProperty( name ) ; 282218466Sjilles } 283218466Sjilles } 284218466Sjilles ); 285218466Sjilles 286218466Sjilles return propValue; 287218466Sjilles } 288218466Sjilles 289218466Sjilles /** 290218466Sjilles * Returns the {@code ORB} singleton object. This method always returns the 291218466Sjilles * same ORB instance, which is an instance of the class described by the 292218466Sjilles * {@code org.omg.CORBA.ORBSingletonClass} system property. 293218466Sjilles * <P> 294218466Sjilles * This no-argument version of the method {@code init} is used primarily 295218466Sjilles * as a factory for {@code TypeCode} objects, which are used by 296218466Sjilles * {@code Helper} classes to implement the method {@code type}. 297218466Sjilles * It is also used to create {@code Any} objects that are used to 298218466Sjilles * describe {@code union} labels (as part of creating a 299218466Sjilles * {@code TypeCode} object for a {@code union}). 300218466Sjilles * <P> 301218466Sjilles * This method is not intended to be used by applets, and in the event 302218466Sjilles * that it is called in an applet environment, the ORB it returns 303218466Sjilles * is restricted so that it can be used only as a factory for 304218466Sjilles * {@code TypeCode} objects. Any {@code TypeCode} objects 305218466Sjilles * it produces can be safely shared among untrusted applets. 306218466Sjilles * <P> 307218466Sjilles * If an ORB is created using this method from an applet, 308218466Sjilles * a system exception will be thrown if 309218466Sjilles * methods other than those for 310218466Sjilles * creating {@code TypeCode} objects are invoked. 311218466Sjilles * 312218466Sjilles * @return the singleton ORB 313218466Sjilles * 314218466Sjilles * @implNote 315218466Sjilles * When configured via the system property, or orb.properties, 316218466Sjilles * the system-wide singleton ORB is located via the 317218466Sjilles * system class loader. 318218466Sjilles */ 319218466Sjilles public static synchronized ORB init() { 320218466Sjilles if (singleton == null) { 321218466Sjilles String className = getSystemProperty(ORBSingletonClassKey); 322218466Sjilles if (className == null) 323218466Sjilles className = getPropertyFromFile(ORBSingletonClassKey); 324218466Sjilles if ((className == null) || 325218466Sjilles (className.equals("com.sun.corba.se.impl.orb.ORBSingleton"))) { 326218466Sjilles singleton = new com.sun.corba.se.impl.orb.ORBSingleton(); 327218466Sjilles } else { 328218466Sjilles singleton = create_impl_with_systemclassloader(className); 329218466Sjilles } 330218466Sjilles } 331218466Sjilles return singleton; 332218466Sjilles } 333218466Sjilles 334218466Sjilles private static ORB create_impl_with_systemclassloader(String className) { 335218466Sjilles 336218466Sjilles try { 337218466Sjilles checkPackageAccess(className); 338218466Sjilles ClassLoader cl = ClassLoader.getSystemClassLoader(); 339218466Sjilles Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class; 340218466Sjilles Class<?> singletonOrbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass); 341218466Sjilles return (ORB)singletonOrbClass.newInstance(); 342218466Sjilles } catch (Throwable ex) { 343218466Sjilles SystemException systemException = new INITIALIZE( 344218466Sjilles "can't instantiate default ORB implementation " + className); 345218466Sjilles systemException.initCause(ex); 346218466Sjilles throw systemException; 347218466Sjilles } 348218466Sjilles } 349222386Sjilles 350218466Sjilles private static ORB create_impl(String className) { 351218466Sjilles ClassLoader cl = Thread.currentThread().getContextClassLoader(); 352218466Sjilles if (cl == null) 353218466Sjilles cl = ClassLoader.getSystemClassLoader(); 354218466Sjilles 355218466Sjilles try { 356218466Sjilles checkPackageAccess(className); 357218466Sjilles Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class; 358218466Sjilles Class<?> orbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass); 359218466Sjilles return (ORB)orbClass.newInstance(); 360218466Sjilles } catch (Throwable ex) { 361218466Sjilles SystemException systemException = new INITIALIZE( 362218466Sjilles "can't instantiate default ORB implementation " + className); 363218466Sjilles systemException.initCause(ex); 364218466Sjilles throw systemException; 365218466Sjilles } 366218466Sjilles } 367218466Sjilles 368218466Sjilles /** 369218466Sjilles * Creates a new {@code ORB} instance for a standalone 370218466Sjilles * application. This method may be called from applications 371218466Sjilles * only and returns a new fully functional {@code ORB} object 372218466Sjilles * each time it is called. 373218466Sjilles * @param args command-line arguments for the application's {@code main} 374218466Sjilles * method; may be {@code null} 375218466Sjilles * @param props application-specific properties; may be {@code null} 376218466Sjilles * @return the newly-created ORB instance 377218466Sjilles * 378218466Sjilles * @implNote 379218466Sjilles * When configured via the system property, or orb.properties, 380218466Sjilles * the ORB is located via the thread context class loader. 381218466Sjilles */ 382 public static ORB init(String[] args, Properties props) { 383 // 384 // Note that there is no standard command-line argument for 385 // specifying the default ORB implementation. For an 386 // application you can choose an implementation either by 387 // setting the CLASSPATH to pick a different org.omg.CORBA 388 // and it's baked-in ORB implementation default or by 389 // setting an entry in the properties object or in the 390 // system properties. 391 // 392 String className = null; 393 ORB orb; 394 395 if (props != null) 396 className = props.getProperty(ORBClassKey); 397 if (className == null) 398 className = getSystemProperty(ORBClassKey); 399 if (className == null) 400 className = getPropertyFromFile(ORBClassKey); 401 if ((className == null) || 402 (className.equals("com.sun.corba.se.impl.orb.ORBImpl"))) { 403 orb = new com.sun.corba.se.impl.orb.ORBImpl(); 404 } else { 405 orb = create_impl(className); 406 } 407 orb.set_parameters(args, props); 408 return orb; 409 } 410 411 412 /** 413 * Creates a new {@code ORB} instance for an applet. This 414 * method may be called from applets only and returns a new 415 * fully-functional {@code ORB} object each time it is called. 416 * @param app the applet; may be {@code null} 417 * @param props applet-specific properties; may be {@code null} 418 * @return the newly-created ORB instance 419 * 420 * @implNote 421 * When configured via the system property, or orb.properties, 422 * the ORB is located via the thread context class loader. 423 */ 424 public static ORB init(Applet app, Properties props) { 425 String className; 426 ORB orb; 427 428 className = app.getParameter(ORBClassKey); 429 if (className == null && props != null) 430 className = props.getProperty(ORBClassKey); 431 if (className == null) 432 className = getSystemProperty(ORBClassKey); 433 if (className == null) 434 className = getPropertyFromFile(ORBClassKey); 435 if ((className == null) || 436 (className.equals("com.sun.corba.se.impl.orb.ORBImpl"))) { 437 orb = new com.sun.corba.se.impl.orb.ORBImpl(); 438 } else { 439 orb = create_impl(className); 440 } 441 orb.set_parameters(app, props); 442 return orb; 443 } 444 445 /** 446 * Allows the ORB implementation to be initialized with the given 447 * parameters and properties. This method, used in applications only, 448 * is implemented by subclass ORB implementations and called 449 * by the appropriate {@code init} method to pass in its parameters. 450 * 451 * @param args command-line arguments for the application's {@code main} 452 * method; may be {@code null} 453 * @param props application-specific properties; may be {@code null} 454 */ 455 abstract protected void set_parameters(String[] args, Properties props); 456 457 /** 458 * Allows the ORB implementation to be initialized with the given 459 * applet and parameters. This method, used in applets only, 460 * is implemented by subclass ORB implementations and called 461 * by the appropriate {@code init} method to pass in its parameters. 462 * 463 * @param app the applet; may be {@code null} 464 * @param props applet-specific properties; may be {@code null} 465 */ 466 abstract protected void set_parameters(Applet app, Properties props); 467 468 /** 469 * Connects the given servant object (a Java object that is 470 * an instance of the server implementation class) 471 * to the ORB. The servant class must 472 * extend the {@code ImplBase} class corresponding to the interface that is 473 * supported by the server. The servant must thus be a CORBA object 474 * reference, and inherit from {@code org.omg.CORBA.Object}. 475 * Servants created by the user can start receiving remote invocations 476 * after the method {@code connect} has been called. A servant may also be 477 * automatically and implicitly connected to the ORB if it is passed as 478 * an IDL parameter in an IDL method invocation on a non-local object, 479 * that is, if the servant object has to be marshalled and sent outside of the 480 * process address space. 481 * <P> 482 * Calling the method {@code connect} has no effect 483 * when the servant object is already connected to the ORB. 484 * <P> 485 * Deprecated by the OMG in favor of the Portable Object Adapter APIs. 486 * 487 * @param obj The servant object reference 488 */ 489 public void connect(org.omg.CORBA.Object obj) { 490 throw new NO_IMPLEMENT(); 491 } 492 493 /** 494 * Destroys the ORB so that its resources can be reclaimed. 495 * Any operation invoked on a destroyed ORB reference will throw the 496 * {@code OBJECT_NOT_EXIST} exception. 497 * Once an ORB has been destroyed, another call to {@code init} 498 * with the same ORBid will return a reference to a newly constructed ORB.<p> 499 * If {@code destroy} is called on an ORB that has not been shut down, 500 * it will start the shut down process and block until the ORB has shut down 501 * before it destroys the ORB.<br> 502 * If an application calls {@code destroy} in a thread that is currently servicing 503 * an invocation, the {@code BAD_INV_ORDER} system exception will be thrown 504 * with the OMG minor code 3, since blocking would result in a deadlock.<p> 505 * For maximum portability and to avoid resource leaks, an application should 506 * always call {@code shutdown} and {@code destroy} 507 * on all ORB instances before exiting. 508 * 509 * @throws org.omg.CORBA.BAD_INV_ORDER if the current thread is servicing an invocation 510 */ 511 public void destroy( ) { 512 throw new NO_IMPLEMENT(); 513 } 514 515 /** 516 * Disconnects the given servant object from the ORB. After this method returns, 517 * the ORB will reject incoming remote requests for the disconnected 518 * servant and will send the exception 519 * {@code org.omg.CORBA.OBJECT_NOT_EXIST} back to the 520 * remote client. Thus the object appears to be destroyed from the 521 * point of view of remote clients. Note, however, that local requests issued 522 * using the servant directly do not 523 * pass through the ORB; hence, they will continue to be processed by the 524 * servant. 525 * <P> 526 * Calling the method {@code disconnect} has no effect 527 * if the servant is not connected to the ORB. 528 * <P> 529 * Deprecated by the OMG in favor of the Portable Object Adapter APIs. 530 * 531 * @param obj The servant object to be disconnected from the ORB 532 */ 533 public void disconnect(org.omg.CORBA.Object obj) { 534 throw new NO_IMPLEMENT(); 535 } 536 537 // 538 // ORB method implementations. 539 // 540 // We are trying to accomplish 2 things at once in this class. 541 // It can act as a default ORB implementation front-end, 542 // creating an actual ORB implementation object which is a 543 // subclass of this ORB class and then delegating the method 544 // implementations. 545 // 546 // To accomplish the delegation model, the 'delegate' private instance 547 // variable is set if an instance of this class is created directly. 548 // 549 550 /** 551 * Returns a list of the initially available CORBA object references, 552 * such as "NameService" and "InterfaceRepository". 553 * 554 * @return an array of {@code String} objects that represent 555 * the object references for CORBA services 556 * that are initially available with this ORB 557 */ 558 abstract public String[] list_initial_services(); 559 560 /** 561 * Resolves a specific object reference from the set of available 562 * initial service names. 563 * 564 * @param object_name the name of the initial service as a string 565 * @return the object reference associated with the given name 566 * @exception InvalidName if the given name is not associated with a 567 * known service 568 */ 569 abstract public org.omg.CORBA.Object resolve_initial_references(String object_name) 570 throws InvalidName; 571 572 /** 573 * Converts the given CORBA object reference to a string. 574 * Note that the format of this string is predefined by IIOP, allowing 575 * strings generated by a different ORB to be converted back into an object 576 * reference. 577 * <P> 578 * The resulting {@code String} object may be stored or communicated 579 * in any way that a {@code String} object can be manipulated. 580 * 581 * @param obj the object reference to stringify 582 * @return the string representing the object reference 583 */ 584 abstract public String object_to_string(org.omg.CORBA.Object obj); 585 586 /** 587 * Converts a string produced by the method {@code object_to_string} 588 * back to a CORBA object reference. 589 * 590 * @param str the string to be converted back to an object reference. It must 591 * be the result of converting an object reference to a string using the 592 * method {@code object_to_string}. 593 * @return the object reference 594 */ 595 abstract public org.omg.CORBA.Object string_to_object(String str); 596 597 /** 598 * Allocates an {@code NVList} with (probably) enough 599 * space for the specified number of {@code NamedValue} objects. 600 * Note that the specified size is only a hint to help with 601 * storage allocation and does not imply the maximum size of the list. 602 * 603 * @param count suggested number of {@code NamedValue} objects for 604 * which to allocate space 605 * @return the newly-created {@code NVList} 606 * 607 * @see NVList 608 */ 609 abstract public NVList create_list(int count); 610 611 /** 612 * Creates an {@code NVList} initialized with argument 613 * descriptions for the operation described in the given 614 * {@code OperationDef} object. This {@code OperationDef} object 615 * is obtained from an Interface Repository. The arguments in the 616 * returned {@code NVList} object are in the same order as in the 617 * original IDL operation definition, which makes it possible for the list 618 * to be used in dynamic invocation requests. 619 * 620 * @param oper the {@code OperationDef} object to use to create the list 621 * @return a newly-created {@code NVList} object containing 622 * descriptions of the arguments to the method described in the given 623 * {@code OperationDef} object 624 * 625 * @see NVList 626 */ 627 public NVList create_operation_list(org.omg.CORBA.Object oper) 628 { 629 // If we came here, it means that the actual ORB implementation 630 // did not have a create_operation_list(...CORBA.Object oper) method, 631 // so lets check if it has a create_operation_list(OperationDef oper) 632 // method. 633 try { 634 // First try to load the OperationDef class 635 String opDefClassName = "org.omg.CORBA.OperationDef"; 636 Class<?> opDefClass = null; 637 638 ClassLoader cl = Thread.currentThread().getContextClassLoader(); 639 if ( cl == null ) 640 cl = ClassLoader.getSystemClassLoader(); 641 // if this throws a ClassNotFoundException, it will be caught below. 642 opDefClass = Class.forName(opDefClassName, true, cl); 643 644 // OK, we loaded OperationDef. Now try to get the 645 // create_operation_list(OperationDef oper) method. 646 Class<?>[] argc = { opDefClass }; 647 java.lang.reflect.Method meth = 648 this.getClass().getMethod("create_operation_list", argc); 649 650 // OK, the method exists, so invoke it and be happy. 651 java.lang.Object[] argx = { oper }; 652 return (org.omg.CORBA.NVList)meth.invoke(this, argx); 653 } 654 catch( java.lang.reflect.InvocationTargetException exs ) { 655 Throwable t = exs.getTargetException(); 656 if (t instanceof Error) { 657 throw (Error) t; 658 } 659 else if (t instanceof RuntimeException) { 660 throw (RuntimeException) t; 661 } 662 else { 663 throw new org.omg.CORBA.NO_IMPLEMENT(); 664 } 665 } 666 catch( RuntimeException ex ) { 667 throw ex; 668 } 669 catch( Exception exr ) { 670 throw new org.omg.CORBA.NO_IMPLEMENT(); 671 } 672 } 673 674 675 /** 676 * Creates a {@code NamedValue} object 677 * using the given name, value, and argument mode flags. 678 * <P> 679 * A {@code NamedValue} object serves as (1) a parameter or return 680 * value or (2) a context property. 681 * It may be used by itself or 682 * as an element in an {@code NVList} object. 683 * 684 * @param s the name of the {@code NamedValue} object 685 * @param any the {@code Any} value to be inserted into the 686 * {@code NamedValue} object 687 * @param flags the argument mode flags for the {@code NamedValue}: one of 688 * {@code ARG_IN.value}, {@code ARG_OUT.value}, 689 * or {@code ARG_INOUT.value}. 690 * 691 * @return the newly-created {@code NamedValue} object 692 * @see NamedValue 693 */ 694 abstract public NamedValue create_named_value(String s, Any any, int flags); 695 696 /** 697 * Creates an empty {@code ExceptionList} object. 698 * 699 * @return the newly-created {@code ExceptionList} object 700 */ 701 abstract public ExceptionList create_exception_list(); 702 703 /** 704 * Creates an empty {@code ContextList} object. 705 * 706 * @return the newly-created {@code ContextList} object 707 * @see ContextList 708 * @see Context 709 */ 710 abstract public ContextList create_context_list(); 711 712 /** 713 * Gets the default {@code Context} object. 714 * 715 * @return the default {@code Context} object 716 * @see Context 717 */ 718 abstract public Context get_default_context(); 719 720 /** 721 * Creates an {@code Environment} object. 722 * 723 * @return the newly-created {@code Environment} object 724 * @see Environment 725 */ 726 abstract public Environment create_environment(); 727 728 /** 729 * Creates a new {@code org.omg.CORBA.portable.OutputStream} into which 730 * IDL method parameters can be marshalled during method invocation. 731 * @return the newly-created 732 * {@code org.omg.CORBA.portable.OutputStream} object 733 */ 734 abstract public org.omg.CORBA.portable.OutputStream create_output_stream(); 735 736 /** 737 * Sends multiple dynamic (DII) requests asynchronously without expecting 738 * any responses. Note that oneway invocations are not guaranteed to 739 * reach the server. 740 * 741 * @param req an array of request objects 742 */ 743 abstract public void send_multiple_requests_oneway(Request[] req); 744 745 /** 746 * Sends multiple dynamic (DII) requests asynchronously. 747 * 748 * @param req an array of {@code Request} objects 749 */ 750 abstract public void send_multiple_requests_deferred(Request[] req); 751 752 /** 753 * Finds out if any of the deferred (asynchronous) invocations have 754 * a response yet. 755 * @return {@code true} if there is a response available; 756 * {@code false} otherwise 757 */ 758 abstract public boolean poll_next_response(); 759 760 /** 761 * Gets the next {@code Request} instance for which a response 762 * has been received. 763 * 764 * @return the next {@code Request} object ready with a response 765 * @exception WrongTransaction if the method {@code get_next_response} 766 * is called from a transaction scope different 767 * from the one from which the original request was sent. See the 768 * OMG Transaction Service specification for details. 769 */ 770 abstract public Request get_next_response() throws WrongTransaction; 771 772 /** 773 * Retrieves the {@code TypeCode} object that represents 774 * the given primitive IDL type. 775 * 776 * @param tcKind the {@code TCKind} instance corresponding to the 777 * desired primitive type 778 * @return the requested {@code TypeCode} object 779 */ 780 abstract public TypeCode get_primitive_tc(TCKind tcKind); 781 782 /** 783 * Creates a {@code TypeCode} object representing an IDL {@code struct}. 784 * The {@code TypeCode} object is initialized with the given id, 785 * name, and members. 786 * 787 * @param id the repository id for the {@code struct} 788 * @param name the name of the {@code struct} 789 * @param members an array describing the members of the {@code struct} 790 * @return a newly-created {@code TypeCode} object describing 791 * an IDL {@code struct} 792 */ 793 abstract public TypeCode create_struct_tc(String id, String name, 794 StructMember[] members); 795 796 /** 797 * Creates a {@code TypeCode} object representing an IDL {@code union}. 798 * The {@code TypeCode} object is initialized with the given id, 799 * name, discriminator type, and members. 800 * 801 * @param id the repository id of the {@code union} 802 * @param name the name of the {@code union} 803 * @param discriminator_type the type of the {@code union} discriminator 804 * @param members an array describing the members of the {@code union} 805 * @return a newly-created {@code TypeCode} object describing 806 * an IDL {@code union} 807 */ 808 abstract public TypeCode create_union_tc(String id, String name, 809 TypeCode discriminator_type, 810 UnionMember[] members); 811 812 /** 813 * Creates a {@code TypeCode} object representing an IDL {@code enum}. 814 * The {@code TypeCode} object is initialized with the given id, 815 * name, and members. 816 * 817 * @param id the repository id for the {@code enum} 818 * @param name the name for the {@code enum} 819 * @param members an array describing the members of the {@code enum} 820 * @return a newly-created {@code TypeCode} object describing 821 * an IDL {@code enum} 822 */ 823 abstract public TypeCode create_enum_tc(String id, String name, String[] members); 824 825 /** 826 * Creates a {@code TypeCode} object representing an IDL {@code alias} 827 * ({@code typedef}). 828 * The {@code TypeCode} object is initialized with the given id, 829 * name, and original type. 830 * 831 * @param id the repository id for the alias 832 * @param name the name for the alias 833 * @param original_type 834 * the {@code TypeCode} object describing the original type 835 * for which this is an alias 836 * @return a newly-created {@code TypeCode} object describing 837 * an IDL {@code alias} 838 */ 839 abstract public TypeCode create_alias_tc(String id, String name, 840 TypeCode original_type); 841 842 /** 843 * Creates a {@code TypeCode} object representing an IDL {@code exception}. 844 * The {@code TypeCode} object is initialized with the given id, 845 * name, and members. 846 * 847 * @param id the repository id for the {@code exception} 848 * @param name the name for the {@code exception} 849 * @param members an array describing the members of the {@code exception} 850 * @return a newly-created {@code TypeCode} object describing 851 * an IDL {@code exception} 852 */ 853 abstract public TypeCode create_exception_tc(String id, String name, 854 StructMember[] members); 855 856 /** 857 * Creates a {@code TypeCode} object representing an IDL {@code interface}. 858 * The {@code TypeCode} object is initialized with the given id 859 * and name. 860 * 861 * @param id the repository id for the interface 862 * @param name the name for the interface 863 * @return a newly-created {@code TypeCode} object describing 864 * an IDL {@code interface} 865 */ 866 867 abstract public TypeCode create_interface_tc(String id, String name); 868 869 /** 870 * Creates a {@code TypeCode} object representing a bounded IDL 871 * {@code string}. 872 * The {@code TypeCode} object is initialized with the given bound, 873 * which represents the maximum length of the string. Zero indicates 874 * that the string described by this type code is unbounded. 875 * 876 * @param bound the bound for the {@code string}; cannot be negative 877 * @return a newly-created {@code TypeCode} object describing 878 * a bounded IDL {@code string} 879 * @exception BAD_PARAM if bound is a negative value 880 */ 881 882 abstract public TypeCode create_string_tc(int bound); 883 884 /** 885 * Creates a {@code TypeCode} object representing a bounded IDL 886 * {@code wstring} (wide string). 887 * The {@code TypeCode} object is initialized with the given bound, 888 * which represents the maximum length of the wide string. Zero indicates 889 * that the string described by this type code is unbounded. 890 * 891 * @param bound the bound for the {@code wstring}; cannot be negative 892 * @return a newly-created {@code TypeCode} object describing 893 * a bounded IDL {@code wstring} 894 * @exception BAD_PARAM if bound is a negative value 895 */ 896 abstract public TypeCode create_wstring_tc(int bound); 897 898 /** 899 * Creates a {@code TypeCode} object representing an IDL {@code sequence}. 900 * The {@code TypeCode} object is initialized with the given bound and 901 * element type. 902 * 903 * @param bound the bound for the {@code sequence}, 0 if unbounded 904 * @param element_type the {@code TypeCode} object describing 905 * the elements contained in the {@code sequence} 906 * 907 * @return a newly-created {@code TypeCode} object describing 908 * an IDL {@code sequence} 909 */ 910 abstract public TypeCode create_sequence_tc(int bound, TypeCode element_type); 911 912 /** 913 * Creates a {@code TypeCode} object representing a 914 * a recursive IDL {@code sequence}. 915 * <P> 916 * For the IDL {@code struct} Node in following code fragment, 917 * the offset parameter for creating its sequence would be 1: 918 * <PRE> 919 * Struct Node { 920 * long value; 921 * Sequence <Node> subnodes; 922 * }; 923 * </PRE> 924 * 925 * @param bound the bound for the sequence, 0 if unbounded 926 * @param offset the index to the enclosing {@code TypeCode} object 927 * that describes the elements of this sequence 928 * @return a newly-created {@code TypeCode} object describing 929 * a recursive sequence 930 * @deprecated Use a combination of create_recursive_tc and create_sequence_tc instead 931 * @see #create_recursive_tc(String) create_recursive_tc 932 * @see #create_sequence_tc(int, TypeCode) create_sequence_tc 933 */ 934 @Deprecated 935 abstract public TypeCode create_recursive_sequence_tc(int bound, int offset); 936 937 /** 938 * Creates a {@code TypeCode} object representing an IDL {@code array}. 939 * The {@code TypeCode} object is initialized with the given length and 940 * element type. 941 * 942 * @param length the length of the {@code array} 943 * @param element_type a {@code TypeCode} object describing the type 944 * of element contained in the {@code array} 945 * @return a newly-created {@code TypeCode} object describing 946 * an IDL {@code array} 947 */ 948 abstract public TypeCode create_array_tc(int length, TypeCode element_type); 949 950 /** 951 * Create a {@code TypeCode} object for an IDL native type. 952 * 953 * @param id the logical id for the native type. 954 * @param name the name of the native type. 955 * @return the requested TypeCode. 956 */ 957 public org.omg.CORBA.TypeCode create_native_tc(String id, 958 String name) 959 { 960 throw new org.omg.CORBA.NO_IMPLEMENT(); 961 } 962 963 /** 964 * Create a {@code TypeCode} object for an IDL abstract interface. 965 * 966 * @param id the logical id for the abstract interface type. 967 * @param name the name of the abstract interface type. 968 * @return the requested TypeCode. 969 */ 970 public org.omg.CORBA.TypeCode create_abstract_interface_tc( 971 String id, 972 String name) 973 { 974 throw new org.omg.CORBA.NO_IMPLEMENT(); 975 } 976 977 978 /** 979 * Create a {@code TypeCode} object for an IDL fixed type. 980 * 981 * @param digits specifies the total number of decimal digits in the number 982 * and must be from 1 to 31 inclusive. 983 * @param scale specifies the position of the decimal point. 984 * @return the requested TypeCode. 985 */ 986 public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) 987 { 988 throw new org.omg.CORBA.NO_IMPLEMENT(); 989 } 990 991 992 // orbos 98-01-18: Objects By Value -- begin 993 994 995 /** 996 * Create a {@code TypeCode} object for an IDL value type. 997 * The concrete_base parameter is the TypeCode for the immediate 998 * concrete valuetype base of the valuetype for which the TypeCode 999 * is being created. 1000 * It may be null if the valuetype does not have a concrete base. 1001 * 1002 * @param id the logical id for the value type. 1003 * @param name the name of the value type. 1004 * @param type_modifier one of the value type modifier constants: 1005 * VM_NONE, VM_CUSTOM, VM_ABSTRACT or VM_TRUNCATABLE 1006 * @param concrete_base a {@code TypeCode} object 1007 * describing the concrete valuetype base 1008 * @param members an array containing the members of the value type 1009 * @return the requested TypeCode 1010 */ 1011 public org.omg.CORBA.TypeCode create_value_tc(String id, 1012 String name, 1013 short type_modifier, 1014 TypeCode concrete_base, 1015 ValueMember[] members) 1016 { 1017 throw new org.omg.CORBA.NO_IMPLEMENT(); 1018 } 1019 1020 /** 1021 * Create a recursive {@code TypeCode} object which 1022 * serves as a placeholder for a concrete TypeCode during the process of creating 1023 * TypeCodes which contain recursion. The id parameter specifies the repository id of 1024 * the type for which the recursive TypeCode is serving as a placeholder. Once the 1025 * recursive TypeCode has been properly embedded in the enclosing TypeCode which 1026 * corresponds to the specified repository id, it will function as a normal TypeCode. 1027 * Invoking operations on the recursive TypeCode before it has been embedded in the 1028 * enclosing TypeCode will result in a {@code BAD_TYPECODE} exception. 1029 * <P> 1030 * For example, the following IDL type declaration contains recursion: 1031 * <PRE> 1032 * Struct Node { 1033 * Sequence<Node> subnodes; 1034 * }; 1035 * </PRE> 1036 * <P> 1037 * To create a TypeCode for struct Node, you would invoke the TypeCode creation 1038 * operations as shown below: 1039 * <PRE> 1040 * String nodeID = "IDL:Node:1.0"; 1041 * TypeCode recursiveSeqTC = orb.create_sequence_tc(0, orb.create_recursive_tc(nodeID)); 1042 * StructMember[] members = { new StructMember("subnodes", recursiveSeqTC, null) }; 1043 * TypeCode structNodeTC = orb.create_struct_tc(nodeID, "Node", members); 1044 * </PRE> 1045 * <P> 1046 * Also note that the following is an illegal IDL type declaration: 1047 * <PRE> 1048 * Struct Node { 1049 * Node next; 1050 * }; 1051 * </PRE> 1052 * <P> 1053 * Recursive types can only appear within sequences which can be empty. 1054 * That way marshaling problems, when transmitting the struct in an Any, are avoided. 1055 * 1056 * @param id the logical id of the referenced type 1057 * @return the requested TypeCode 1058 */ 1059 public org.omg.CORBA.TypeCode create_recursive_tc(String id) { 1060 // implemented in subclass 1061 throw new org.omg.CORBA.NO_IMPLEMENT(); 1062 } 1063 1064 /** 1065 * Creates a {@code TypeCode} object for an IDL value box. 1066 * 1067 * @param id the logical id for the value type 1068 * @param name the name of the value type 1069 * @param boxed_type the TypeCode for the type 1070 * @return the requested TypeCode 1071 */ 1072 public org.omg.CORBA.TypeCode create_value_box_tc(String id, 1073 String name, 1074 TypeCode boxed_type) 1075 { 1076 // implemented in subclass 1077 throw new org.omg.CORBA.NO_IMPLEMENT(); 1078 } 1079 1080 // orbos 98-01-18: Objects By Value -- end 1081 1082 /** 1083 * Creates an IDL {@code Any} object initialized to 1084 * contain a {@code Typecode} object whose {@code kind} field 1085 * is set to {@code TCKind.tc_null}. 1086 * 1087 * @return a newly-created {@code Any} object 1088 */ 1089 abstract public Any create_any(); 1090 1091 1092 1093 1094 /** 1095 * Retrieves a {@code Current} object. 1096 * The {@code Current} interface is used to manage thread-specific 1097 * information for use by services such as transactions and security. 1098 * 1099 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1100 * comments for unimplemented features</a> 1101 * 1102 * @return a newly-created {@code Current} object 1103 * @deprecated use {@code resolve_initial_references}. 1104 */ 1105 @Deprecated 1106 public org.omg.CORBA.Current get_current() 1107 { 1108 throw new org.omg.CORBA.NO_IMPLEMENT(); 1109 } 1110 1111 /** 1112 * This operation blocks the current thread until the ORB has 1113 * completed the shutdown process, initiated when some thread calls 1114 * {@code shutdown}. It may be used by multiple threads which 1115 * get all notified when the ORB shuts down. 1116 * 1117 */ 1118 public void run() 1119 { 1120 throw new org.omg.CORBA.NO_IMPLEMENT(); 1121 } 1122 1123 /** 1124 * Instructs the ORB to shut down, which causes all 1125 * object adapters to shut down, in preparation for destruction.<br> 1126 * If the {@code wait_for_completion} parameter 1127 * is true, this operation blocks until all ORB processing (including 1128 * processing of currently executing requests, object deactivation, 1129 * and other object adapter operations) has completed. 1130 * If an application does this in a thread that is currently servicing 1131 * an invocation, the {@code BAD_INV_ORDER} system exception 1132 * will be thrown with the OMG minor code 3, 1133 * since blocking would result in a deadlock.<br> 1134 * If the {@code wait_for_completion} parameter is {@code FALSE}, 1135 * then shutdown may not have completed upon return.<p> 1136 * While the ORB is in the process of shutting down, the ORB operates as normal, 1137 * servicing incoming and outgoing requests until all requests have been completed. 1138 * Once an ORB has shutdown, only object reference management operations 1139 * may be invoked on the ORB or any object reference obtained from it. 1140 * An application may also invoke the {@code destroy} operation on the ORB itself. 1141 * Invoking any other operation will throw the {@code BAD_INV_ORDER} 1142 * system exception with the OMG minor code 4.<p> 1143 * The {@code ORB.run} method will return after 1144 * {@code shutdown} has been called. 1145 * 1146 * @param wait_for_completion {@code true} if the call 1147 * should block until the shutdown is complete; 1148 * {@code false} if it should return immediately 1149 * @throws org.omg.CORBA.BAD_INV_ORDER if the current thread is servicing 1150 * an invocation 1151 */ 1152 public void shutdown(boolean wait_for_completion) 1153 { 1154 throw new org.omg.CORBA.NO_IMPLEMENT(); 1155 } 1156 1157 /** 1158 * Returns {@code true} if the ORB needs the main thread to 1159 * perform some work, and {@code false} if the ORB does not 1160 * need the main thread. 1161 * 1162 * @return {@code true} if there is work pending, meaning that the ORB 1163 * needs the main thread to perform some work; {@code false} 1164 * if there is no work pending and thus the ORB does not need the 1165 * main thread 1166 * 1167 */ 1168 public boolean work_pending() 1169 { 1170 throw new org.omg.CORBA.NO_IMPLEMENT(); 1171 } 1172 1173 /** 1174 * Performs an implementation-dependent unit of work if called 1175 * by the main thread. Otherwise it does nothing. 1176 * The methods {@code work_pending} and {@code perform_work} 1177 * can be used in 1178 * conjunction to implement a simple polling loop that multiplexes 1179 * the main thread among the ORB and other activities. 1180 * 1181 */ 1182 public void perform_work() 1183 { 1184 throw new org.omg.CORBA.NO_IMPLEMENT(); 1185 } 1186 1187 /** 1188 * Used to obtain information about CORBA facilities and services 1189 * that are supported by this ORB. The service type for which 1190 * information is being requested is passed in as the in 1191 * parameter {@code service_type}, the values defined by 1192 * constants in the CORBA module. If service information is 1193 * available for that type, that is returned in the out parameter 1194 * {@code service_info}, and the operation returns the 1195 * value {@code true}. If no information for the requested 1196 * services type is available, the operation returns {@code false} 1197 * (i.e., the service is not supported by this ORB). 1198 * 1199 * @param service_type a {@code short} indicating the 1200 * service type for which information is being requested 1201 * @param service_info a {@code ServiceInformationHolder} object 1202 * that will hold the {@code ServiceInformation} object 1203 * produced by this method 1204 * @return {@code true} if service information is available 1205 * for the {@code service_type}; 1206 * {@code false} if no information for the 1207 * requested services type is available 1208 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1209 * comments for unimplemented features</a> 1210 */ 1211 public boolean get_service_information(short service_type, 1212 ServiceInformationHolder service_info) 1213 { 1214 throw new org.omg.CORBA.NO_IMPLEMENT(); 1215 } 1216 1217 // orbos 98-01-18: Objects By Value -- begin 1218 1219 /** 1220 * Creates a new {@code DynAny} object from the given 1221 * {@code Any} object. 1222 * 1223 * @param value the {@code Any} object from which to create a new 1224 * {@code DynAny} object 1225 * @return the new {@code DynAny} object created from the given 1226 * {@code Any} object 1227 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1228 * comments for unimplemented features</a> 1229 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1230 */ 1231 @Deprecated 1232 public org.omg.CORBA.DynAny create_dyn_any(org.omg.CORBA.Any value) 1233 { 1234 throw new org.omg.CORBA.NO_IMPLEMENT(); 1235 } 1236 1237 /** 1238 * Creates a basic {@code DynAny} object from the given 1239 * {@code TypeCode} object. 1240 * 1241 * @param type the {@code TypeCode} object from which to create a new 1242 * {@code DynAny} object 1243 * @return the new {@code DynAny} object created from the given 1244 * {@code TypeCode} object 1245 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1246 * {@code TypeCode} object is not consistent with the operation. 1247 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1248 * comments for unimplemented features</a> 1249 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1250 */ 1251 @Deprecated 1252 public org.omg.CORBA.DynAny create_basic_dyn_any(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1253 { 1254 throw new org.omg.CORBA.NO_IMPLEMENT(); 1255 } 1256 1257 /** 1258 * Creates a new {@code DynStruct} object from the given 1259 * {@code TypeCode} object. 1260 * 1261 * @param type the {@code TypeCode} object from which to create a new 1262 * {@code DynStruct} object 1263 * @return the new {@code DynStruct} object created from the given 1264 * {@code TypeCode} object 1265 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1266 * {@code TypeCode} object is not consistent with the operation. 1267 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1268 * comments for unimplemented features</a> 1269 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1270 */ 1271 @Deprecated 1272 public org.omg.CORBA.DynStruct create_dyn_struct(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1273 { 1274 throw new org.omg.CORBA.NO_IMPLEMENT(); 1275 } 1276 1277 /** 1278 * Creates a new {@code DynSequence} object from the given 1279 * {@code TypeCode} object. 1280 * 1281 * @param type the {@code TypeCode} object from which to create a new 1282 * {@code DynSequence} object 1283 * @return the new {@code DynSequence} object created from the given 1284 * {@code TypeCode} object 1285 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1286 * {@code TypeCode} object is not consistent with the operation. 1287 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1288 * comments for unimplemented features</a> 1289 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1290 */ 1291 @Deprecated 1292 public org.omg.CORBA.DynSequence create_dyn_sequence(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1293 { 1294 throw new org.omg.CORBA.NO_IMPLEMENT(); 1295 } 1296 1297 1298 /** 1299 * Creates a new {@code DynArray} object from the given 1300 * {@code TypeCode} object. 1301 * 1302 * @param type the {@code TypeCode} object from which to create a new 1303 * {@code DynArray} object 1304 * @return the new {@code DynArray} object created from the given 1305 * {@code TypeCode} object 1306 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1307 * {@code TypeCode} object is not consistent with the operation. 1308 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1309 * comments for unimplemented features</a> 1310 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1311 */ 1312 @Deprecated 1313 public org.omg.CORBA.DynArray create_dyn_array(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1314 { 1315 throw new org.omg.CORBA.NO_IMPLEMENT(); 1316 } 1317 1318 /** 1319 * Creates a new {@code DynUnion} object from the given 1320 * {@code TypeCode} object. 1321 * 1322 * @param type the {@code TypeCode} object from which to create a new 1323 * {@code DynUnion} object 1324 * @return the new {@code DynUnion} object created from the given 1325 * {@code TypeCode} object 1326 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1327 * {@code TypeCode} object is not consistent with the operation. 1328 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1329 * comments for unimplemented features</a> 1330 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1331 */ 1332 @Deprecated 1333 public org.omg.CORBA.DynUnion create_dyn_union(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1334 { 1335 throw new org.omg.CORBA.NO_IMPLEMENT(); 1336 } 1337 1338 /** 1339 * Creates a new {@code DynEnum} object from the given 1340 * {@code TypeCode} object. 1341 * 1342 * @param type the {@code TypeCode} object from which to create a new 1343 * {@code DynEnum} object 1344 * @return the new {@code DynEnum} object created from the given 1345 * {@code TypeCode} object 1346 * @throws org.omg.CORBA.ORBPackage.InconsistentTypeCode if the given 1347 * {@code TypeCode} object is not consistent with the operation. 1348 * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package 1349 * comments for unimplemented features</a> 1350 * @deprecated Use the new <a href="../DynamicAny/DynAnyFactory.html">DynAnyFactory</a> API instead 1351 */ 1352 @Deprecated 1353 public org.omg.CORBA.DynEnum create_dyn_enum(org.omg.CORBA.TypeCode type) throws org.omg.CORBA.ORBPackage.InconsistentTypeCode 1354 { 1355 throw new org.omg.CORBA.NO_IMPLEMENT(); 1356 } 1357 1358 /** 1359 * Can be invoked to create new instances of policy objects 1360 * of a specific type with specified initial state. If 1361 * {@code create_policy} fails to instantiate a new Policy 1362 * object due to its inability to interpret the requested type 1363 * and content of the policy, it raises the {@code PolicyError} 1364 * exception with the appropriate reason. 1365 * @param type the {@code PolicyType} of the policy object to 1366 * be created 1367 * @param val the value that will be used to set the initial 1368 * state of the {@code Policy} object that is created 1369 * @return Reference to a newly created {@code Policy} object 1370 * of type specified by the {@code type} parameter and 1371 * initialized to a state specified by the {@code val} 1372 * parameter 1373 * @throws org.omg.CORBA.PolicyError when the requested 1374 * policy is not supported or a requested initial state 1375 * for the policy is not supported. 1376 */ 1377 public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) 1378 throws org.omg.CORBA.PolicyError 1379 { 1380 // Currently not implemented until PIORB. 1381 throw new org.omg.CORBA.NO_IMPLEMENT(); 1382 } 1383} 1384