title: What is the best way to keep a Java program running forever, or for a very long time?
body: <p>I have java app which supports multiple workflows. Workflow is chosen using arguments passed to it from command line. In one of the workflow app needs to run for infinite time. I am achieving the same using following code</p>
  
  <pre><code>switch (args[0]) { 
      case "-runForever":
       // Some Computation
       Thread.sleep(Long.MAX_VALUE);
       break;
      case "otherCase:
       //dosomething
       break;
  }
  </code></pre>
  
  <p>Is it a good way of achieving the required functionality? </p>