title: Howto setup a Daemon implementation as windows service
body: <p>I didn't find any really good example (actually I did not find a single example) on how to register a class that implements the <code>org.apache.commons.daemon.Daemon</code> interface as Windows service.</p>
  
  <p>Do I have to register this implementation using procrun? But than there doesn't seem to be a point in implementing the interface as procrun can register any program as windows service.</p>
  
  <p>Furthermore there seems to be a docu-bug on the procrun page (<a href="http://commons.apache.org/proper/commons-daemon/procrun.html" rel="nofollow">http://commons.apache.org/proper/commons-daemon/procrun.html</a>):</p>
  
  <p>The description of the <code>--StartMethod</code> parameter states:</p>
  
  <blockquote>
    <p>Note: in jvm mode, the start method should not return until the stop method has been called.</p>
  </blockquote>
  
  <p>But further down the page in the "Using Procrun in jvm mode" section:</p>
  
  <blockquote>
    <p>Note that the method handling service start should create and start a separate thread to carry out the processing, and then return. The start and stop methods are called from different threads.</p>
  </blockquote>
  
  <p>Am I reading this wrong or is this a little conflicting?? And what would be the correct behavior of a static start(String[] args) method?</p>
  
  <p>Best regards</p>