dev@jersey.java.net

Re: [Jersey] Programmatic API for configuring Jersey's ServletContainer

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 28 Sep 2009 09:46:04 +0200

On Sep 25, 2009, at 4:04 PM, Jeanfrancois Arcand wrote:

> Salut,
>
> Paul Sandoz wrote:
>> Hi,
>> I have thought some more about this and the following may be what
>> is required:
>> 1) An AtmosphereJerseyServletContainer that extends or adapts
>> ServletContainer.
>> That servlet can be referred to in the web.xml.
>
> That will not work as in order to support WebLogic, the
> AtmosphereServlet needs to extends one of their class. I find it
> hard to not support them those days (LOL) :-)
>
> I think we should need to do the contrary.
>

OK, 5) is required then.

>
>> The configure method of ServletContainer can be overridden to
>> modify the ResourceConfig.
>> 2) Modify ResourceConfig so that filters can be added
>> programatically.
>
> +1
>
>> Nice to have:
>> 3) Declare Guice/Spring support using a context listener.
>> Because a specific servlet is declared we need another
>> mechanism to declare support rather than the current
>> mechanism of using Guice/Spring specific servlets. I think this
>> approach is useful anyway.
>> 4) When underlying Servlet 3.0 support is available we could
>> utilize an @Atmosphere annotation on the
>> class that extends Application. This would be a meta-annotated
>> with an annotation that declares the
>> servlet in 2) to be used.
>
> Note that Atmosphere already support Servlet 3.0 so we can probably
> star from there as well.
>

OK.

Paul.

>> 5) A provider mechanism to initiate ResourceConfig.
>
> +1
>
> A+
>
> -- Jeanfrancois
>
>
>> Paul.
>> On Sep 24, 2009, at 5:28 PM, Paul Sandoz wrote:
>>> On Sep 24, 2009, at 4:58 PM, Jeanfrancois Arcand wrote:
>>>>>>
>>>>>> Any solutions will works. Right now Atmosphere uses the
>>>>>> ServletContainer but that may change since we have discussed
>>>>>> the possibility of running Atmosphere on top of Jersey instead
>>>>>> of Jersey on top of Atmosphere.
>>>>>>
>>>>> Ah! topsy turvy :-) why?
>>>>
>>>> You didn't want to be able to support some annotation here
>>>> instead of having to define Atmosphere in web.xml? I was under
>>>> the impression that we discussed something like @Atmosphere
>>>> support, but here :-)
>>>>
>>>
>>> OK, i got it now. It was not clear to me that required Atmosphere
>>> on top of Jersey, but i see what you mean.
>>>
>>> IIRC the initial thought was can the number of XML configuration
>>> files be reduced to just the web.xml for web deployments.
>>>
>>> The annotation occurred to me if there was a class that extends
>>> javax.ws.rs.core.Application that it could be annotated with
>>> something like @Atmosphere. Thus, if using Servlet 3.0 one does
>>> not require a web.xml.
>>>
>>>
>>>
>>>>>>
>>>>>>> If so i think Victor's solution of a ResourceConfigTransformer
>>>>>>> (as sent on the atmosphere list, see attached) seems like a
>>>>>>> good solution.
>>>>>>
>>>>>> +1
>>>>>>
>>>>> Could you log the issue if not already, i don't recall if you
>>>>> did, but i am in the process of sensory information overload at
>>>>> the moment.
>>>>
>>>> Done.
>>>>
>>>
>>> Thanks,
>>> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>