< prev index next >

src/java.corba/share/classes/org/omg/CosNaming/package.html

Print this page


   1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
   2 <html>
   3 <head>
   4 <!--
   5 /*
   6 * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
   7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   8 *
   9 * This code is free software; you can redistribute it and/or modify it
  10 * under the terms of the GNU General Public License version 2 only, as
  11 * published by the Free Software Foundation.  Oracle designates this
  12 * particular file as subject to the "Classpath" exception as provided
  13 * by Oracle in the LICENSE file that accompanied this code.
  14 *
  15 * This code is distributed in the hope that it will be useful, but WITHOUT
  16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  17 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  18 * version 2 for more details (a copy is included in the LICENSE file that
  19 * accompanied this code).
  20 *
  21 * You should have received a copy of the GNU General Public License version
  22 * 2 along with this work; if not, write to the Free Software Foundation,
  23 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  24 *
  25 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  26 * or visit www.oracle.com if you need additional information or have any


  28 */ 
  29 -->
  30 </head>
  31 <body bgcolor="white">
  32 
  33   Provides a naming service for Java&nbsp;IDL.  The Object Request Broker Daemon
  34   (ORBD) also includes both a transient and persistent naming service.
  35   
  36 
  37   <P>
  38   The package and all its classes and interfaces 
  39   were generated by running the tool <code>idlj</code> on the file
  40   <code>nameservice.idl</code>, which is a module written in OMG IDL.
  41   
  42   <H3>Package Specification</H3>
  43  
  44 <P>For a precise list of supported sections of official specifications with which 
  45 the Java[tm] Platform, Standard Edition 6, ORB complies, see <A 
  46 HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA 
  47 support in Java[tm] SE 6</A>.
  48   <P>
  49   <H2>Interfaces</H2>
  50   The package <tt>org.omg.CosNaming</tt> contains two public interfaces
  51   and several auxiliary classes. 
  52   <P>
  53   The interfaces are:
  54   <UL>
  55   <LI><TT>NamingContext</TT> 
  56   <LI><TT>BindingIterator</TT> 
  57   </UL>
  58   <P>
  59   These two interfaces provide the means to bind/unbind names and object
  60   references, to retrieve bound object references, and
  61   to iterate through a list of bindings.  The <code>NamingContext</code>
  62   interface supplies the main functionality for the naming service, and
  63   <code>BindingIterator</code> provides a means of iterating through a list
  64   of name/object reference bindings.
  65   <P>
  66   <H2>Auxiliary Classes</H2>
  67   In order to map an OMG IDL interface to the Java programming language,
  68   the idlj compiler creates Java classes that can be thought of
  69   as auxiliary classes.
  70   Comments for the generated auxiliary classes
  71   used by the interfaces <code>NamingContext</code> and 
  72   <code>BindingIterator</code> are included here.
  73   <P>
  74   <H3>Classes Used by <code>NamingContext</code> and
  75   <code>BindingIterator</code></H3>
  76   The following are classes used by
  77   the naming service.  (Helper and  holder classes, which are
  78   generated for each of the classes listed here,  are discussed below.)
  79  
  80   <UL>
  81     <LI><code>public final class <B>NameComponent</B></code> -- 
  82     a building block for names.  (Names are bound to object references
  83     in a naming context.)
  84     <P>A name is an array of one or more <code>NameComponent</code> objects.
  85     A name with a single <code>NameComponent</code> is called
  86     a <I>simple name</I>; a name with multiple <code>NameComponent</code>
  87     objects is called a <I>compound name</I>.
  88     <P>
  89     A <code><B>NameComponent</B></code> object consists of two fields:
  90     <OL>
  91     <LI><code><B>id</B></code> -- a <code>String</code> used as an identifier
  92     <LI><code><B>kind</B></code> -- a <code>String</code> that can be used for 
  93 any
  94     descriptive purpose.  Its importance is that it
  95     can be used to describe an object without affecting syntax.
  96     The C programming language, for example, uses the the syntactic convention
  97     of appending the extension ".c" to a file name to indicate that it is
  98     a source code file.  In a <code>NameComponent</code> object,
  99     the <code>kind</code> field can be used to describe the type of object
 100     rather than a file extension or some other syntactic convention.
 101     Examples of the value of the <code>kind</code> field include the strings
 102     <code>"c_source"</code>, <code>"object_code"</code>,
 103     <code>"executable"</code>, 
 104     <code>"postscript"</code>, and <code>""</code>.  It is not unusual
 105         for the <code>kind</code> field to be the empty string.
 106     </OL>
 107     <P>
 108     In a name, each <code>NameComponent</code> object except the last denotes
 109     a <code>NamingContext</code> object; the last <code>NameComponent</code>
 110     object denotes the bound object reference.
 111     This is similar to a path name, in which the last name is the
 112     file name, and all names before it are directory names.<p>
 113     <P>
 114    
 115     <LI><code>public final class <B>Binding</B></code> -- 
 116     an object that associates a name with an object reference or a
 117     naming context.
 118     A <code>Binding</code> object has two fields:
 119     <OL>
 120     <LI><code><B>binding_name</B></code> - an array of one or more
 121     <code>NameComponent</code> objects that represents the bound name
 122     <LI><code><B>binding_type</B></code> - a <code>BindingType</code> object
 123     indicating whether the binding is between a name and an object
 124     reference or between a name and a naming context
 125     </OL>
 126     <P>
 127     The interface <code>NamingContext</code> has methods for
 128         binding/unbinding names with object references or naming contexts,
 129         for listing bindings,
 130     and for resolving bindings (given a name, the method
 131     <code>resolve</code> returns the object reference bound to it).
 132    
 133   <P>
 134   <LI><code>public final class <B>BindingType</B></code> --
 135     an object that specifies whether the given <code>Binding</code>
 136     object is a binding between a name and an object reference (that is,
 137     not a naming context) or between a name and a naming context.
 138     <P>
 139     The class<code>BindingType</code> consists of two methods and
 140         four constants. Two of these constants are
 141         <code>BindingType</code> objects, and two are <code>int</code>s.
 142         <P>
 143         The <code>BindingType</code> objects
 144     can be passed to the constructor for the class
 145     <code>Binding</code> or used as parameters or return values.  These
 146         <code>BindingType</code> objects are:
 147     <UL>
 148     <LI><code>public static final BindingType <B>nobject</B></code> -- 
 149         to indicate that the binding is with an object reference
 150     <LI><code>public static final BindingType <B>ncontext</B></code> -- 
 151         to indicate that the binding is with a naming context
 152     </UL>
 153     <P>


 291 <code>CosNaming</code> and the third-party vendor's implementation.
 292 However, it is important to understand that there can be minor
 293 variations in the way different vendors implement the naming service,
 294 such as differences in the exception strings.
 295 
 296 <h3>Instructions for Using a Third Party's Naming Service</h3>
 297 Although we encourage using an ORB and ORB services that are both
 298 from one vendor, it is possible to plug in a third party's 
 299 <code>COSNaming</code> implementation with Sun's RMI-IIOP ORB.
 300 Here are the steps to follow:
 301 <OL>
 302   <LI>Create a properties file for the Bootstrap server and give it
 303       two entries.  For example, you could call this properties file 
 304       <code>/tmp/services</code> and put the following in it:
 305       <code>NameService, &lt;Stringified IOR of the Root Naming 
 306 Context&gt;</code>.
 307       <P>
 308       This associates <code>NameService</code> with the Root Naming
 309       Context of the <code>CosNaming</code> implementation that you 
 310       want to use.
 311           <P>
 312   <LI>Start the standalone Bootstrap server using the following command:
 313   <pre>
 314       <code>
 315       java -classpath $(CLASSPATH)
 316       com.sun.corba.ee.internal.CosNaming.BootstrapServer -InitialServicesFile
 317       "/tmp/services" [-ORBInitialPort port]
 318       </code>
 319   </pre>
 320   <P>
 321   Note that the square brackets at the end of the command indicate that
 322   specifying a port number is optional.
 323 </OL>
 324 <P>
 325 Now when an application calls the method 
 326 <code>org.omg.CORBA.ORB.resolve_initial_references</code>, CORBA
 327 processes will contact the Bootstrap Server to get the Root Naming
 328 Context.
 329 
 330 <h2>Package Specification</h2>
 331 


   1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
   2 <html>
   3 <head>
   4 <!--
   5 /*
   6 * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
   7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   8 *
   9 * This code is free software; you can redistribute it and/or modify it
  10 * under the terms of the GNU General Public License version 2 only, as
  11 * published by the Free Software Foundation.  Oracle designates this
  12 * particular file as subject to the "Classpath" exception as provided
  13 * by Oracle in the LICENSE file that accompanied this code.
  14 *
  15 * This code is distributed in the hope that it will be useful, but WITHOUT
  16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  17 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  18 * version 2 for more details (a copy is included in the LICENSE file that
  19 * accompanied this code).
  20 *
  21 * You should have received a copy of the GNU General Public License version
  22 * 2 along with this work; if not, write to the Free Software Foundation,
  23 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  24 *
  25 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  26 * or visit www.oracle.com if you need additional information or have any


  28 */ 
  29 -->
  30 </head>
  31 <body bgcolor="white">
  32 
  33   Provides a naming service for Java&nbsp;IDL.  The Object Request Broker Daemon
  34   (ORBD) also includes both a transient and persistent naming service.
  35 
  36 
  37   <P>
  38   The package and all its classes and interfaces 
  39   were generated by running the tool <code>idlj</code> on the file
  40   <code>nameservice.idl</code>, which is a module written in OMG IDL.
  41 
  42   <H3>Package Specification</H3>
  43 
  44 <P>For a precise list of supported sections of official specifications with which 
  45 the Java[tm] Platform, Standard Edition 6, ORB complies, see <A 
  46 HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA 
  47 support in Java[tm] SE 6</A>.
  48 
  49   <H2>Interfaces</H2>
  50   The package <tt>org.omg.CosNaming</tt> contains two public interfaces
  51   and several auxiliary classes. 
  52   <P>
  53   The interfaces are:
  54   <UL>
  55   <LI><TT>NamingContext</TT> 
  56   <LI><TT>BindingIterator</TT> 
  57   </UL>
  58   <P>
  59   These two interfaces provide the means to bind/unbind names and object
  60   references, to retrieve bound object references, and
  61   to iterate through a list of bindings.  The <code>NamingContext</code>
  62   interface supplies the main functionality for the naming service, and
  63   <code>BindingIterator</code> provides a means of iterating through a list
  64   of name/object reference bindings.
  65 
  66   <H2>Auxiliary Classes</H2>
  67   In order to map an OMG IDL interface to the Java programming language,
  68   the idlj compiler creates Java classes that can be thought of
  69   as auxiliary classes.
  70   Comments for the generated auxiliary classes
  71   used by the interfaces <code>NamingContext</code> and 
  72   <code>BindingIterator</code> are included here.
  73 
  74   <H3>Classes Used by <code>NamingContext</code> and
  75   <code>BindingIterator</code></H3>
  76   The following are classes used by
  77   the naming service.  (Helper and  holder classes, which are
  78   generated for each of the classes listed here,  are discussed below.)
  79 
  80   <UL>
  81     <LI><code>public final class <B>NameComponent</B></code> -- 
  82     a building block for names.  (Names are bound to object references
  83     in a naming context.)
  84     <P>A name is an array of one or more <code>NameComponent</code> objects.
  85     A name with a single <code>NameComponent</code> is called
  86     a <I>simple name</I>; a name with multiple <code>NameComponent</code>
  87     objects is called a <I>compound name</I>.
  88     <P>
  89     A <code><B>NameComponent</B></code> object consists of two fields:
  90     <OL>
  91     <LI><code><B>id</B></code> -- a <code>String</code> used as an identifier
  92     <LI><code><B>kind</B></code> -- a <code>String</code> that can be used for any

  93     descriptive purpose.  Its importance is that it
  94     can be used to describe an object without affecting syntax.
  95     The C programming language, for example, uses the the syntactic convention
  96     of appending the extension ".c" to a file name to indicate that it is
  97     a source code file.  In a <code>NameComponent</code> object,
  98     the <code>kind</code> field can be used to describe the type of object
  99     rather than a file extension or some other syntactic convention.
 100     Examples of the value of the <code>kind</code> field include the strings
 101     <code>"c_source"</code>, <code>"object_code"</code>,
 102     <code>"executable"</code>, 
 103     <code>"postscript"</code>, and <code>""</code>.  It is not unusual
 104     for the <code>kind</code> field to be the empty string.
 105     </OL>
 106     <P>
 107     In a name, each <code>NameComponent</code> object except the last denotes
 108     a <code>NamingContext</code> object; the last <code>NameComponent</code>
 109     object denotes the bound object reference.
 110     This is similar to a path name, in which the last name is the
 111     file name, and all names before it are directory names.

 112 
 113     <LI><code>public final class <B>Binding</B></code> -- 
 114     an object that associates a name with an object reference or a
 115     naming context.
 116     A <code>Binding</code> object has two fields:
 117     <OL>
 118     <LI><code><B>binding_name</B></code> - an array of one or more
 119     <code>NameComponent</code> objects that represents the bound name
 120     <LI><code><B>binding_type</B></code> - a <code>BindingType</code> object
 121     indicating whether the binding is between a name and an object
 122     reference or between a name and a naming context
 123     </OL>
 124     <P>
 125     The interface <code>NamingContext</code> has methods for
 126     binding/unbinding names with object references or naming contexts,
 127     for listing bindings,
 128     and for resolving bindings (given a name, the method
 129     <code>resolve</code> returns the object reference bound to it).
 130 

 131     <LI><code>public final class <B>BindingType</B></code> --
 132     an object that specifies whether the given <code>Binding</code>
 133     object is a binding between a name and an object reference (that is,
 134     not a naming context) or between a name and a naming context.
 135     <P>
 136     The class<code>BindingType</code> consists of two methods and
 137     four constants. Two of these constants are
 138     <code>BindingType</code> objects, and two are <code>int</code>s.
 139     <P>
 140     The <code>BindingType</code> objects
 141     can be passed to the constructor for the class
 142     <code>Binding</code> or used as parameters or return values.  These
 143     <code>BindingType</code> objects are:
 144     <UL>
 145     <LI><code>public static final BindingType <B>nobject</B></code> -- 
 146     to indicate that the binding is with an object reference
 147     <LI><code>public static final BindingType <B>ncontext</B></code> -- 
 148     to indicate that the binding is with a naming context
 149     </UL>
 150     <P>


 288 <code>CosNaming</code> and the third-party vendor's implementation.
 289 However, it is important to understand that there can be minor
 290 variations in the way different vendors implement the naming service,
 291 such as differences in the exception strings.
 292 
 293 <h3>Instructions for Using a Third Party's Naming Service</h3>
 294 Although we encourage using an ORB and ORB services that are both
 295 from one vendor, it is possible to plug in a third party's 
 296 <code>COSNaming</code> implementation with Sun's RMI-IIOP ORB.
 297 Here are the steps to follow:
 298 <OL>
 299   <LI>Create a properties file for the Bootstrap server and give it
 300       two entries.  For example, you could call this properties file 
 301       <code>/tmp/services</code> and put the following in it:
 302       <code>NameService, &lt;Stringified IOR of the Root Naming 
 303 Context&gt;</code>.
 304       <P>
 305       This associates <code>NameService</code> with the Root Naming
 306       Context of the <code>CosNaming</code> implementation that you 
 307       want to use.

 308   <LI>Start the standalone Bootstrap server using the following command:
 309   <pre>
 310       <code>
 311       java -classpath $(CLASSPATH)
 312       com.sun.corba.ee.internal.CosNaming.BootstrapServer -InitialServicesFile
 313       "/tmp/services" [-ORBInitialPort port]
 314       </code>
 315   </pre>
 316   <P>
 317   Note that the square brackets at the end of the command indicate that
 318   specifying a port number is optional.
 319 </OL>
 320 <P>
 321 Now when an application calls the method 
 322 <code>org.omg.CORBA.ORB.resolve_initial_references</code>, CORBA
 323 processes will contact the Bootstrap Server to get the Root Naming
 324 Context.
 325 
 326 <h2>Package Specification</h2>
 327 


< prev index next >