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