title: what make rmi server keep running?
body: <p>I have the following RMI server code:</p>
  
  <pre><code>public class ServerProgram {
      public ServerProgram() {
          try {
              LocateRegistry.createRegistry(1097);
              Calculator c = new CalculatorImpl();
              String name = "rmi://host:port/name";
              Naming.rebind(name, c);
              System.out.println("Service is bound......");
          } catch (Exception e) {
          }
      }
      public static void main(String[] args) {
          new ServerProgram();
      }
  }
  </code></pre>
  
  <p>When the above program running, it keeps running to wait for client requests. But what I do not understand is what make that program keeps running while it is not in something like <code>while(true){};</code> and how to stop it from listening, except stopping the whole program?</p>