全パッケージ クラス階層 このパッケージ 前項目 次項目 インデックス
クラス java.rmi.registry.LocateRegistry
java.lang.Object
|
+----java.rmi.registry.LocateRegistry
- public final class LocateRegistry
- extends Object
このクラスを使用して、特定のホスト (ローカルホストを含む) のブートストラップ Registry を取得できます。次に示すのは、このクラスの使用例です (例外処理は除きます)。
サーバをクライアントから利用できるようにします。
SomeService service = ...; // remote object for service
Registry registry = LocateRegistry.getRegistry();
registry.bind("I Serve", service);
クライアントから上記のサービスに要求を出します。
Registry registry = LocateRegistry.getRegistry("foo.services.com");
SomeService service = (SomeService)registry.lookup("I Serve");
service.requestService(...);
- 参照:
- Registry
-
createRegistry(int)
- ローカルホスト上にレジストリを作成してエクスポートする。
-
getRegistry()
- ローカルホストのリモートオブジェクト Registry を返す。
-
getRegistry(int)
- 現在のホストの指定のポートにあるリモートオブジェクト Registry を返す。
-
getRegistry(String)
- 指定のホストのデフォルトのポート番号 (よく使われる番号) にあるリモートオブジェクト Registry を返す。
-
getRegistry(String, int)
- 指定のホストの指定のポートにあるリモートオブジェクト Registry を返す。
getRegistry
public static Registry getRegistry() throws RemoteException
- ローカルホストのリモートオブジェクト Registry を返します。
getRegistry
public static Registry getRegistry(int port) throws RemoteException
- 現在のホストの指定のポートにあるリモートオブジェクト Registry を返します。
getRegistry
public static Registry getRegistry(String host) throws RemoteException, UnknownHostException
- 指定のホストのデフォルトのポート番号 (よく使われる番号) にあるリモートオブジェクト Registry を返します。ホストの
String
の参照が null
の場合は、ローカルホストが使用されます。
getRegistry
public static Registry getRegistry(String host,
int port) throws RemoteException, UnknownHostException
- 指定のホストの指定のポートにあるリモートオブジェクト Registry を返します。ポートが 0 以下の場合は、デフォルトの Registry のポート番号が使用されます。ホストの
String
の参照が null
の場合は、ローカルホストが使用されます。
- 例外 : UnknownHostException
- ホストが見つからない
createRegistry
public static Registry createRegistry(int port) throws RemoteException
- ローカルホスト上にレジストリを作成してエクスポートします
- パラメータ:
- port - レジストリのエクスポート先のポート
- 例外 : RemoteException
- リモートオブジェクトの作成中にエラーが発生した
全パッケージ クラス階層 このパッケージ 前項目 次項目 インデックス