author | aph |
Thu, 17 Mar 2016 17:03:20 +0000 | |
changeset 36799 | 982e1880e05e |
parent 31876 | 91b22707521a |
permissions | -rw-r--r-- |
23600 | 1 |
'\" t |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
2 |
.\" Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. |
23600 | 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. |
|
8 |
.\" |
|
9 |
.\" This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
11 |
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
23600 | 12 |
.\" version 2 for more details (a copy is included in the LICENSE file that |
13 |
.\" accompanied this code). |
|
14 |
.\" |
|
15 |
.\" You should have received a copy of the GNU General Public License version |
|
16 |
.\" 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
.\" |
|
19 |
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
.\" or visit www.oracle.com if you need additional information or have any |
|
21 |
.\" questions. |
|
22 |
.\" |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
23 |
.\" Title: tnameserv |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
24 |
.\" Language: Japanese |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
25 |
.\" Date: 2013年11月21日 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
26 |
.\" SectDesc: Java IDLおよびRMI-IIOPツール |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
27 |
.\" Software: JDK 8 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
28 |
.\" Arch: 汎用 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
29 |
.\" Part Number: E58103-01 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
30 |
.\" Doc ID: JSSON |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
31 |
.\" |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
32 |
.if n .pl 99999 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
33 |
.TH "tnameserv" "1" "2013年11月21日" "JDK 8" "Java IDLおよびRMI-IIOPツール" |
23600 | 34 |
.\" ----------------------------------------------------------------- |
35 |
.\" * Define some portability stuff |
|
36 |
.\" ----------------------------------------------------------------- |
|
37 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
38 |
.\" http://bugs.debian.org/507673 |
|
39 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
|
40 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
41 |
.ie \n(.g .ds Aq \(aq |
|
42 |
.el .ds Aq ' |
|
43 |
.\" ----------------------------------------------------------------- |
|
44 |
.\" * set default formatting |
|
45 |
.\" ----------------------------------------------------------------- |
|
46 |
.\" disable hyphenation |
|
47 |
.nh |
|
48 |
.\" disable justification (adjust text to left margin only) |
|
49 |
.ad l |
|
50 |
.\" ----------------------------------------------------------------- |
|
51 |
.\" * MAIN CONTENT STARTS HERE * |
|
52 |
.\" ----------------------------------------------------------------- |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
53 |
.SH "名前" |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
54 |
tnameserv \- インタフェース定義言語(IDL)。 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
55 |
.SH "概要" |
23600 | 56 |
.sp |
57 |
.if n \{\ |
|
58 |
.RS 4 |
|
59 |
.\} |
|
60 |
.nf |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
61 |
\fBtnameserve\fR \fB\-ORBInitialPort\fR [ \fInameserverport\fR ] |
2 | 62 |
.fi |
23600 | 63 |
.if n \{\ |
64 |
.RE |
|
65 |
.\} |
|
66 |
.PP |
|
67 |
\-ORBInitialPort \fInameserverport\fR |
|
68 |
.RS 4 |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
69 |
ネーミング・サービスがORBの\fBresolve_initial_references\fRメソッドと\fBlist_initial_references\fRメソッドの実装に使用するブートストラップ・プロトコルをリスニングする初期ポートです。 |
23600 | 70 |
.RE |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
71 |
.SH "説明" |
23600 | 72 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
73 |
Java IDLには、Object Request Broker Daemon (ORBD)が含まれます。ORBDは、ブートストラップ・サービス、一時ネーミング・サービス、永続ネーミング・サービスおよびサーバー・マネージャを含むデーモン・プロセスです。Java IDLのすべてのチュートリアルではORBDを使用していますが、一時ネーミング・サービスを使用する例では、\fBorbd\fRのかわりに\fBtnameserv\fRを使用できます。 |
23600 | 74 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
75 |
orbd(1)http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
76 |
にあるまたは「Naming Service」を参照してください。 |
23600 | 77 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
78 |
CORBAのCOS (Common Object Services)ネーミング・サービスは、ファイル・システムがファイルに対してディレクトリ構造を提供しているのと同じように、オブジェクト参照に対してツリー構造のディレクトリを提供します。Java IDLの一時ネーム・サービスである\fBtnameserv\fRは、COSネーム・サービスの仕様を単純な形で実装したものです。 |
23600 | 79 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
80 |
オブジェクト参照はネームスペースに名前で格納され、オブジェクト参照と名前のペアは、それぞれネーム・バインディングと呼ばれます。ネーム・バインディングはネーミング・コンテキストに組み込むことができます。ネーミング・コンテキストはネーム・バインディングであり、ファイル・システムのサブディレクトリと同じ編成機能を持ちます。すべてのバインディングは初期ネーミング・コンテキストの下に格納されます。初期ネーミング・コンテキストは、ネームスペースの唯一の永続バインディングです。Java IDLネーミング・サービス・プロセスを停止して再起動すると、残りのネームスペースは失われます。 |
23600 | 81 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
82 |
アプレットまたはアプリケーションからCOSネーミング・サービスを使用するためには、そのORBがネーミング・サービスが動作しているホストのポートを知っているか、そのネーミング・サービスの初期ネーミング・コンテキスト文字列にアクセスできる必要があります。ネーム・サービスは、Java IDLのネーム・サービスでもその他のCOS準拠のネーム・サービスでもかまいません。 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
83 |
.SS "ネーミング・サービスの起動" |
23600 | 84 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
85 |
Java IDLネーム・サービスは、ネーム・サービスを使用するアプリケーションまたはアプレットより前に起動しておく必要があります。Java IDL製品をインストールすると、Java IDLネーミング・サービスを起動するスクリプト(Oracle Solaris: |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
86 |
\fBtnameserv\fR)または実行可能ファイル(Windows: |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
87 |
\fBtnameserv\&.exe\fR)が作成されます。バックグラウンドで動作するように、ネーム・サービスを起動してください。 |
23600 | 88 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
89 |
特に指定しない場合、Java IDLネーミング・サービスは、ORBの\fBresolve_initial_references\fRメソッドと\fBlist_initial_references methods\fRメソッドの実装に使用するブートストラップ・プロトコルに対してポート900でリスニングします。 |
23600 | 90 |
.sp |
91 |
.if n \{\ |
|
92 |
.RS 4 |
|
93 |
.\} |
|
94 |
.nf |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
95 |
\fBtnameserv \-ORBInitialPort nameserverport&\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
96 |
|
23600 | 97 |
.fi |
98 |
.if n \{\ |
|
99 |
.RE |
|
100 |
.\} |
|
101 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
102 |
ネーム・サーバー・ポートを指定しない場合、デフォルトでポート900が使用されます。Oracle Solarisソフトウェアの実行時、1024より小さいポートでプロセスを開始する場合は、rootユーザーになる必要があります。このため、1024以上のポート番号を使用することをお薦めします。1050のように別のポートを指定し、ネーム・サービスをバックグラウンドで実行するには、Solaris、LinuxまたはOS Xコマンド・シェルで次のように入力します。 |
23600 | 103 |
.sp |
104 |
.if n \{\ |
|
105 |
.RS 4 |
|
106 |
.\} |
|
107 |
.nf |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
108 |
\fBtnameserv \-ORBInitialPort 1050&\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
109 |
|
23600 | 110 |
.fi |
111 |
.if n \{\ |
|
2 | 112 |
.RE |
23600 | 113 |
.\} |
114 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
115 |
WindowsのMS\-DOSシステム・プロンプトでは、次のように入力します。 |
23600 | 116 |
.sp |
117 |
.if n \{\ |
|
118 |
.RS 4 |
|
119 |
.\} |
|
2 | 120 |
.nf |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
121 |
\fBstart tnameserv \-ORBInitialPort 1050\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
122 |
|
2 | 123 |
.fi |
23600 | 124 |
.if n \{\ |
125 |
.RE |
|
126 |
.\} |
|
127 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
128 |
ネーム・サーバーのクライアントには、新しいポート番号を知らせる必要があります。これを行うには、ORBオブジェクトの作成時に\fBorg\&.omg\&.CORBA\&.ORBInitialPort\fRプロパティに新しいポート番号を設定します。 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
129 |
.SS "異なるホスト上でのサーバーとクライアントの実行" |
23600 | 130 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
131 |
Java IDLとRMI\-IIOPのほとんどのチュートリアルでは、ネーミング・サービス、サーバーおよびクライアントはすべて開発用のマシン上で実行されます。実際にデプロイメントする場合には、クライアントとサーバーを、ネーミング・サービスとは異なるホスト・マシン上で実行することが多くなります。 |
23600 | 132 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
133 |
クライアントとサーバーがネーム・サービスを見つけるには、クライアントとサーバーが、ネーム・サービスが実行されているポートの番号とホストを認識している必要があります。そのためには、クライアントとサーバーのファイル内の\fBorg\&.omg\&.CORBA\&.ORBInitialPort\fRプロパティと\fBorg\&.omg\&.CORBA\&.ORBInitialHost\fRプロパティをネーム・サービスが実行されているポートの番号とマシンの名前に設定します。この例は、「Getting Started Using RMI\-IIOP」 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
134 |
(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi\-iiop/rmiiiopexample\&.html)に示されています |
23600 | 135 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
136 |
コマンド行オプション\fB\-ORBInitialPort nameserverport#\fRと\fB\-ORBInitialHost nameserverhostname\fRを使用して、クライアントとサーバーに対してネーミング・サービスを探す場所を指定することもできます。コマンド行オプションを使用してこれを行う方法の1つの例は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.htmlの「Java IDL: The Hello World Example on Two Machines」 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
137 |
を参照してください |
23600 | 138 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
139 |
たとえば、一時ネーム・サービス\fBtnameserv\fRが、ホスト\fBnameserverhost\fRのポート1050上で実行されているとします。さらに、クライアントがホスト\fBclienthost\fR上で実行され、サーバーはホスト\fBserverhost\fR上で実行されているとします。 |
23600 | 140 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
141 |
ホスト\fBnameserverhost\fR上で\fBtnameserv\fRを起動します。 |
23600 | 142 |
.sp |
143 |
.if n \{\ |
|
144 |
.RS 4 |
|
145 |
.\} |
|
2 | 146 |
.nf |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
147 |
\fBtnameserv \-ORBInitialPort 1050\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
148 |
|
2 | 149 |
.fi |
23600 | 150 |
.if n \{\ |
151 |
.RE |
|
152 |
.\} |
|
153 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
154 |
\fBserverhost\fR上でサーバーを起動します。 |
23600 | 155 |
.sp |
156 |
.if n \{\ |
|
157 |
.RS 4 |
|
158 |
.\} |
|
2 | 159 |
.nf |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
160 |
\fBjava Server \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
161 |
|
2 | 162 |
.fi |
23600 | 163 |
.if n \{\ |
164 |
.RE |
|
165 |
.\} |
|
166 |
.PP |
|
2 | 167 |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
168 |
\fBclienthost\fR上でクライアントを起動します。 |
23600 | 169 |
.sp |
170 |
.if n \{\ |
|
171 |
.RS 4 |
|
172 |
.\} |
|
2 | 173 |
.nf |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
174 |
\fBjava Client \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
175 |
|
2 | 176 |
.fi |
23600 | 177 |
.if n \{\ |
178 |
.RE |
|
179 |
.\} |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
180 |
.SS "ネーミング・サービスの停止" |
23600 | 181 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
182 |
Java IDLネーミング・サービスを停止するには、Solaris、LinuxまたはOS Xの場合は、\fBkill\fRなどのオペレーティング・システムのコマンドを使用し、Windowsの場合は、\fB[Ctrl]+[C]\fRキーを使用します。ネーミング・サービスを明示的に停止するまでは、呼出し待機状態が続きます。サービスを終了させると、Java IDLネーム・サービスに登録されている名前は失われます。 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
183 |
.SH "オプション" |
23600 | 184 |
.PP |
185 |
\-J\fIoption\fR |
|
186 |
.RS 4 |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
187 |
Java Virtual Machineに\fBoption\fRを渡します。\fBoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fB\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 |
2 | 188 |
.RE |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
189 |
.SH "例" |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
190 |
.SS "ネームスペースへのオブジェクトの追加" |
23600 | 191 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
192 |
次の例では、ネームスペースに名前を追加する方法を示します。このサンプル・プログラムは、自己完結型の一時ネーム・サービス・クライアントで、次のような単純なツリーを作成するものです。 |
23600 | 193 |
.sp |
194 |
.if n \{\ |
|
195 |
.RS 4 |
|
196 |
.\} |
|
2 | 197 |
.nf |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
198 |
\fBInitial Naming Context\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
199 |
\fB plans\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
200 |
\fB Personal\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
201 |
\fB calendar\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
202 |
\fB schedule\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
203 |
|
2 | 204 |
.fi |
23600 | 205 |
.if n \{\ |
206 |
.RE |
|
207 |
.\} |
|
208 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
209 |
この例で、\fBplans\fRはオブジェクト参照、\fBPersonal\fRは\fBcalendar\fRと\fBschedule\fRの2つのオブジェクト参照を含むネーミング・コンテキストです。 |
23600 | 210 |
.sp |
211 |
.if n \{\ |
|
212 |
.RS 4 |
|
213 |
.\} |
|
2 | 214 |
.nf |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
215 |
\fBimport java\&.util\&.Properties;\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
216 |
\fBimport org\&.omg\&.CORBA\&.*;\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
217 |
\fBimport org\&.omg\&.CosNaming\&.*;\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
218 |
\fB \fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
219 |
\fBpublic class NameClient {\fR |
23600 | 220 |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
221 |
\fB public static void main(String args[]) {\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
222 |
|
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
223 |
\fB try {\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
224 |
|
23600 | 225 |
.fi |
226 |
.if n \{\ |
|
227 |
.RE |
|
228 |
.\} |
|
229 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
230 |
ネーミング・サービスの起動で、\fBnameserver\fRはポート1050で起動されました。次のコードで、このポート番号をクライアント・システムに知らせます。 |
23600 | 231 |
.sp |
232 |
.if n \{\ |
|
233 |
.RS 4 |
|
234 |
.\} |
|
235 |
.nf |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
236 |
\fB Properties props = new Properties();\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
237 |
\fB props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
238 |
\fB ORB orb = ORB\&.init(args, props);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
239 |
|
23600 | 240 |
.fi |
241 |
.if n \{\ |
|
242 |
.RE |
|
243 |
.\} |
|
244 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
245 |
次のコードでは、初期ネーミング・コンテキストを取得し、それを\fBctx\fRに代入します。2行目では、\fBctx\fRをダミーのオブジェクト参照\fBobjref\fRにコピーします。このobjrefには、あとで様々な名前を割り当ててネームスペースに追加します。 |
23600 | 246 |
.sp |
247 |
.if n \{\ |
|
248 |
.RS 4 |
|
249 |
.\} |
|
250 |
.nf |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
251 |
\fB NamingContext ctx =\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
252 |
\fB NamingContextHelper\&.narrow(\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
253 |
\fB orb\&.resolve_initial_references("NameService"));\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
254 |
\fB NamingContext objref = ctx;\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
255 |
|
23600 | 256 |
.fi |
257 |
.if n \{\ |
|
258 |
.RE |
|
259 |
.\} |
|
260 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
261 |
次のコードでは、\fBtext\fRタイプの名前\fBplans\fRを作成し、それをダミーのオブジェクト参照にバインドします。その後、\fBrebind\fRメソッドを使用して初期ネーミング・コンテキストの下に\fBplans\fRを追加しています。\fBrebind\fRメソッドを使用すれば、\fBbind\fRメソッドを使用した場合に発生する例外を発生させずに、このプログラムを何度も繰返し実行できます。 |
23600 | 262 |
.sp |
263 |
.if n \{\ |
|
264 |
.RS 4 |
|
265 |
.\} |
|
266 |
.nf |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
267 |
\fB NameComponent nc1 = new NameComponent("plans", "text");\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
268 |
\fB NameComponent[] name1 = {nc1};\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
269 |
\fB ctx\&.rebind(name1, objref);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
270 |
\fB System\&.out\&.println("plans rebind successful!");\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
271 |
|
2 | 272 |
.fi |
23600 | 273 |
.if n \{\ |
274 |
.RE |
|
275 |
.\} |
|
276 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
277 |
次のコードでは、\fBdirectory\fRタイプの\fBPersonal\fRというネーミング・コンテキストを作成します。その結果得られるオブジェクト参照\fBctx2\fRを\fBname\fRにバインドし、初期ネーミング・コンテキストに追加します。 |
23600 | 278 |
.sp |
279 |
.if n \{\ |
|
280 |
.RS 4 |
|
281 |
.\} |
|
282 |
.nf |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
283 |
\fB NameComponent nc2 = new NameComponent("Personal", "directory");\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
284 |
\fB NameComponent[] name2 = {nc2};\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
285 |
\fB NamingContext ctx2 = ctx\&.bind_new_context(name2);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
286 |
\fB System\&.out\&.println("new naming context added\&.\&.");\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
287 |
|
23600 | 288 |
.fi |
289 |
.if n \{\ |
|
290 |
.RE |
|
291 |
.\} |
|
292 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
293 |
残りのコードでは、ダミーのオブジェクト参照を\fBschedule\fRと\fBcalendar\fRという名前でネーミング・コンテキスト\fBPersonal\fR(\fBctx2\fR)にバインドします。 |
23600 | 294 |
.sp |
295 |
.if n \{\ |
|
296 |
.RS 4 |
|
297 |
.\} |
|
2 | 298 |
.nf |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
299 |
\fB NameComponent nc3 = new NameComponent("schedule", "text");\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
300 |
\fB NameComponent[] name3 = {nc3};\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
301 |
\fB ctx2\&.rebind(name3, objref);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
302 |
\fB System\&.out\&.println("schedule rebind successful!");\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
303 |
\fB \fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
304 |
\fB NameComponent nc4 = new NameComponent("calender", "text");\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
305 |
\fB NameComponent[] name4 = {nc4};\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
306 |
\fB ctx2\&.rebind(name4, objref);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
307 |
\fB System\&.out\&.println("calender rebind successful!");\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
308 |
\fB } catch (Exception e) {\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
309 |
\fB e\&.printStackTrace(System\&.err);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
310 |
\fB }\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
311 |
\fB }\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
312 |
\fB}\fR |
23600 | 313 |
|
314 |
.fi |
|
315 |
.if n \{\ |
|
316 |
.RE |
|
317 |
.\} |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
318 |
.SS "ネームスペースの参照" |
23600 | 319 |
.PP |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
320 |
次のサンプル・プログラムでは、ネームスペースをブラウズする方法を示します。 |
23600 | 321 |
.sp |
322 |
.if n \{\ |
|
323 |
.RS 4 |
|
324 |
.\} |
|
325 |
.nf |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
326 |
\fBimport java\&.util\&.Properties;\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
327 |
\fBimport org\&.omg\&.CORBA\&.*;\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
328 |
\fBimport org\&.omg\&.CosNaming\&.*;\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
329 |
\fB \fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
330 |
\fBpublic class NameClientList {\fR |
23600 | 331 |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
332 |
\fB public static void main(String args[]) {\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
333 |
|
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
334 |
\fB try {\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
335 |
|
23600 | 336 |
.fi |
337 |
.if n \{\ |
|
338 |
.RE |
|
339 |
.\} |
|
340 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
341 |
ネーミング・サービスの起動で、\fBnameserver\fRはポート1050で起動されました。次のコードで、このポート番号をクライアント・システムに知らせます。 |
23600 | 342 |
.sp |
343 |
.if n \{\ |
|
344 |
.RS 4 |
|
345 |
.\} |
|
346 |
.nf |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
347 |
\fB Properties props = new Properties();\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
348 |
\fB props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
349 |
\fB ORB orb = ORB\&.init(args, props);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
350 |
|
23600 | 351 |
.fi |
352 |
.if n \{\ |
|
353 |
.RE |
|
354 |
.\} |
|
355 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
356 |
次のコードでは、初期ネーミング・コンテキストを取得しています。 |
23600 | 357 |
.sp |
358 |
.if n \{\ |
|
359 |
.RS 4 |
|
360 |
.\} |
|
2 | 361 |
.nf |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
362 |
\fB NamingContext nc =\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
363 |
\fB NamingContextHelper\&.narrow(\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
364 |
\fB orb\&.resolve_initial_references("NameService"));\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
365 |
|
2 | 366 |
.fi |
23600 | 367 |
.if n \{\ |
368 |
.RE |
|
369 |
.\} |
|
370 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
371 |
\fBlist\fRメソッドは、ネーミング・コンテキストのバインディングをリストします。この場合、最大1000個までのバインディングが初期ネーミング・コンテキストから\fBBindingListHolder\fRに返されます。残りのバインディングは、\fBBindingIteratorHolder\fRに返されます。 |
23600 | 372 |
.sp |
373 |
.if n \{\ |
|
374 |
.RS 4 |
|
375 |
.\} |
|
376 |
.nf |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
377 |
\fB BindingListHolder bl = new BindingListHolder();\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
378 |
\fB BindingIteratorHolder blIt= new BindingIteratorHolder();\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
379 |
\fB nc\&.list(1000, bl, blIt);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
380 |
|
23600 | 381 |
.fi |
382 |
.if n \{\ |
|
383 |
.RE |
|
384 |
.\} |
|
385 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
386 |
次のコードでは、返された\fBBindingListHolder\fRからバインディングの配列を取得します。バインディングがない場合は、プログラムが終了します。 |
23600 | 387 |
.sp |
388 |
.if n \{\ |
|
389 |
.RS 4 |
|
390 |
.\} |
|
2 | 391 |
.nf |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
392 |
\fB Binding bindings[] = bl\&.value;\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
393 |
\fB if (bindings\&.length == 0) return;\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
394 |
|
23600 | 395 |
.fi |
396 |
.if n \{\ |
|
397 |
.RE |
|
398 |
.\} |
|
399 |
.PP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
400 |
残りのコードでは、バインディングに対してループ処理を行い、名前を出力します。 |
23600 | 401 |
.sp |
402 |
.if n \{\ |
|
403 |
.RS 4 |
|
404 |
.\} |
|
405 |
.nf |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
406 |
\fB for (int i=0; i < bindings\&.length; i++) {\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
407 |
\fB \fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
408 |
\fB // get the object reference for each binding\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
409 |
\fB org\&.omg\&.CORBA\&.Object obj = nc\&.resolve(bindings[i]\&.binding_name);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
410 |
\fB String objStr = orb\&.object_to_string(obj);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
411 |
\fB int lastIx = bindings[i]\&.binding_name\&.length\-1;\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
412 |
\fB \fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
413 |
\fB // check to see if this is a naming context\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
414 |
\fB if (bindings[i]\&.binding_type == BindingType\&.ncontext) {\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
415 |
\fB System\&.out\&.println("Context: " +\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
416 |
\fB bindings[i]\&.binding_name[lastIx]\&.id);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
417 |
\fB } else {\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
418 |
\fB System\&.out\&.println("Object: " +\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
419 |
\fB bindings[i]\&.binding_name[lastIx]\&.id);\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
420 |
\fB }\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
421 |
\fB }\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
422 |
\fB } catch (Exception e) {\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
423 |
\fB e\&.printStackTrace(System\&.err)\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
424 |
\fB }\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
425 |
\fB }\fR |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
426 |
\fB}\fR |
23600 | 427 |
|
2 | 428 |
.fi |
23600 | 429 |
.if n \{\ |
430 |
.RE |
|
431 |
.\} |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
30373
diff
changeset
|
432 |
.SH "関連項目" |
23600 | 433 |
.sp |
434 |
.RS 4 |
|
435 |
.ie n \{\ |
|
436 |
\h'-04'\(bu\h'+03'\c |
|
437 |
.\} |
|
438 |
.el \{\ |
|
439 |
.sp -1 |
|
440 |
.IP \(bu 2.3 |
|
441 |
.\} |
|
442 |
orbd(1) |
|
443 |
.RE |
|
444 |
.br |
|
445 |
'pl 8.5i |
|
446 |
'bp |