I have a service object that can be connected to via RMI. Currently I'm doing this:
Server
Registry r = LocateRegistry.createRegistry(1234);
r.bind("server", UnicastRemoteObject.exportObject(remoteServer, 0));
Client
RemoteServer s = LocateRegistry.getRegistry("example.com", 1234).lookup("server");
The registry on the server has only one use, to link to the single server object. I figured I might just as well do this on the server:
UnicastRemoteObject.exportObject(remoteServer, 1234);
But then how would I connect to the server object from the client?