users@jersey.java.net

[Jersey] Re: Reducing boot time for Jersey + Grizzly server

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Tue, 29 Mar 2011 16:47:43 -0700

On Tue, Mar 29, 2011 at 4:20 PM, Jakub Podlesak
<jakub.podlesak_at_oracle.com> wrote:
> Hi Arnaud,
>
> On 03/28/2011 07:51 PM, Arnaud Bailly wrote:
>>
>> Hello Oleksiy,
>> Thanks for your answer. I must confess I did not measure precisely the
>> boot
>> time, this is just a human feeling. And the console logs seem to point to
>> the class scanning mechanims of Jersey as the main "culprit" :-)
>>
>> Anyway, I managed to find a simple solution: Use an Application object to
>> pass to the servlet container, with all resources and providers created
>> explicitly in the getSingletons() overriden method. I am not sure this is
>> canonical but works pretty well and BTW solves a problem I had with
>
> in fact, using the Application subclass is the standard
> way to configure the JAX-RS application.

+1 for that -- while automatic introspection may be convenient, it is
often bit risky (as well as slow).
So there is nothing wrong in being explicit during bootstrapping.

-+ Tatu +-