Java remote method invocation: Difference between revisions

Content deleted Content added
Mhaeusser (talk | contribs)
m Removed unnecessary spaces, removed "public" from interface method.
Mhaeusser (talk | contribs)
m Better variable name: server instead of obj
Line 50:
//Instantiate RmiServer
RmiServer objserver = new RmiServer();
 
RmiServer obj = new RmiServer();
 
// Bind this object instance to the name "RmiServer"
Naming.rebind("//localhost/RmiServer", objserver);
System.out.println("PeerServer bound in registry");
}
Line 78 ⟶ 77:
public class RmiClient {
public static void main(String args[]) throws Exception {
RmiServerIntf objserver = (RmiServerIntf)Naming.lookup("//localhost/RmiServer");
System.out.println(objserver.getMessage());
}
}