JRMP および IIOP 用に自分自身をエクスポートする次のサーバー クラスがあります。
public class FooServer implements RemoteInt{
FooServer(){
UnicastRemoteObject.exportObject(this);
PortableRemoteObject.exportObject(this);
}
public boolean remoteMethod() throws RemoteException{
// some stuff
return false;
}
}
そして、サーバーを作成して実行中のレジスタに登録する次のセットアップ クラス:
public class Setup{
public static void main(String[] args){
RemoteInt serv = new FooServer();
Naming.rebind("//localhost/server", this);
}
}
問題は、セットアップがジョブを終了すると、FooServer が終了するまで待機することです。代わりに、FooServer を実行したまま Setup クラスを終了したいと思います。どのようにできるのか?