title: Server via RMI without registry
body: <p>I have a service object that can be connected to via RMI. Currently I'm doing this:</p>
  
  <p><strong>Server</strong></p>
  
  <pre><code>Registry r = LocateRegistry.createRegistry(1234);
  r.bind("server", UnicastRemoteObject.exportObject(remoteServer, 0));
  </code></pre>
  
  <p><strong>Client</strong></p>
  
  <pre><code>RemoteServer s = LocateRegistry.getRegistry("example.com", 1234).lookup("server");
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>UnicastRemoteObject.exportObject(remoteServer, 1234);
  </code></pre>
  
  <p>But then how would I connect to the server object from the client?</p>