On Tuesday, April 28, 2015 at 8:03:51 AM UTC-4, Robert Voliva wrote: > > FWIW - We have used a static injector for many, many years - especially in > our Jersey services - and we haven't run into any issues. >
You won't run into issues, per se, but what you'll find is that it limits the flexibility of the system. Particularly, if you'd like to be able to cleanly and completely *unload* an application (say, dynamically reconfigure and restart something) without stopping the JVM and without leaks, a static reference to the injector is going to be a problem. And you actually *can* do that sort of thing with Guice, if you add some hooks to manage shut-down and unloading of things (i.e. the equivalent of adding a shutdown hook in Runtime.getRuntime(), and let anything that opens connection pools, thread pools, timers, etc. hang shutdown code to get run off of that). It's one of those things that people are so unused to being able to do in Java that you don't know how nice it is to have until you can actually do it (say, a server that completely unloads and reconfigures itself based on a unix signal, transparently and quickly). -Tim -- 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 [email protected]. To post to this group, send email to [email protected]. 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/9b90be34-379f-4cca-97fc-b169b548f75b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
