users@jersey.java.net

[Jersey] Re: how can I initialize and cache long-lived application-scope objects

From: Martynas Jusevicius <martynas_at_graphity.org>
Date: Fri, 10 Feb 2012 19:57:06 +0100

Hey,

What about Application constructor or @PostConstruct?

Not sure if it is the best way, but I used @PostConstruct because I
needed access to injected ServletContext in order to read some local
files.

Martynas
graphity.org

On Fri, Feb 10, 2012 at 7:34 PM, Jim the Standing Bear
<standingbear_at_gmail.com> wrote:
> Any suggestions?
>
> On Thu, Feb 9, 2012 at 11:29 AM, Jim the Standing Bear
> <standingbear_at_gmail.com> wrote:
>> Hi,
>>
>> I just started using Jersey and am developing a RESTful webservice for
>> tomcat 6.   How can I construct and cache some long-lived
>> application-scope objects in Jersey so that the root resources can
>> quickly (re)use these objects when requests are received?  Thanks.
>>
>> -- Jim
>
>
>
> --
> --------------------------------------
> Standing Bear Has Spoken
> --------------------------------------