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