users@jersey.java.net

Re: [Jersey] Running resources as a service

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 09 Mar 2009 18:31:13 +0100

On Mar 9, 2009, at 1:35 PM, Richard Levenberg wrote:

> 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();
>

Yes, that is the simplest way to use the LW HTTP server, which is
shipped with Java SE 6, for a stand alone deployment

Most of our examples now use Grizzly as we have found that more
reliable and fixes to any issues happen very quickly:

   https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.0.2/jersey/getting-started.html

Paul.

> What is the recommended way to daemonize that code so that it runs
> as a service?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>