FWIW - We have used a static injector for many, many years - especially in
our Jersey services - and we haven't run into any issues.

On Tue, Apr 28, 2015 at 4:19 AM, cp <chitraprasanna.anbala...@songhi.com>
wrote:

> In com.google.inject.servlet.GuiceServletContextListener the Injector is
> set as a servlet context attribute.
>
> So I wonder whether we can have static Injector then.
>
> Since we are using jersey(for REST) in some part of our projects and use
> guice as the DI.
> We wanted to share the same injector reference across both these
> components, by making it static.
>
>
>
> On Wednesday, March 14, 2007 at 5:37:30 AM UTC+2, crazy...@gmail.com
> wrote:
>>
>> On 3/13/07, Robin Sheat <eyt...@gmail.com> wrote:
>>
>>> Hi there, are the calls to things like injector.getInstance thread-
>>> safe? As I gradually move my program to using Guice throughout, the
>>> unported classes still have a lot of Factory.getSomething() calls
>>> which I'll be implementing with calls to getInstance. Should I
>>> implement synchronisation on them, or is it handled internally? (i.e.
>>> if one request causes a singleton to be created, and another request
>>> comes in while that instance is being created, will that be a
>>> problem?)
>>
>>
>> Injector is thread safe, and very concurrent. Don't worry about
>> synchronizing.
>>
>> Bob
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-guice+unsubscr...@googlegroups.com.
> To post to this group, send email to google-guice@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-guice.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-guice/1d00f451-e6f2-4501-81f9-454e3f1f1780%40googlegroups.com
> <https://groups.google.com/d/msgid/google-guice/1d00f451-e6f2-4501-81f9-454e3f1f1780%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/CAMBZqfBOybV7Qrpa6PM3YM%3DUoA1etDy9E8rJkt%2B6cZA%3Dz1Varw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to