プロセスの起動
サーバプロセスの起動
次のクラスを右クリックし,「Run As」-「Java Application」を選択します.
s2rmi-examples-serverプロジェクトexamples.rmi.server.ServerMainクラス
コンソールに次のように表示されます.
2006-12-03 07:22:16.531 [DEBUG] main org.seasar.remoting.rmi.deployer.impl.RMIAdaptorDeployerImpl
RMIレジストリをポート 1108 で作成しました。
2006-12-03 07:22:16.593 [DEBUG] main org.seasar.remoting.rmi.deployer.impl.RMIAdaptorDeployerImpl
RMIアダプタをサービスポート 1109 で公開しました。
2006-12-03 07:22:16.593 [DEBUG] main org.seasar.remoting.rmi.deployer.impl.RMIAdaptorDeployerImpl
公開したRMIアダプタをRMIレジストリにバインドしました。
クライアントプロセスの起動
次のクラスをJavaエディタで開きます.
s2rmi-examples-clientプロジェクトexamples.rmi.client.ClientMainクラス
public class ClientMain {
public static void main(String[] args) throws Exception {
SingletonS2ContainerFactory.init();
S2Container container = SingletonS2ContainerFactory.getContainer();
Class.forName(HelloHelper.class.getName());
for (int i = 0; i < 3; ++i) {
HotdeployUtil.start();
HelloHelper hello = (HelloHelper) container
.getComponent(HelloHelper.class);
System.out.println(hello.say());
HotdeployUtil.stop();
}
SingletonS2ContainerFactory.destroy();
}
}
ソースの以下の部分 (35行目) にブレークポイントを設定します.
HotdeployUtil.start();
クラスを右クリックし,「Debug As」-「Java Application」を選択します.
ブレークポイントで停止します.
