users@jersey.java.net

[Jersey] How to do Guice-based Grizzly-in-process-based deployment?

From: wierob <wierob83_at_googlemail.com>
Date: Thu, 16 Dec 2010 06:13:04 -0800 (PST)

Hi,

I'm trying to host my Jersey service using an embedded Grizzly server. The
service is configured via a GuiceFilter.

After reading the source code of the GrizzlyWebTestContainerFactory class I
found the following solution:

        GrizzlyWebServer webServer = new GrizzlyWebServer(9999);
        ServletAdapter adapter = new ServletAdapter();

        adapter.addServletListener("my.package.MyGuiceListener");
        adapter.addFilter(new GuiceFilter(), "jerseyfilter", null);
        adapter.setServletPath("/");

        webServer.addGrizzlyAdapter(adapter, null);
        webServer.start();
        System.in.read();
        webServer.stop();

However, with this setup the the
"com.sun.jersey.config.property.WebPageContentRegex"-Feature does not work.

Since Jersey allows:

        SelectorThread st = RuntimeDelegate.createEndpoint(new
MyApplication(), SelectorThread.class);

Is there something like a GuiceFilter-enabled version of
javax.?ws.?rs.?core.Application?

thanks in advance
-- 
View this message in context: http://jersey.576304.n2.nabble.com/How-to-do-Guice-based-Grizzly-in-process-based-deployment-tp5841767p5841767.html
Sent from the Jersey mailing list archive at Nabble.com.