users@jersey.java.net

Running resources as a service

From: Richard Levenberg <richardl_at_ufp.com>
Date: Mon, 09 Mar 2009 05:35:27 -0700

I may have missed this already in the forum, but what is the easiest,
with the least overhead, way to run Jersey resources as services. I
already have things running under Tomcat but for certain services I want
them running standalone. I have the following code from the examples:

        HttpServer server =
HttpServerFactory.create("http://localhost:9998/");
        server.start();

        System.out.println("Server running");
        System.out.println("Hit return to stop...");
        System.in.read();

What is the recommended way to daemonize that code so that it runs as a
service?