.'" t ." ." Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. ." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ." ." This code is free software; you can redistribute it and/or modify it ." under the terms of the GNU General Public License version 2 only, as ." published by the Free Software Foundation. ." ." This code is distributed in the hope that it will be useful, but WITHOUT ." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ." version 2 for more details (a copy is included in the LICENSE file that ." accompanied this code). ." ." You should have received a copy of the GNU General Public License version ." 2 along with this work; if not, write to the Free Software Foundation, ." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ." ." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ." or visit www.oracle.com if you need additional information or have any ." questions. ." ." ` tnameserv - Online Linux Manual PageSection : 1
Updated : 06 Aug 2006
." Generated by html2man
NAMEJava IDL: Transient Naming Service − tnameserv This document discusses using the Java IDL Transient Naming Service, tnameserv. Java IDL also includes the Object Request Broker Daemon (ORBD). ORBD is a daemon process containing a Bootstrap Service, a Transient Naming Service, a Persistent Naming Service, and a Server Manager. The Java IDL tutorials all use ORBD, however, you can substitute tnameserv for orbd in any of the examples that use a Transient Naming Service. For documentation on the orbd tool, link to its man page or the Java IDL Naming Service Included with ORBD @ .fi http://java.sun.com/javase/6/docs/technotes/guides/idl/jidlNaming.html topic. Topics in this section include: o Java IDL Transient Naming Service o Starting the Java IDL Transient Naming Service o Stopping the Java IDL Transient Naming Service o Sample Client: Adding Objects to the Namespace o Sample Client: Browsing the Namespace
Java IDL Transient Naming ServiceThe CORBA COS (Common Object Services) Naming Service provides a tree−like directory for object references much like a filesystem provides a directory structure for files. The Transient Naming Service provided with Java IDL, tnameserv, is a simple implementation of the COS Naming Service specification. Object references are stored in the namespace by name and each object reference−name pair is called a name binding. Name bindings may be organized under naming contexts. Naming contexts are themselves name bindings and serve the same organizational function as a file system subdirectory. All bindings are stored under the initial naming context. The initial naming context is the only persistent binding in the namespace; the rest of the namespace is lost if the Java IDL naming service process halts and restarts. For an applet or application to use COS naming, its ORB must know the port of a host running a naming service or have access to a stringified initial naming context for that naming service. The naming service can either be the Java IDL naming service or another COS−compliant naming service.
Starting the Java IDL Transient Naming ServiceYou must start the Java IDL naming service before an application or applet that uses its naming service. Installation of the Java IDL product creates a script (Solaris: tnameserv) or executable file (Windows NT: tnameserv.exe) that starts the Java IDL naming service. Start the naming service so it runs in the background. If you do not specify otherwise, the Java IDL naming service listens on port 900 for the bootstrap protocol used to implement the ORB resolve_initial_references() and list_initial_references() methods, as follows:
fl tnameserv −ORBInitialPort \f4nameserverport\fP\f3&
flIf you do not specify the name server port, port 900 is used by default. When running Solaris software, you must become root to start a process on a port under 1024. For this reason, we recommend that you use a port number greater than or equal to 1024. To specify a different port, for example, 1050, and to run the naming service in the background, from a UNIX command shell, enter:
fl tnameserv −ORBInitialPort 1050&
flFrom an MS−DOS system prompt (Windows), enter:
fl start tnameserv −ORBInitialPort 1050
flClients of the name server must be made aware of the new port number. Do this by setting the org.omg.CORBA.ORBInitialPort property to the new port number when creating the ORB object.
Running the server and client on different hosts In most of the Java IDL and RMI−IIOP tutorials, the Naming Service, Server, and Client are all running on the development machine. In real world deployment, it is likely that the client and server will run on different host machines than the Naming Service. For the client and server to find the Naming Service, they must be made aware of the port number and host on which the naming service is running. Do this by setting the org.omg.CORBA.ORBInitialPort and org.omg.CORBA.ORBInitialHost properties in the client and server files to the machine name and port number on which the Naming Service is running. An example of this is shown in The Hello World Example Using RMI−IIOP @ .fi http://java.sun.com/javase/6/docs/technotes/guides/rmi−iiop/rmiiiopexample.html. You could also use the command line options −ORBInitialPort nameserverport# and −ORBInitialHost nameserverhostname to tell the client and server where to find the Naming Service. Java IDL: Running the Hello World Example on TWO Machines @ .fi http://java.sun.com/javase/6/docs/technotes/guides/idl/tutorial/jidl2machines.html shows one way of doing this using the command line option. For example, suppose the Transient Naming Service, tnameserv is running on port 1050 on host nameserverhost. The client is running on host clienthost and the server is running on host serverhost. o Start tnameserv on the host nameserverhost, as follows:
fl tnameserv −ORBInitialPort 1050
fl
flo Start the server on the serverhost, as follows:
fl java Server −ORBInitialPort 1050 −ORBInitialHost nameserverhost
flo Start the client on the clienthost, as follows:
fl java Client −ORBInitialPort 1050 −ORBInitialHost nameserverhost
fl
The −J option This command−line option is available for use with tnameserve: −Joption Pass option to the Java virtual machine, where option is one of the options described on the reference page for the java application launcher @ .fi http://java.sun.com/javase/6/docs/technotes/tools/solaris/java.html. For example, −J−Xms48m sets the startup memory to 48 megabytes. It is a common convention for −J to pass options to the underlying virtual machine.
Stopping the Java IDL Transient Naming ServiceTo stop the Java IDL naming service, use the relevant operating system command, such as kill for a Unix process, or Ctrl−C for a Windows process. The naming service will continue to wait for invocations until it is explicitly shutdown. Note that names registered with the Java IDL naming service disappear when the service is terminated.
Sample Client: Adding Objects to the NamespaceThe following sample program illustrates how to add names to the namespace. It is a self−contained Transient Naming Service client that creates the following simple tree.
fl
fl \f4Initial\fP\f3
fl \f4Naming Context\fP\f3
fl /
fl /
fl plans \f4Personal\fP\f3
fl /
fl /
fl calendar schedule
fl.fi
In this example, plans is an object reference and Personal is a naming context that contains two object references: calendar and schedule.
flimport java.util.Properties;
flimport org.omg.CORBA.*;
flimport org.omg.CosNaming.*;
fl
flpublic class NameClient
fl{
fl public static void main(String args[])
fl {
fl try {
flIn the above section, Starting the Java IDL Transient Naming Service, the nameserver was started on port 1050. The following code ensures that the client program is aware of this port number.
fl Properties props = new Properties();
fl props.put("org.omg.CORBA.ORBInitialPort", "1050");
fl ORB orb = ORB.init(args, props);
fl
flThis code obtains the initial naming context and assigns it to ctx. The second line copies ctx into a dummy object reference objref that we'll attach to various names and add into the namespace.
fl NamingContext ctx =
flNamingContextHelper.narrow(orb.resolve_initial_references("NameService"));
fl NamingContext objref = ctx;
fl
flThis code creates a name "plans" of type "text" and binds it to our dummy object reference. "plans" is then added under the initial naming context using rebind. The rebind method allows us to run this program over and over again without getting the exceptions we'd get from using bind.
fl NameComponent nc1 = new NameComponent("plans", "text");
fl NameComponent[] name1 = {nc1};
fl ctx.rebind(name1, objref);
fl System.out.println("plans rebind sucessful!");
fl
flThis code creates a naming context called "Personal" of type "directory". The resulting object reference, ctx2, is bound to the name and added under the initial naming context.
fl NameComponent nc2 = new NameComponent("Personal", "directory");
fl NameComponent[] name2 = {nc2};
fl NamingContext ctx2 = ctx.bind_new_context(name2);
fl System.out.println("new naming context added..");
fl
flThe remainder of the code binds the dummy object reference using the names "schedule" and "calendar" under the "Personal" naming context (ctx2).
fl NameComponent nc3 = new NameComponent("schedule", "text");
fl NameComponent[] name3 = {nc3};
fl ctx2.rebind(name3, objref);
fl System.out.println("schedule rebind sucessful!");
fl
fl NameComponent nc4 = new NameComponent("calender", "text");
fl NameComponent[] name4 = {nc4};
fl ctx2.rebind(name4, objref);
fl System.out.println("calender rebind sucessful!");
fl
fl
fl } catch (Exception e) {
fl e.printStackTrace(System.err);
fl }
fl }
fl}
fl
Sample Client: Browsing the NamespaceThe following sample program illustrates how to browse the namespace.
flimport java.util.Properties;
flimport org.omg.CORBA.*;
flimport org.omg.CosNaming.*;
fl
flpublic class NameClientList
fl{
fl public static void main(String args[])
fl {
fl try {
flIn the above section, Starting the Java IDL Transient Naming Service, the nameserver was started on port 1050. The following code ensures that the client program is aware of this port number.
fl
fl Properties props = new Properties();
fl props.put("org.omg.CORBA.ORBInitialPort", "1050");
fl ORB orb = ORB.init(args, props);
fl
fl
flThe following code obtains the intial naming context.
fl NamingContext nc =
flNamingContextHelper.narrow(orb.resolve_initial_references("NameService"));
fl
flThe list method lists the bindings in the naming context. In this case, up to 1000 bindings from the initial naming context will be returned in the BindingListHolder; any remaining bindings are returned in the BindingIteratorHolder.
fl BindingListHolder bl = new BindingListHolder();
fl BindingIteratorHolder blIt= new BindingIteratorHolder();
fl nc.list(1000, bl, blIt);
fl
flThis code gets the array of bindings out of the returned BindingListHolder. If there are no bindings, the program ends.
fl Binding bindings[] = bl.value;
fl if (bindings.length == 0) return;
fl
flThe remainder of the code loops through the bindings and prints the names out.
fl for (int i=0; i < bindings.length; i++) {
fl
fl // get the object reference for each binding
fl org.omg.CORBA.Object obj = nc.resolve(bindings[i].binding_name);
fl String objStr = orb.object_to_string(obj);
fl int lastIx = bindings[i].binding_name.length−1;
fl
fl // check to see if this is a naming context
fl if (bindings[i].binding_type == BindingType.ncontext) {
fl System.out.println( "Context: " +
flbindings[i].binding_name[lastIx].id);
fl } else {
fl System.out.println("Object: " +
flbindings[i].binding_name[lastIx].id);
fl }
fl }
fl
fl } catch (Exception e) {
fl e.printStackTrace(System.err);
fl }
fl }
fl}
fl 0
Johanes Gumabo
Data Size : 39,936 byte
man-tnameserv-java-1.6.0-openjdk.1Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 181,620
Visitor ID : :
Visitor IP : 18.191.205.110 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|1|'"|.'" t
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|2|"|."
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|3|"|." Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|4|"|." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|5|"|."
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|6|"|." This code is free software; you can redistribute it and/or modify it
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|7|"|." under the terms of the GNU General Public License version 2 only, as
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|8|"|." published by the Free Software Foundation.
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|9|"|."
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|10|"|." This code is distributed in the hope that it will be useful, but WITHOUT
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|11|"|." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|12|"|." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|13|"|." version 2 for more details (a copy is included in the LICENSE file that
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|14|"|." accompanied this code).
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|15|"|."
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|16|"|." You should have received a copy of the GNU General Public License version
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|17|"|." 2 along with this work; if not, write to the Free Software Foundation,
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|18|"|." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|19|"|."
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|20|"|." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|21|"|." or visit www.oracle.com if you need additional information or have any
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|22|"|." questions.
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|23|"|."
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|24|"|." `
) (parse_manual_page_|249|tnameserv-java-1.6.0-openjdk.1|26|"|." Generated by html2man
) (rof_fi|19|tnameserv-java-1.6.0-openjdk.1|38|1|.fi
) (rof_escape_sequence|91|tnameserv-java-1.6.0-openjdk.1|85|\f4nameserverport\fP\f3&|fl tnameserv \-ORBInitialPort \fP\f4nameserverport\fP\f3&
) (rof_fi|19|tnameserv-java-1.6.0-openjdk.1|128|1|.fi
) (rof_fi|19|tnameserv-java-1.6.0-openjdk.1|132|1|.fi
) (rof_fi|19|tnameserv-java-1.6.0-openjdk.1|186|1|.fi
) (rof_escape_sequence|91|tnameserv-java-1.6.0-openjdk.1|205|\f4Initial\fP\f3|fl \fP\f4Initial\fP\f3
) (rof_escape_sequence|91|tnameserv-java-1.6.0-openjdk.1|207|\f4Naming Context\fP\f3|fl \fP\f4Naming Context\fP\f3
) (rof_escape_sequence|91|tnameserv-java-1.6.0-openjdk.1|213|\f4Personal\fP\f3|fl plans \fP\f4Personal\fP\f3
)