Would this also work for scoped <https://github.com/google/guice/wiki/Scopes> instances ? If not, what are recommendations for cleaning / closing resources created in some scope (eg. request) ?
On Sunday, October 23, 2016 at 12:06:41 PM UTC-4, Tavian Barnes wrote: > > This is what ProvisionListener is for. > > On Friday, 21 October 2016 18:38:11 UTC-4, Kevin Burton wrote: >> >> I'm trying to figure out if this is possible but I think I'm looking in >> the wrong places. >> >> I want to add some syntactic sugar to Guice so that we have AutoService >> interfaces on our objects that have start / stop methods. >> >> This way I can create a normal Guice binding, create my injector, and >> then I can have my 'app' call start() in one place which starts all the >> services. >> >> This way I can have a basic injector to just test bindings, then in >> production start() my app which will connect to databases, open large >> files, etc. >> >> The problem I'm having is I need a handle on every instance of a new >> object guice creeates. >> >> I thought I could do this via BindListener but I only get the class, not >> that actual instance that was created. >> >> I'm sure I'm just looking in the wrong place so some advice would be >> super helpful... >> > -- 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 https://groups.google.com/group/google-guice. To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/ba47e8aa-37e7-4b6a-a91b-7db4e05dfdeb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
