62,612
社区成员
发帖
与我相关
我的任务
分享
try {
PaymentImpl robj = new PaymentImpl();
Payment stub = (Payment) UnicastRemoteObject.exportObject(robj, 0);
Registry registry = LocateRegistry.getRegistry();
registry.bind("Mortgage", stub);
System.out.println("Mortgage Server is ready to listen");
} catch (Exception e) {
}
}
try {
Registry reg = LocateRegistry.getRegistry("localhost");
stub = (Payment) reg.lookup("Mortgage");
} catch (Exception e)
LocateRegistry.createRegistry(1099);
HelloInterface hello = new Hello("Hello, world!");
//把hello注册到RMI注册服务器上,命名为Hello
Naming.rebind("Hello", hello);