@Test public void getService() throws Exception { AInterface service = (AInterface) RMIRegistry.getClient("localhost").getService("test"); service.f(); service.str(12); }
public Object getService(String name) throws IOException, ClassNotFoundException { if (localServices.containsKey(name)) { return localServices.get(name); } Object service = remoteService.getService(name); localServices.put(name, service); return service; }
RMIRegistry { public Object getService(String name) throws IOException, ClassNotFoundException { if (localServices.containsKey(name)) { return localServices.get(name); } Object service = remoteService.getService(name); localServices.put(name, service); return service; } }
RMIRegistry { public Object getService(String name) throws IOException, ClassNotFoundException { if (localServices.containsKey(name)) { return localServices.get(name); } Object service = remoteService.getService(name); localServices.put(name, service); return service; } private  RMIRegistry(String hostName, boolean server); }
RMIRegistry { public Object getService(String name) throws IOException, ClassNotFoundException { if (localServices.containsKey(name)) { return localServices.get(name); } Object service = remoteService.getService(name); localServices.put(name, service); return service; } private  RMIRegistry(String hostName, boolean server); static RMIRegistry getClient(String serverHostName); static RMIRegistry getServer(); void register(String name, T aInterface); Object getService(String name); }
RMIRegistry { public Object getService(String name) throws IOException, ClassNotFoundException { if (localServices.containsKey(name)) { return localServices.get(name); } Object service = remoteService.getService(name); localServices.put(name, service); return service; } private  RMIRegistry(String hostName, boolean server); static RMIRegistry getClient(String serverHostName); static RMIRegistry getServer(); void register(String name, T aInterface); Object getService(String name);  }