users@jersey.java.net

Re: [Jersey] Jersey & OSGi <was> Re: [Jersey] Jersey 1.0.3 released

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 30 Apr 2009 12:28:04 +0200

On Apr 30, 2009, at 2:43 AM, Jeanfrancois Arcand wrote:

> Salut,
>
> Richard Wallace wrote:
>> On Wed, Apr 29, 2009 at 1:10 AM, Paul Sandoz <Paul.Sandoz_at_sun.com>
>> wrote:
>>> On Apr 28, 2009, at 6:33 PM, Richard Wallace wrote:
>>>
>>>> Hey Paul,
>>>>
>>>> The context listener looks ok for the general approach, but still
>>>> doesn't solve the problem when running in OSGi because there isn't
>>>> really a concept of servlet listeners there (sure you can use Pax
>>>> Web
>>>> and their extensions, but as of right now there is no standard
>>>> way of
>>>> registering context listeners).
>>>>
>>> Oh, i think i misunderstood, i thought a servlet container would
>>> still be
>>> used? if not then how would HTTP requests be dispatched?
>>>
>>> I guess i am not understanding the big picture of how things are
>>> glued
>>> together. When an instance of ServletContainer is obtained what
>>> happens
>>> next? would the ServletContainer be initialized by calling
>>> Servlet.init(ServletConfig ) ?
>>>
>> There is a servlet container, but it's not used by deploying war
>> files. Instead, bundles register Servlets with the HttpService
>> <http://www.osgi.org/javadoc/r4v41/org/osgi/service/http/HttpService.html
>> >.
>> The servlet container behind the HttpService then handles
>> initializing
>> the Servlet after it's been registered.
>
> Shameless plug but I do think the explanation is quite clear:
>
> http://codemeself.blogspot.com/2009/03/grizzly-osgi-http-service-guide.html
>
> In short, Grizzly support the HttpService spec. That could probably
> helps testing...
>

Indeed! that will be most useful, i may be asking you some questions
in the near future!

Paul.