It sounds like you might want to use a childInjector pattern here. Structure it something like this:
Global Injector binds everything that is truly a singleton in your project. Then in the service(s) where you want to be able to set some state and create a new object that references the global state create a childInjector. It's possible I don't completely understand your use case. Though, I think this should help you do what you want. Nate On Sun, Oct 19, 2014 at 12:47 AM, Kevin Burton <[email protected]> wrote: > Long story short, I've painted myself into a corner. > > I was creating new modules and a new injector in some code each time a > service started. > > The problem is I need to keep state by moving over singletons to the new > injector. > > The problem is, some of these bindings are now changes and possibly > replaced. > > Is it possible to migrate all existing singletons to a new injector with > new bindings? > > -- > 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/bcb4d057-1685-409e-ae6b-b66913d6464e%40googlegroups.com > <https://groups.google.com/d/msgid/google-guice/bcb4d057-1685-409e-ae6b-b66913d6464e%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 [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/CAHNex99n0RxfgUMJUsF23GWMNbSxsRqSxQW%3DJ6iX8YUG2OeTDg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
