That's just fine. On Wed, Dec 17, 2008 at 12:30 AM, Gavin Bong <[email protected]> wrote:
> > On the same topic, if I save my Injector (returned from > createInjector) inside a local variable in my servlet, and call it on > every doGet() / doPost(), would that be ok ? > > I'm calling Injector.getInstance( .. ) for every invocation of the > servlet. > > Regards, > > Gavin > > > > Once Guice returns from createInjector, thread safety is up to you. So if > > you have a provider that manages its own lazyy reference to something, > it's > > up to you to make sure it is thread safe. The same goes for everything > that > > is mutable. Singletons that keep mutable state need to be properly > > synchronized / volatile'd. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-guice?hl=en -~----------~----~----~----~------~----~------~--~---
