jdk/src/linux/doc/man/ja/tnameserv.1
author katleman
Thu, 05 Jan 2012 08:42:37 -0800
changeset 11376 075fe3928b7f
parent 9566 d7241af95355
child 23600 d21826f6c789
permissions -rw-r--r--
Added tag jdk8-b20 for changeset 90e14ec89395
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9566
d7241af95355 7043580: integrate man page translation drop 2 into jdk7
mfang
parents: 9352
diff changeset
     1
." Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
     2
." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
     3
."
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
     4
." This code is free software; you can redistribute it and/or modify it
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
     5
." under the terms of the GNU General Public License version 2 only, as
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
     6
." published by the Free Software Foundation.
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
     7
."
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
     8
." This code is distributed in the hope that it will be useful, but WITHOUT
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
     9
." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    10
." FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    11
." version 2 for more details (a copy is included in the LICENSE file that
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    12
." accompanied this code).
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    13
."
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    14
." You should have received a copy of the GNU General Public License version
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    15
." 2 along with this work; if not, write to the Free Software Foundation,
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    16
." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    17
."
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2692
diff changeset
    18
." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2692
diff changeset
    19
." or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2692
diff changeset
    20
." questions.
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    21
."
9566
d7241af95355 7043580: integrate man page translation drop 2 into jdk7
mfang
parents: 9352
diff changeset
    22
.TH tnameserv 1 "07 May 2011"
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    23
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    24
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    25
.SH "名前"
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    26
Java IDL: 一時ネームサービス \- \f2tnameserv\fP
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    29
このドキュメントでは、Java IDL 一時ネームサービス \f2tnameserv\fP の使用方法について説明します。Java IDL には、Object Request Broker Daemon (ORBD) も含まれています。ORBD は、ブートストラップサービス、一時ネームサービス、\f3持続\fPネームサービス、およびサーバーマネージャーを含むデーモンプロセスです。Java IDL のすべてのチュートリアルでは ORBD を使用していますが、一時ネームサービスを使用する例では、\f2orbd\fP の代わりに \f2tnameserv\fP を使用できます。\f2orbd\fP ツールの詳細については、orbd の orbd(1)または 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
.na
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    31
\f2ORBD に含まれる Java IDL ネームサービス\fP @
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
.fi
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    33
http://java.sun.com/javase/6/docs/technotes/guides/idl/jidlNaming.htmlに関するトピックを参照してください。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    36
ここでは、以下の項目について説明します。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
.RS 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
.TP 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
o
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    41
Java\ IDL 一時ネームサービス 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
.TP 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
o
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    44
Java\ IDL 一時ネームサービスの起動 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
.TP 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
o
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    47
Java\ IDL 一時ネームサービスの停止 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
.TP 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
o
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    50
サンプルクライアント: 名前空間へのオブジェクトの追加 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
.TP 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
o
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    53
サンプルクライアント: 名前空間のブラウズ 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
.RE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    57
.SH "Java IDL 一時ネームサービス"
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    58
.LP
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    60
CORBA の COS (Common Object Services) ネームサービスは、ファイルシステムがファイルに対してディレクトリ構造を提供しているのと同じように、オブジェクト参照に対してツリー構造のディレクトリを提供します。Java IDL の一時ネームサービスである \f2tnameserv\fP は、COS ネームサービスの仕様を単純な形で実装したものです。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    63
オブジェクト参照は名前空間に名前で格納され、オブジェクト参照と名前のペアは、それぞれ「ネームバインディング」と呼ばれます。ネームバインディングは「ネーミングコンテキスト」に組み込むことができます。ネーミングコンテキストはそれ自体がネームバインディングであり、ファイルシステムのサブディレクトリと同じ編成機能を持ちます。すべてのバインディングは「初期ネーミングコンテキスト」に格納されます。名前空間において、初期ネーミングコンテキストは唯一の持続的バインディングです。それ以外のネーミングコンテキストは、Java IDL のネーミングサービスプロセスが停止し、再起動されると失われます。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    66
アプレットまたはアプリケーションから COS ネームサービスを使用するためには、その ORB はネームサービスが動作しているホストのポートを知っているか、そのネームサービスの文字列化された初期ネーミングコンテキストにアクセスできなければなりません。ネームサービスは、Java IDL のネームサービスでもその他の COS 準拠のネームサービスでもかまいません。
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    67
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    68
.SH "Java IDL 一時ネームサービスの起動"
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    69
.LP
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    71
Java IDL ネームサービスは、ネームサービスを使用するアプリケーションまたはアプレットより前に起動しておく必要があります。Java\ IDL 製品をインストールすると、Java\ IDL ネームサービスを起動するスクリプト (Solaris: \f2tnameserv\fP) または実行可能ファイル (Windows NT: \f2tnameserv.exe\fP) が作成されます。バックグラウンドで動作するように、ネームサービスを起動してください。
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    72
.LP
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    73
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    74
特に指定しない場合、Java IDL ネームサービスは、ORB の \f2resolve_initial_references()\fP メソッドと \f2list_initial_references()\fP メソッドの実装に使用するブートストラッププロトコルに対してポート 900 で待機します。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        tnameserv \-ORBInitialPort \fP\f4nameserverport\fP\f3&
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    86
ネームサーバーポートを指定しない場合、デフォルトでポート 900 が使用されます。Solaris ソフトウェアの実行時は、1024 より小さいポートでプロセスを開始する場合、root ユーザーになる必要があります。このため、1024 または 1024 よりも大きいポート番号を使用することをお勧めします。1050 のように別のポートを指定し、ネームサービスをバックグラウンドで実行するには、UNIX コマンドシェルで次のように入力します。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        tnameserv \-ORBInitialPort 1050&
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
    98
Windows の MS\-DOS システムプロンプトでは、次のように入力します。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        start tnameserv \-ORBInitialPort 1050
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   110
ネームサーバーのクライアントには、新しいポート番号を知らせる必要があります。このため、ORB オブジェクトの作成時に \f2org.omg.CORBA.ORBInitialPort\fP プロパティーに新しいポート番号を設定します。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
.SS 
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   113
異なるマシン上でのクライアントとサーバーの実行
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   116
Java IDL と RMI\-IIOP のほとんどのチュートリアルでは、ネームサービス、サーバー、およびクライアントはすべて開発用のマシン上で実行されます。実際に配備する場合には、クライアントとサーバーを、ネームサービスとは異なるホスト上で実行することが多くなります。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   119
クライアントとサーバーがネームサービスを見つけるには、クライアントとサーバーが、ネームサービスが実行されているポートの番号とホストを認識している必要があります。そのためには、クライアントとサーバーのファイル内の \f2org.omg.CORBA.ORBInitialPort\fP プロパティーと \f2org.omg.CORBA.ORBInitialHost\fP プロパティーをネームサービスが実行されているポートの番号とマシンの名前に設定します。この例は、
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
.na
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   121
\f2「RMI\-IIOP を使った Hello World の例」に示されています。\fP @
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
.fi
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   123
http://java.sun.com/javase/6/docs/technotes/guides/rmi\-iiop/rmiiiopexample.htmlコマンド行オプション \f2\-ORBInitialPort\fP \f2nameserverport#\fP と \f2\-ORBInitialHost\fP \f2nameserverhostname\fP を使用して、クライアントとサーバーに対してネームサービスを探す場所を指定することもできます。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
.na
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   125
\f2「Java IDL: 2 台のマシン上で実行する Hello World プログラム」\fP @
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
.fi
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   127
http://java.sun.com/javase/6/docs/technotes/guides/idl/tutorial/jidl2machines.html には、コマンド行オプションを使用して指定する方法が示されています。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   130
たとえば、一時ネームサービス \f2tnameserv\fP が、ホスト \f2nameserverhost\fP のポート 1050 上で実行されているとします。さらに、クライアントがホスト \f2clienthost\fP 上で実行され、サーバーはホスト \f2serverhost\fP 上で実行されているとします。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
.RS 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
.TP 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
o
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   135
次のように、ホスト \f2nameserverhost\fP 上で \f2tnameserv\fP を起動します。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     tnameserv \-ORBInitialPort 1050
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
.TP 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
o
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   147
\f2serverhost\fP 上でサーバーを起動します。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     java Server \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
.TP 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
o
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   157
\f2clienthost\fP 上でクライアントを起動します。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     java Client \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
.RE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
.SS 
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   169
\-J オプション
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   171
このコマンド行オプションは、\f2tnameserve\fP とともに使用できます。 
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   172
.RS 3
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
\-Joption 
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   175
Java 仮想マシンに \f2option\fP を渡します。\f2option\fP には、java(1)のリファレンスページに記載されているオプションを 1 つ指定します。たとえば、\f3\-J\-Xms48m\fP と指定すると、スタートアップメモリーは 48M バイトに設定されます。\f3\-J\fP を使って背後の実行環境にオプションを渡すことはよく行われています。 
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   176
.RE
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   177
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   179
.SH "Java IDL 一時ネームサービスの停止"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   182
Java IDL ネームサービスを停止するには、Unix の場合は、\f2kill\fP などのオペレーティングシステムのコマンドを使い、Windows の場合は、\f2Ctrl\-C\fP を使います。ネームサービスを明示的に停止するまでは、呼び出し待機状態が続きます。なお、サービスを終了させると、Java IDL ネームサービスに登録されている名前は失われます。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   184
.SH "サンプルクライアント: 名前空間へのオブジェクトの追加"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   187
次に示すサンプルプログラムは、名前を名前空間に追加する方法を示すものです。このサンプルプログラムは、このままの状態で完全に動作する一時ネームサービスクライアントで、次のような単純なツリーを作成するものです。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
\fP\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
.fl
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   194
                  \fP\f4初期\fP\f3
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
.fl
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   196
               \fP\f4ネーミングコンテキスト\fP\f3
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
.fl
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   198
                  /      \\ 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
.fl
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   200
                 /        \\ 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
              plans     \fP\f4Personal\fP\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
.fl
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   204
                         /   \\ 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
.fl
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   206
                        /     \\ 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                   calendar  schedule\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   214
この例で、\f3plans\fP はオブジェクト参照、\f3Personal\fP は \f3calendar\fP と \f3schedule\fP の 2 つのオブジェクト参照を含むネーミングコンテキストです。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
import java.util.Properties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
import org.omg.CORBA.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
import org.omg.CosNaming.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
public class NameClient
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
   public static void main(String args[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
   {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
      try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   241
前述の「Java IDL 一時ネームサービスの起動」で、ネームサーバーはポート 1050 を使用して起動しました。次のコードで、このポート番号をクライアントシステムに知らせます。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        Properties props = new Properties();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
        props.put("org.omg.CORBA.ORBInitialPort", "1050");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        ORB orb = ORB.init(args, props);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   257
次のコードでは、初期ネーミングコンテキストを取得し、それを \f3ctx\fP に代入します。2 行目では、\f3ctx\fP をダミーのオブジェクト参照 \f3objref\fP にコピーします。この objref には、あとでさまざまな名前を割り当てて名前空間に追加します。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
        NamingContext ctx =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
NamingContextHelper.narrow(orb.resolve_initial_references("NameService"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        NamingContext objref = ctx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   273
次のコードでは、text 型の名前 plans を作成し、それをダミーのオブジェクト参照にバインドします。その後、rebind を使用して初期ネーミングコンテキストの下に \f2plans を追加しています\fP。 \f2rebind\fP メソッドを使用すれば、bind を使用した場合に発生する例外を発生させずに、 \f2このプログラムを何度も繰り返し実行できます\fP。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        NameComponent nc1 = new NameComponent("plans", "text");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
        NameComponent[] name1 = {nc1};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
        ctx.rebind(name1, objref);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        System.out.println("plans rebind sucessful!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   291
次のコードでは、directory 型の Personal というネーミングコンテキストを作成します。その結果得られるオブジェクト参照 \f3ctx2\fP をこの名前にバインドし、初期ネーミングコンテキストに追加します。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
        NameComponent nc2 = new NameComponent("Personal", "directory");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
        NameComponent[] name2 = {nc2};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        NamingContext ctx2 = ctx.bind_new_context(name2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        System.out.println("new naming context added..");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   309
残りのコードでは、ダミーのオブジェクト参照を schedule と calendar という名前でネーミングコンテキスト "Personal" (\f3ctx2\fP) にバインドします。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
        NameComponent nc3 = new NameComponent("schedule", "text");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
        NameComponent[] name3 = {nc3};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
        ctx2.rebind(name3, objref);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
        System.out.println("schedule rebind sucessful!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
        NameComponent nc4 = new NameComponent("calender", "text");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
        NameComponent[] name4 = {nc4};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
        ctx2.rebind(name4, objref);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
        System.out.println("calender rebind sucessful!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    } catch (Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
        e.printStackTrace(System.err);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   349
.SH "サンプルクライアント: 名前空間のブラウズ"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   352
次のサンプルプログラムでは、名前空間をブラウズする方法を示します。
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
import java.util.Properties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
import org.omg.CORBA.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
import org.omg.CosNaming.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
public class NameClientList
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
   public static void main(String args[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
   {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
      try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   379
前述の「Java IDL 一時ネームサービスの起動」で、ネームサーバーはポート 1050 を使用して起動しました。次のコードで、このポート番号をクライアントシステムに知らせます。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
        Properties props = new Properties();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
        props.put("org.omg.CORBA.ORBInitialPort", "1050");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
        ORB orb = ORB.init(args, props);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   399
次のコードでは、初期ネーミングコンテキストを取得しています。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
        NamingContext nc =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
NamingContextHelper.narrow(orb.resolve_initial_references("NameService"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   413
\f2list\fP メソッドは、ネーミングコンテキストに追加されているバインディングをリストします。この場合、最大 1000 個までのバインディングが初期ネーミングコンテキストから BindingListHolder に返されます。残りのバインディングは、BindingIteratorHolder に返されます。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
        BindingListHolder bl = new BindingListHolder();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
        BindingIteratorHolder blIt= new BindingIteratorHolder();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
        nc.list(1000, bl, blIt);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   429
次のコードでは、返された BindingListHolder からバインディングの配列を取得します。バインディングがない場合は、プログラムは終了します。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
        Binding bindings[] = bl.value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
        if (bindings.length == 0) return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
.LP
9352
cabba0c0f3ee 7025070: man page localization broken in jdk7
ogino
parents: 5865
diff changeset
   443
残りのコードでは、バインディングに対してループ処理を行い、名前を出力します。 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
        for (int i=0; i < bindings.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
            // get the object reference for each binding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
            org.omg.CORBA.Object obj = nc.resolve(bindings[i].binding_name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
            String objStr = orb.object_to_string(obj);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
            int lastIx = bindings[i].binding_name.length\-1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
            // check to see if this is a naming context
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
            if (bindings[i].binding_type == BindingType.ncontext) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
              System.out.println( "Context: " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
bindings[i].binding_name[lastIx].id);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
                System.out.println("Object: " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
bindings[i].binding_name[lastIx].id);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
       } catch (Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
        e.printStackTrace(System.err);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
       }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
.LP
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   495