users@jersey.java.net

Re: [Jersey] Re: automatic resource registration and guice

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 07 Jun 2010 09:19:36 +0200

Hi,

Please take a look at the following code in the interim of myself
having time to look at the attachment you sent me.

http://fisheye4.atlassian.com/browse/jersey/trunk/jersey/contribs/jersey-guice/src/test/java/com/sun/jersey/guice/AbstractGuiceGrizzlyTest.java?r=HEAD

http://fisheye4.atlassian.com/browse/jersey/trunk/jersey/contribs/jersey-guice/src/test/java/com/sun/jersey/guice/ProvidesTest.java?r=HEAD

The above are some guice-based unit tests using Grizzly. Take a close
look at the AbstractGuiceGrizzlyTest.startServer method.

Paul.

On Jun 4, 2010, at 8:22 PM, Christopher Piggott wrote:

> Seems like, with every request, GrizzlyAdapter.service()
> calls GrizzlyAdapterChain.service()
> calls GrizzlyAdapter.service()
> calls ServletAdapter.service()
> calls ServietAdapter.doService()
> calls FilterChainImpl.invokeFilterChain()
> calls FilterChainImpl.doFilter()
> which ultimately re-creates my GuiceServletContextListener.
>
> So ... why would this:
>
>> ServletAdapter sa = new ServletAdapter();
>> sa.addServletListener(ProtobufServletConfig.class);
>> sa.addFilter(new GuiceFilter(), "guiceFilter", null);
>
> cause it to recreate an instance of a brand new servlet every time?
>
>
>
> On Fri, Jun 4, 2010 at 1:51 PM, Christopher Piggott <cpiggott_at_gmail.com
> > wrote:
>> It doesn't seem like I should be getting this for every request,
>> does it?
>>
>> INFO com.sun.jersey.server.impl.application.WebApplicationImpl (602)
>> Initiating Jersey application, version 'Jersey: 1.2 05/07/2010 02:04
>> PM'
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>