vishesh gupta
2017-11-17 05:54:59 UTC
When we are no more referencing a google guice injector in the application,
when will be the resources held by the injector, like Singletons, released
or garbage collected?
To illustrated more, consider this code snippet:
public void someFunction() {Injector injector = Guice.createInjector(new DataStoreBindings());DataTransactor transactor =
injector.getInstance(DataInfoTransactor.class);
transactor.doSomething(); }
Some singleton bindings are also created by this injector. When this
function ends the Injector instance will go out of scope and application
has no way to refer this Injector again.
I want to know, if the injector will be garbage collected? If yes, then
what will happen to the singletons held by the injector?
when will be the resources held by the injector, like Singletons, released
or garbage collected?
To illustrated more, consider this code snippet:
public void someFunction() {Injector injector = Guice.createInjector(new DataStoreBindings());DataTransactor transactor =
injector.getInstance(DataInfoTransactor.class);
transactor.doSomething(); }
Some singleton bindings are also created by this injector. When this
function ends the Injector instance will go out of scope and application
has no way to refer this Injector again.
I want to know, if the injector will be garbage collected? If yes, then
what will happen to the singletons held by the injector?
--
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+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
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/b2ec2692-0833-45b4-a85d-23adb6900ae4%40googlegroups.com.
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+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
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/b2ec2692-0833-45b4-a85d-23adb6900ae4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.