4 <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en]C-gatewaynet (WinNT; U) |
4 <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en]C-gatewaynet (WinNT; U) |
5 [Netscape]"> |
5 [Netscape]"> |
6 <TITLE>package</TITLE> |
6 <TITLE>package</TITLE> |
7 <!-- |
7 <!-- |
8 /* |
8 /* |
9 * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. |
9 * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. |
10 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
10 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
11 * |
11 * |
12 * This code is free software; you can redistribute it and/or modify it |
12 * This code is free software; you can redistribute it and/or modify it |
13 * under the terms of the GNU General Public License version 2 only, as |
13 * under the terms of the GNU General Public License version 2 only, as |
14 * published by the Free Software Foundation. Oracle designates this |
14 * published by the Free Software Foundation. Oracle designates this |
71 a holder class. |
71 a holder class. |
72 <H3> |
72 <H3> |
73 <TT>ORB</TT> Methods</H3> |
73 <TT>ORB</TT> Methods</H3> |
74 |
74 |
75 <P>Before an application can enter the CORBA environment, it must first: |
75 <P>Before an application can enter the CORBA environment, it must first: |
76 <P> |
|
77 <UL> |
76 <UL> |
78 <LI>Be initialized into the ORB and possibly the object adapter (POA) environments. |
77 <LI>Be initialized into the ORB and possibly the object adapter (POA) environments. |
79 <LI>Get references to ORB object (for use in future ORB operations) |
78 <LI>Get references to ORB object (for use in future ORB operations) |
80 and perhaps other objects (including the root POA or some Object Adapter objects). |
79 and perhaps other objects (including the root POA or some Object Adapter objects). |
81 </UL> |
80 </UL> |
82 <P>The following operations are provided to initialize applications and obtain |
81 <P>The following operations are provided to initialize applications and obtain |
83 the appropriate object references: |
82 the appropriate object references: |
84 <P> |
|
85 <UL> |
83 <UL> |
86 <LI>Operations providing access to the ORB, which are discussed in this |
84 <LI>Operations providing access to the ORB, which are discussed in this |
87 section. |
85 section. |
88 <LI>Operations providing access to Object Adapters, Interface Repository, |
86 <LI>Operations providing access to Object Adapters, Interface Repository, |
89 Naming Service, and other Object Services. These operations are described |
87 Naming Service, and other Object Services. These operations are described |
105 |
103 |
106 <P>These are the <TT>ORB</TT> methods |
104 <P>These are the <TT>ORB</TT> methods |
107 that provide access to the ORB: |
105 that provide access to the ORB: |
108 <UL> |
106 <UL> |
109 <LI> |
107 <LI> |
110 <TT><bold>init</bold>()</TT> |
108 <TT><b>init</b>()</TT> |
111 |
109 |
112 <LI> |
110 <LI> |
113 <TT><bold>init</bold>(String [] args, Properties props)</TT> |
111 <TT><b>init</b>(String [] args, Properties props)</TT> |
114 |
112 |
115 <LI> |
113 <LI> |
116 <TT><bold>init</bold>(Applet app, Properties props)</TT> |
114 <TT><b>init</b>(Applet app, Properties props)</TT> |
117 </UL> |
115 </UL> |
118 |
116 |
119 <P>Using the <tt>init()</tt> method without parameters initiates |
117 <P>Using the <tt>init()</tt> method without parameters initiates |
120 a singleton ORB, which can only |
118 a singleton ORB, which can only |
121 give typecode creation <tt>any</tt>s needed in code generated |
119 give typecode creation <tt>any</tt>s needed in code generated |
140 <P>Initial references are obtained via two operations provided in |
138 <P>Initial references are obtained via two operations provided in |
141 the ORB object interface, providing facilities to list and |
139 the ORB object interface, providing facilities to list and |
142 resolve initial object references. These are: |
140 resolve initial object references. These are: |
143 <UL> |
141 <UL> |
144 <LI> |
142 <LI> |
145 <TT><bold>resolve_initial_references</bold>(String name)</TT> |
143 <TT><b>resolve_initial_references</b>(String name)</TT> |
146 <LI> |
144 <LI> |
147 <TT><bold>list_initial_services</bold>()</TT> |
145 <TT><b>list_initial_services</b>()</TT> |
148 <LI> |
146 <LI> |
149 <TT><bold>register_initial_reference</bold>(String id, |
147 <TT><b>register_initial_reference</b>(String id, |
150 org.omg.CORBA.Object obj)</TT> |
148 org.omg.CORBA.Object obj)</TT> |
151 </UL> |
149 </UL> |
152 |
150 |
153 <P>An example that uses some of these methods is <A |
151 <P>An example that uses some of these methods is <A |
154 HREF="{@docRoot}/../technotes/guides/idl/GShome.html"> |
152 HREF="{@docRoot}/../technotes/guides/idl/GShome.html"> |
276 defined in OMG specifications such as those for the Interface |
274 defined in OMG specifications such as those for the Interface |
277 Repository, and other OMG services.) |
275 Repository, and other OMG services.) |
278 |
276 |
279 |
277 |
280 <P>Each holder class has: |
278 <P>Each holder class has: |
281 <P> |
|
282 <UL> |
279 <UL> |
283 <LI>a constructor from an instance |
280 <LI>a constructor from an instance |
284 <LI>a default constructor |
281 <LI>a default constructor |
285 <LI>a public instance member, <tt>value</tt> which is the typed value. |
282 <LI>a public instance member, <tt>value</tt> which is the typed value. |
286 <LI>a method for reading an input stream and assigning the contents to the |
283 <LI>a method for reading an input stream and assigning the contents to the |
289 <LI>a method for getting the typecode of the type |
286 <LI>a method for getting the typecode of the type |
290 </UL> |
287 </UL> |
291 |
288 |
292 <P>The default constructor sets the value field to the default value for the |
289 <P>The default constructor sets the value field to the default value for the |
293 type as defined by the Java language: |
290 type as defined by the Java language: |
294 <P> |
|
295 <UL> |
291 <UL> |
296 <LI><tt>false</tt> for boolean |
292 <LI><tt>false</tt> for boolean |
297 <LI><tt>0</tt> for numeric and char types |
293 <LI><tt>0</tt> for numeric and char types |
298 <LI><tt>null</tt> for strings and object references |
294 <LI><tt>null</tt> for strings and object references |
299 </UL> |
295 </UL> |
389 </PRE> |
385 </PRE> |
390 |
386 |
391 <h2>Helper Classes </h2> |
387 <h2>Helper Classes </h2> |
392 <P>Helper files supply several static methods needed to manipulate the type. |
388 <P>Helper files supply several static methods needed to manipulate the type. |
393 These include: |
389 These include: |
394 <P> |
|
395 <UL> |
390 <UL> |
396 <LI><tt>Any</tt> insert and extract operations for the type |
391 <LI><tt>Any</tt> insert and extract operations for the type |
397 <LI>getting the repository id |
392 <LI>getting the repository id |
398 <LI>getting the typecode |
393 <LI>getting the typecode |
399 <LI>reading and writing the type from and to a stream |
394 <LI>reading and writing the type from and to a stream |
453 non-abstract interface that has at least one abstract base interface will provide |
448 non-abstract interface that has at least one abstract base interface will provide |
454 both versions of the <code>narrow</code> method. |
449 both versions of the <code>narrow</code> method. |
455 <P>The <A HREF="{@docRoot}/../technotes/guides/idl/jidlExample.html"><em>Hello World</em></A> |
450 <P>The <A HREF="{@docRoot}/../technotes/guides/idl/jidlExample.html"><em>Hello World</em></A> |
456 tutorial uses a <tt>narrow</tt> method that looks |
451 tutorial uses a <tt>narrow</tt> method that looks |
457 like this: |
452 like this: |
458 <P> |
|
459 <PRE> |
453 <PRE> |
460 // create and initialize the ORB |
454 // create and initialize the ORB |
461 ORB orb = ORB.init(args, null); |
455 ORB orb = ORB.init(args, null); |
462 |
456 |
463 // get the root naming context |
457 // get the root naming context |
464 org.omg.CORBA.Object objRef = |
458 org.omg.CORBA.Object objRef = |
465 orb.resolve_initial_references("NameService"); |
459 orb.resolve_initial_references("NameService"); |
466 // Use NamingContextExt instead of NamingContext. This is |
460 // Use NamingContextExt instead of NamingContext. This is |
467 // part of latest Inter-Operable naming Service. |
461 // part of latest Inter-Operable naming Service. |
468 NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef); |
462 NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef); |
469 |
463 |
470 // resolve the Object Reference in Naming |
464 // resolve the Object Reference in Naming |
842 IDL does not include one. Even though this release does not include an |
835 IDL does not include one. Even though this release does not include an |
843 implementation of an interface repository, the following IR classes and |
836 implementation of an interface repository, the following IR classes and |
844 interfaces have been included for the purpose of creating typecodes (see |
837 interfaces have been included for the purpose of creating typecodes (see |
845 create_value_tc, create_struct_tc, create_union_tc and create_exception_tc |
838 create_value_tc, create_struct_tc, create_union_tc and create_exception_tc |
846 methods in interface org.omg.CORBA.ORB): |
839 methods in interface org.omg.CORBA.ORB): |
847 <BR>&nbs |
840 <BR> |
848 <UL> |
841 <UL> |
849 <LI> |
842 <LI> |
850 IRObject |
843 IRObject |
851 |
844 |
852 <LI> |
845 <LI> |
891 <h2>Features That Throw NO_IMPLEMENT</h2> |
884 <h2>Features That Throw NO_IMPLEMENT</h2> |
892 |
885 |
893 <P>Some of the API included in <TT>org.omg</TT> subpackages throw |
886 <P>Some of the API included in <TT>org.omg</TT> subpackages throw |
894 <tt>NO_IMPLEMENT</tt> exceptions for various reasons. Among these reasons |
887 <tt>NO_IMPLEMENT</tt> exceptions for various reasons. Among these reasons |
895 are: |
888 are: |
896 <P> |
889 <UL> |
897 <UL> |
890 <LI>In some cases, for example <tt>LocalObject</tt>, the complete |
898 <LI>In some cases, for example <tt>LocalObject</tt>, the complete |
891 implementation according to the specification indicates that |
899 implementation according to the specification indicates that |
892 these API should throw <tt>NO_IMPLEMENT</tt>. |
900 these API should throw <tt>NO_IMPLEMENT</tt>. |
893 |
901 <P> |
894 <LI>In most cases, for example methods in <tt>ORB.java</tt>, |
902 <LI>In most cases, for example methods in <tt>ORB.java</tt>, |
895 methods that throw |
903 methods that throw |
896 <tt>NO_IMPLEMENT</tt> are actually implemented in subclasses |
904 <tt>NO_IMPLEMENT</tt> are actually implemented in subclasses |
897 elsewhere in the ORB code. |
905 elsewhere in the ORB code. |
898 |
906 <P> |
899 <LI>In some cases, for example <tt>_get_interface_def()</tt> |
907 <LI>In some cases, for example <tt>_get_interface_def()</tt> |
900 and <tt>_get_interface</tt>, API are really not yet implemented. |
908 and <tt>_get_interface</tt>, API are really not yet implemented. |
901 </UL> |
909 </UL> |
|
910 |
902 |
911 |
903 |
912 |
904 |
913 |
905 |
914 <H2> |
906 <H2> |