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