-4
在服務器端,Route
是遠程接口,我將3個遠程對象綁定到一個註冊表中。JAVA RMI我可以註冊多個遠程對象到不同名稱的註冊表中嗎?
這可以使用嗎?
try {
Route c = new Journey("Cork", "Dublin", "2:44");
Route g = new Journey("Galway", "Dublin", "2:44");
Route b = new Journey("Bray", "Dublin", "0:44");
Route stub1 = (Route) UnicastRemoteObject.exportObject(c,0);
Route stub2 = (Route) UnicastRemoteObject.exportObject(g,0);
Route stub3 = (Route) UnicastRemoteObject.exportObject(b,0);
Registry registry = LocateRegistry.createRegistry(1109);
registry.bind("Cork", stub1);
registry.bind("Galway", stub2);
registry.bind("Bray", stub3);
System.out.println("Routes are registered.");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
允許客戶預訂旅程。您不應該能夠預訂預訂。此應用程序應至少有3個旅程可供選擇。每個旅程應允許有3個預訂
請查看[常見問題解答 - 我如何提出一個好問題?](http://stackoverflow.com/help/how-to-ask)如何提出好問題,以便您得到很好的答案。 本質上,有缺少你的實際問題的描述 – 2014-10-06 11:20:14
這個問題沒有意義 – Leri 2014-10-06 11:23:39
你可以再看看嗎?請? Nanne Leri – TheRootUser 2014-10-06 12:12:25